commit: r1772 - neon/branches/0.29.x/src

joe at manyfish.co.uk joe at manyfish.co.uk
Wed Dec 30 16:29:30 EST 2009


Author: joe
Date: Wed Dec 30 13:29:30 2009
New Revision: 1772

Modified:
   neon/branches/0.29.x/src/ne_auth.c

Log:
Merge r1748 from trunk:

Clear sspi_token buffer after each request.

* src/ne_auth.c (request_sspi): Return NULL if sspi_token is not present.

* src/ne_auth.c (ah_post_send): Clear the buffered sspi_token.

Submitted by: Danil Shopyrin <danil visualsvn.com>


Modified: neon/branches/0.29.x/src/ne_auth.c
==============================================================================
--- neon/branches/0.29.x/src/ne_auth.c	(original)
+++ neon/branches/0.29.x/src/ne_auth.c	Wed Dec 30 13:29:30 2009
@@ -604,7 +604,10 @@
 #ifdef HAVE_SSPI
 static char *request_sspi(auth_session *sess, struct auth_request *request) 
 {
-    return ne_concat(sess->protocol->name, " ", sess->sspi_token, "\r\n", NULL);
+    if (sess->sspi_token)
+        return ne_concat(sess->protocol->name, " ", sess->sspi_token, "\r\n", NULL);
+    else
+        return NULL;
 }
 
 static int sspi_challenge(auth_session *sess, int attempt,
@@ -1464,6 +1467,14 @@
     }
 #endif
 
+#ifdef HAVE_SSPI
+    /* whatever happens: forget the SSPI token cached thus far */
+    if (sess->sspi_token) {
+        ne_free(sess->sspi_token);
+        sess->sspi_token = NULL;
+    }
+#endif
+
     NE_DEBUG(NE_DBG_HTTPAUTH, 
 	     "ah_post_send (#%d), code is %d (want %d), %s is %s\n",
 	     areq->attempt, status->code, sess->spec->status_code, 



More information about the neon-commits mailing list