]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added missing changes to userdb checkpassword.
authorTimo Sirainen <tss@iki.fi>
Wed, 22 Oct 2008 17:24:50 +0000 (20:24 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 22 Oct 2008 17:24:50 +0000 (20:24 +0300)
--HG--
branch : HEAD

dovecot-example.conf
src/auth/checkpassword-reply.c
src/auth/userdb-checkpassword.c

index 993050c597f57515503f214d94999a0f93326712..4c787bea92afa3de461f2c25dbbc3e1ff7cd2981 100644 (file)
@@ -898,7 +898,7 @@ auth default {
 
   # checkpassword executable authentication
   # NOTE: You will probably want to use "userdb prefetch" with this.
-  # <doc/wiki/PasswordDatabase.CheckPassword.txt>
+  # <doc/wiki/AuthDatabase.CheckPassword.txt>
   #passdb checkpassword {
     # Path for checkpassword binary
     #args = 
@@ -950,6 +950,13 @@ auth default {
     #args =
   #}
 
+  # checkpassword executable user database lookup
+  # <doc/wiki/AuthDatabase.CheckPassword.txt>
+  #userdb checkpassword {
+    # Path for checkpassword binary
+    #args = 
+  #}
+
   # static settings generated from template <doc/wiki/UserDatabase.Static.txt>
   #userdb static {
     # Template for the fields. Can return anything a userdb could normally
index c27ebdf3b36be23751e1d12b0e7c7d703e521176..e7bf585da590751587eac5b4a06b09e8ba91ffb8 100644 (file)
@@ -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;
 }
index 553e5572f6639f04cc89f39f58a78897babae955..c806bd8d262389b478cd0aac77078270a815ca26 100644 (file)
@@ -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, " ",