# 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 =
#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
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;
i_error("checkpassword: write_full() failed: %m");
exit(111);
}
- return 0;
+ authorized = getenv("AUTHORIZED");
+ return authorized != NULL && strcmp(authorized, "2") == 0 ? 2 : 0;
}
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, " ",