File: 07_allowuser.dpatch

package info (click to toggle)
solid-pop3d 0.15-23
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 896 kB
  • ctags: 448
  • sloc: ansic: 6,085; sh: 4,682; makefile: 527
file content (80 lines) | stat: -rw-r--r-- 2,553 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh -e
## 06_allowuser.dpatch by Adam D. Barratt <debian-bts@adam-barratt.org.uk>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Add AllowUser option (bug#77710).

if [ $# -lt 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
diff -Nur solid-pop3d-0.15-6/man/spop3d.conf.5 solid-pop3d-0.15-7/man/spop3d.conf.5
--- solid-pop3d-0.15-6/man/spop3d.conf.5	2004-01-25 17:13:38.000000000 +0100
+++ solid-pop3d-0.15-7/man/spop3d.conf.5	2004-01-25 17:13:44.000000000 +0100
@@ -189,6 +189,13 @@
 If enabled maildrop (mailbox or maildir) will be created, when it doesn't
 exist. Option is disabled by default.
 .TP
+.B AllowUser boolean
+Allow USER/PASS authentication. This option is enabled by default.
+It's the standard method of user authentication and you probably don't
+need to disable it.
+You must have at least one authentication method enabled
+(AllowUser or AllowAPOP).
+.TP
 .RE
 .SH EXAMPLE
 .RS
diff -Nur solid-pop3d-0.15-6/src/configfile.h solid-pop3d-0.15-7/src/configfile.h
--- solid-pop3d-0.15-6/src/configfile.h	2000-04-30 22:56:20.000000000 +0200
+++ solid-pop3d-0.15-7/src/configfile.h	2004-01-25 17:13:44.000000000 +0100
@@ -79,6 +79,7 @@
 #ifdef STATISTICS
 extern int logstatistics;
 #endif
+extern int allowuser;
 
 struct str_option {
 	char *name;
diff -Nur solid-pop3d-0.15-6/src/main.c solid-pop3d-0.15-7/src/main.c
--- solid-pop3d-0.15-6/src/main.c	2004-01-25 17:13:38.000000000 +0100
+++ solid-pop3d-0.15-7/src/main.c	2004-01-25 17:13:44.000000000 +0100
@@ -187,9 +187,11 @@
 	{"LogStatistics", OP_BOOLEAN, &logstatistics, 0, NULL},
 #endif
 	{"LogPriority", OP_STRING, &logpriority, 64, check_logpriority},
+	{"AllowUser", OP_BOOLEAN, &allowuser, 0, NULL},
 	{NULL, 0, NULL, 0, NULL}
 };
 
+int allowuser = 1;
 int connection_state;
 char username[MAXARGLN + 1];
 char password[MAXARGLN + 1];
@@ -559,6 +561,11 @@
 void get_username(char *arg) {
 	int tmp = 0;
 
+	if (!allowuser) {
+		send_error("USER/PASS authentication not allowed");
+		check_wccount();
+		return;
+	}
 	if (strlen(arg) >= sizeof(username)) {
 		send_error("username too long");
 		check_wccount();