]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Fix auth_request_is_disabled_master_user
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 28 Nov 2017 09:39:52 +0000 (11:39 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 5 Dec 2017 14:34:59 +0000 (16:34 +0200)
I assumed that lack of passdb means master authentication,
but e.g. gssapi does not require a passdb. Instead, check
that if requested_login_uset is non-null then check passdb is
non-null too.

Fixes auth: Panic: file auth-request.c: line 716 (auth_request_is_disabled_master_user): assertion failed: (request->requested_login_user != NULL)

src/auth/auth-request.c

index ea8b68750aa2ca191e13d0787e114c879d019d5e..502db2d4b2b247b9de61e59e81e2bdfb941929ba 100644 (file)
@@ -967,11 +967,11 @@ static bool password_has_illegal_chars(const char *password)
 
 static bool auth_request_is_disabled_master_user(struct auth_request *request)
 {
-       if (request->passdb != NULL)
+       if (request->requested_login_user == NULL ||
+           request->passdb != NULL)
                return FALSE;
 
        /* no masterdbs, master logins not supported */
-       i_assert(request->requested_login_user != NULL);
        auth_request_log_info(request, AUTH_SUBSYS_MECH,
                              "Attempted master login with no master passdbs "
                              "(trying to log in as user: %s)",