File: 09_authmappeduser.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 (82 lines) | stat: -rw-r--r-- 2,911 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
81
82
#!/bin/sh -e
## 09_authmappeduser.dpatch by Mark Smith & Adam D. Barratt
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Add AuthMappedUser option (bug#228085)

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 -Nru solid-pop3d-0.15-7/man/spop3d.conf.5 solid-pop3d-0.15/man/spop3d.conf.5
--- solid-pop3d-0.15-7/man/spop3d.conf.5	Tue Jan 13 11:42:49 2004
+++ solid-pop3d-0.15/man/spop3d.conf.5	Tue Jan 13 12:09:55 2004
@@ -179,6 +179,13 @@
 user needn't have entry in user mapping file (no mapping is performed then).
 Option has no effect when DoMapping is disabled. Option is enabled by default.
 .TP
+.B AuthMappedUser boolean
+Controls whether authentication is performed on the username given by
+the user, or the username looked up in the user mapping file.
+.br
+The option is enabled by default, meaning that the user from the mapping
+file is used. The option has no effect when DoMapping is disabled.
+.TP
 .B LogStatistics boolean
 If enabled qpopper-like statistics are logged. At the end of each session
 username, number of deleted messages, size (in bytes) of deleted messages,
diff -Nru solid-pop3d-0.15-7/src/configfile.h solid-pop3d-0.15/src/configfile.h
--- solid-pop3d-0.15-7/src/configfile.h	Tue Jan 13 11:42:49 2004
+++ solid-pop3d-0.15/src/configfile.h	Tue Jan 13 12:09:55 2004
@@ -66,6 +66,7 @@
 #ifdef MAPPING
 extern int domapping;
 extern int reqmapping;
+extern int authmappeduser;
 extern char sp_mapfile[];
 extern char mapfileowner[];
 #endif
diff -Nru solid-pop3d-0.15-7/src/main.c solid-pop3d-0.15/src/main.c
--- solid-pop3d-0.15-7/src/main.c	Tue Jan 13 11:42:49 2004
+++ solid-pop3d-0.15/src/main.c	Tue Jan 13 12:09:55 2004
@@ -175,6 +175,7 @@
 #ifdef MAPPING
 	{"UserMapFile", OP_STRING, &sp_mapfile, PATH_MAX, NULL},
 	{"DoMapping", OP_BOOLEAN, &domapping, 0, NULL},
+	{"AuthMappedUser", OP_BOOLEAN, &authmappeduser, 1, NULL},
 	{"RequiredMapping", OP_BOOLEAN, &reqmapping, 0, NULL},
 #endif
 #ifdef NONIPVIRTUALS
@@ -210,7 +211,7 @@
 char maildrop_type[MAXMDTYPENAMELENGTH];
 #ifdef MAPPING
 char sp_mapfile[PATH_MAX];
-int domapping = 0, reqmapping = 1;
+int domapping = 0, reqmapping = 1, authmappeduser = 1;
 char mapusername[MAXARGLN + 1];
 #endif
 #ifdef APOP
@@ -1385,7 +1386,7 @@
 			if (!useapop) {
 #endif
 #ifdef MAPPING
-			if (domapping)
+			if (domapping && authmappeduser)
 				tmp = sp_authenticate_user(mapusername, password);
 			else
 				tmp = sp_authenticate_user(username, password);