Skip to content

Commit

Permalink
auth: Fixed dovecot/auth hanging when child ntlm_auth crashes while p…
Browse files Browse the repository at this point in the history
…rocessing an authentication request
  • Loading branch information
andriy-s authored and sirainen committed Apr 27, 2017
1 parent 86a8cb6 commit 3d6b8ea
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/auth/mech-winbind.c
Expand Up @@ -187,12 +187,18 @@ do_auth_continue(struct auth_request *auth_request,
request->continued = FALSE;

while ((answer = i_stream_read_next_line(in_pipe)) == NULL) {
if (in_pipe->stream_errno != 0)
if (in_pipe->stream_errno != 0 || in_pipe->eof)
break;
}
if (answer == NULL) {
auth_request_log_error(auth_request, AUTH_SUBSYS_MECH,
"read(in_pipe) failed: %m");
if (in_pipe->stream_errno != 0) {
auth_request_log_error(auth_request, AUTH_SUBSYS_MECH,
"read(in_pipe) failed: %m");
} else {
auth_request_log_error(auth_request, AUTH_SUBSYS_MECH,
"read(in_pipe) failed: "
"unexpected end of file");
}
return HR_RESTART;
}

Expand Down

0 comments on commit 3d6b8ea

Please sign in to comment.