dovecot-1.2: vpopmail: Use pw_flags field if vpopmail has it.
dovecot at dovecot.org
dovecot at dovecot.org
Sat Oct 11 13:50:51 EEST 2008
details: http://hg.dovecot.org/dovecot-1.2/rev/b51344f37d88
changeset: 8262:b51344f37d88
user: Timo Sirainen <tss at iki.fi>
date: Sat Oct 11 13:50:47 2008 +0300
description:
vpopmail: Use pw_flags field if vpopmail has it.
diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
src/auth/passdb-vpopmail.c | 11 ++++++++---
diffs (38 lines):
diff -r 7f7cef2b5552 -r b51344f37d88 src/auth/passdb-vpopmail.c
--- a/src/auth/passdb-vpopmail.c Sat Oct 11 13:39:10 2008 +0300
+++ b/src/auth/passdb-vpopmail.c Sat Oct 11 13:50:47 2008 +0300
@@ -17,6 +17,11 @@
#define VPOPMAIL_DEFAULT_PASS_SCHEME "CRYPT"
+/* pw_flags was added in vpopmail 5.4, olders use pw_gid field */
+#ifndef VQPASSWD_HAS_PW_FLAGS
+# define pw_flags pw_gid
+#endif
+
struct vpopmail_passdb_module {
struct passdb_module module;
@@ -31,19 +36,19 @@ static bool vpopmail_is_disabled(struct
(struct vpopmail_passdb_module *)_module;
if (strcmp(request->service, "IMAP") == 0) {
- if ((vpw->pw_gid & NO_IMAP) != 0) {
+ if ((vpw->pw_flags & NO_IMAP) != 0) {
/* IMAP from webmail IP may still be allowed */
if (!net_ip_compare(&module->webmail_ip,
&request->remote_ip))
return TRUE;
}
- if ((vpw->pw_gid & NO_WEBMAIL) != 0) {
+ if ((vpw->pw_flags & NO_WEBMAIL) != 0) {
if (net_ip_compare(&module->webmail_ip,
&request->remote_ip))
return TRUE;
}
}
- if ((vpw->pw_gid & NO_POP) != 0 &&
+ if ((vpw->pw_flags & NO_POP) != 0 &&
strcmp(request->service, "POP3") == 0)
return TRUE;
return FALSE;
More information about the dovecot-cvs
mailing list