Skip to content

Commit

Permalink
doveadm-auth: Handle unexpected auth "continue" request without crash…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
sirainen authored and GitLab committed Sep 13, 2016
1 parent 6b32b84 commit 5bfda55
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/doveadm/doveadm-auth.c
Expand Up @@ -131,14 +131,24 @@ auth_callback(struct auth_client_request *request ATTR_UNUSED,
if (status == 0)
i_fatal("passdb expects SASL continuation");

if (status < 0)
switch (status) {
case AUTH_REQUEST_STATUS_ABORT:
i_unreached();
case AUTH_REQUEST_STATUS_INTERNAL_FAIL:
case AUTH_REQUEST_STATUS_FAIL:
printf("passdb: %s auth failed\n", input->username);
else {
break;
case AUTH_REQUEST_STATUS_CONTINUE:
printf("passdb: %s auth unexpectedly requested continuation\n",
input->username);
break;
case AUTH_REQUEST_STATUS_OK:
input->success = TRUE;
printf("passdb: %s auth succeeded\n", input->username);
break;
}

if (*args != NULL) {
if (args != NULL && *args != NULL) {
printf("extra fields:\n");
for (; *args != NULL; args++)
printf(" %s\n", *args);
Expand Down

0 comments on commit 5bfda55

Please sign in to comment.