From: Timo Sirainen Date: Sat, 11 Oct 2008 10:50:47 +0000 (+0300) Subject: vpopmail: Use pw_flags field if vpopmail has it. X-Git-Tag: 1.2.alpha3~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=adaba6c652d0f99a50e47800c3c67f437ed5ad10;p=thirdparty%2Fdovecot%2Fcore.git vpopmail: Use pw_flags field if vpopmail has it. --HG-- branch : HEAD --- diff --git a/src/auth/passdb-vpopmail.c b/src/auth/passdb-vpopmail.c index 66b9c32f0e..d3bbd1b97b 100644 --- a/src/auth/passdb-vpopmail.c +++ b/src/auth/passdb-vpopmail.c @@ -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 auth_request *request, (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;