From 7da10d2bc6a00bfbac4d7e7335a2acdfe33a650a Mon Sep 17 00:00:00 2001 From: hno <> Date: Mon, 7 Nov 2005 04:50:14 +0000 Subject: [PATCH] Handle crashing auth helper more gracefully in negotiate/ntlm --- src/auth/negotiate/auth_negotiate.cc | 11 ++++------- src/auth/ntlm/auth_ntlm.cc | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/auth/negotiate/auth_negotiate.cc b/src/auth/negotiate/auth_negotiate.cc index 6b95345ac5..c67d800880 100644 --- a/src/auth/negotiate/auth_negotiate.cc +++ b/src/auth/negotiate/auth_negotiate.cc @@ -1,6 +1,6 @@ /* - * $Id: auth_negotiate.cc,v 1.4 2005/11/06 12:59:06 hno Exp $ + * $Id: auth_negotiate.cc,v 1.5 2005/11/06 21:50:14 hno Exp $ * * DEBUG: section 29 Negotiate Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -395,11 +395,8 @@ authenticateNegotiateHandleReply(void *data, void *lastserver, char *reply) } if (!reply) { - /* - * TODO: this occurs when a helper crashes. We should clean - * up that helpers resources and queued requests. - */ - fatal("authenticateNegotiateHandleReply: called with no result string\n"); + debug(29, 1) ("authenticateNegotiateHandleReply: Helper '%p' crashed!.\n", lastserver); + reply = "BH Internal error"; } auth_user_request = r->auth_user_request; @@ -423,7 +420,7 @@ authenticateNegotiateHandleReply(void *data, void *lastserver, char *reply) /* seperate out the useful data */ blob = strchr(reply, ' '); - while (xisspace(*blob)) { // trim leading spaces in blob + while (blob && xisspace(*blob)) { // trim leading spaces in blob blob++; arg = strchr(blob + 1, ' '); } diff --git a/src/auth/ntlm/auth_ntlm.cc b/src/auth/ntlm/auth_ntlm.cc index e9183fc9fc..4254152609 100644 --- a/src/auth/ntlm/auth_ntlm.cc +++ b/src/auth/ntlm/auth_ntlm.cc @@ -1,6 +1,6 @@ /* - * $Id: auth_ntlm.cc,v 1.52 2005/11/06 12:59:07 hno Exp $ + * $Id: auth_ntlm.cc,v 1.53 2005/11/06 21:50:14 hno Exp $ * * DEBUG: section 29 NTLM Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -363,11 +363,8 @@ authenticateNTLMHandleReply(void *data, void *lastserver, char *reply) } if (!reply) { - /* - * TODO: this occurs when a helper crashes. We should clean - * up that helpers resources and queued requests. - */ - fatal("authenticateNTLMHandleReply: called with no result string\n"); + debug(29, 1) ("authenticateNTLMHandleReply: Helper '%p' crashed!.\n", lastserver); + reply = "BH Internal error"; } auth_user_request = r->auth_user_request; @@ -391,7 +388,7 @@ authenticateNTLMHandleReply(void *data, void *lastserver, char *reply) /* seperate out the useful data */ blob = strchr(reply, ' '); - while (xisspace(*blob)) { // trim leading spaces in blob + while (blob && xisspace(*blob)) { // trim leading spaces in blob blob++; } -- 2.47.2