From: Andriy Syrovenko Date: Sun, 16 Apr 2017 22:14:02 +0000 (+0300) Subject: auth: Fixed dovecot/auth hanging when child ntlm_auth crashes while processing an... X-Git-Tag: 2.3.0.rc1~1695 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a319c3201bff1ea7bae3e7ab1fae42e9c4759056;p=thirdparty%2Fdovecot%2Fcore.git auth: Fixed dovecot/auth hanging when child ntlm_auth crashes while processing an authentication request --- diff --git a/src/auth/mech-winbind.c b/src/auth/mech-winbind.c index 4a65696105..c12fb5effd 100644 --- a/src/auth/mech-winbind.c +++ b/src/auth/mech-winbind.c @@ -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; }