From: Timo Sirainen Date: Wed, 22 Oct 2008 17:24:50 +0000 (+0300) Subject: Added missing changes to userdb checkpassword. X-Git-Tag: 1.2.alpha3~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2b3db07cf978bf1a0c959b358d2889f58b4e5499;p=thirdparty%2Fdovecot%2Fcore.git Added missing changes to userdb checkpassword. --HG-- branch : HEAD --- diff --git a/dovecot-example.conf b/dovecot-example.conf index 993050c597..4c787bea92 100644 --- a/dovecot-example.conf +++ b/dovecot-example.conf @@ -898,7 +898,7 @@ auth default { # checkpassword executable authentication # NOTE: You will probably want to use "userdb prefetch" with this. - # + # #passdb checkpassword { # Path for checkpassword binary #args = @@ -950,6 +950,13 @@ auth default { #args = #} + # checkpassword executable user database lookup + # + #userdb checkpassword { + # Path for checkpassword binary + #args = + #} + # static settings generated from template #userdb static { # Template for the fields. Can return anything a userdb could normally diff --git a/src/auth/checkpassword-reply.c b/src/auth/checkpassword-reply.c index c27ebdf3b3..e7bf585da5 100644 --- a/src/auth/checkpassword-reply.c +++ b/src/auth/checkpassword-reply.c @@ -10,7 +10,7 @@ int main(void) { string_t *str; - const char *user, *home; + const char *user, *home, *authorized; const char *extra_env, *key, *value, *const *tmp; bool uid_found = FALSE, gid_found = FALSE; @@ -58,5 +58,6 @@ int main(void) i_error("checkpassword: write_full() failed: %m"); exit(111); } - return 0; + authorized = getenv("AUTHORIZED"); + return authorized != NULL && strcmp(authorized, "2") == 0 ? 2 : 0; } diff --git a/src/auth/userdb-checkpassword.c b/src/auth/userdb-checkpassword.c index 553e5572f6..c806bd8d26 100644 --- a/src/auth/userdb-checkpassword.c +++ b/src/auth/userdb-checkpassword.c @@ -118,7 +118,7 @@ checkpassword_lookup_child(struct auth_request *request, ignored by setting AUTHORIZED. This needs a special checkpassword program which knows how to handle this. */ - env_put("AUTHORIZED=YES"); + env_put("AUTHORIZED=1"); checkpassword_setup_env(request); /* very simple argument splitting. */ cmd = t_strconcat(module->checkpassword_path, " ",