]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Handle crashing auth helper more gracefully in negotiate/ntlm
authorhno <>
Mon, 7 Nov 2005 04:50:14 +0000 (04:50 +0000)
committerhno <>
Mon, 7 Nov 2005 04:50:14 +0000 (04:50 +0000)
src/auth/negotiate/auth_negotiate.cc
src/auth/ntlm/auth_ntlm.cc

index 6b95345ac511a7108c0ff1f0478a4522afdbad60..c67d800880cd1795020c26c54df7d69e3e528b10 100644 (file)
@@ -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, ' ');
     }
index e9183fc9fce3858eec02feef80761762e922f311..42541526091d16e41fc63b6e58de4ef22d1f2bcb 100644 (file)
@@ -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++;
     }