[SCM] Samba Shared Repository - branch v3-0-test updated - release-3-0-28a-9-gef51a97

Kai Blin kai at samba.org
Wed Mar 19 23:39:52 GMT 2008


The branch, v3-0-test has been updated
       via  ef51a97332506c028b8689f7516234855d3d1b83 (commit)
      from  0df6b8ce13e664674bd3a6233f28d3bde24c13b8 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test


- Log -----------------------------------------------------------------
commit ef51a97332506c028b8689f7516234855d3d1b83
Author: Kai Blin <kai at samba.org>
Date:   Thu Mar 20 00:38:32 2008 +0100

    ntlm_auth: Improve compliance to the Squid helper protocol
    
    This fixes bug #4235.
    Patch from Pawel Worach <pawel.worach at gmail.com> with some updates for new
    BH messages by me.

-----------------------------------------------------------------------

Summary of changes:
 source/utils/ntlm_auth.c |   64 +++++++++++++++++++++++-----------------------
 1 files changed, 32 insertions(+), 32 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/utils/ntlm_auth.c b/source/utils/ntlm_auth.c
index 1f0a915..53647ad 100644
--- a/source/utils/ntlm_auth.c
+++ b/source/utils/ntlm_auth.c
@@ -690,7 +690,7 @@ static void manage_squid_ntlmssp_request(enum stdio_helper_mode stdio_helper_mod
 
 	if (strlen(buf) < 2) {
 		DEBUG(1, ("NTLMSSP query [%s] invalid", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH NTLMSSP query invalid\n");
 		return;
 	}
 
@@ -714,7 +714,7 @@ static void manage_squid_ntlmssp_request(enum stdio_helper_mode stdio_helper_mod
 
 		if (opt_password == NULL) {
 			DEBUG(1, ("Out of memory\n"));
-			x_fprintf(x_stdout, "BH\n");
+			x_fprintf(x_stdout, "BH Out of memory\n");
 			data_blob_free(&request);
 			return;
 		}
@@ -741,14 +741,14 @@ static void manage_squid_ntlmssp_request(enum stdio_helper_mode stdio_helper_mod
 			x_fprintf(x_stdout, "GK %s\n", key64?key64:"<NULL>");
 			SAFE_FREE(key64);
 		} else {
-			x_fprintf(x_stdout, "BH\n");
+			x_fprintf(x_stdout, "BH No session key available\n");
 		}
 			
 		data_blob_free(&request);
 		return;
 	} else {
 		DEBUG(1, ("NTLMSSP query [%s] invalid", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH NTLMSSP query invalid\n");
 		return;
 	}
 
@@ -818,7 +818,7 @@ static void manage_client_ntlmssp_request(enum stdio_helper_mode stdio_helper_mo
 
 	if (strlen(buf) < 2) {
 		DEBUG(1, ("NTLMSSP query [%s] invalid", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH NTLMSSP query invalid\n");
 		return;
 	}
 
@@ -842,7 +842,7 @@ static void manage_client_ntlmssp_request(enum stdio_helper_mode stdio_helper_mo
 
 		if (opt_password == NULL) {
 			DEBUG(1, ("Out of memory\n"));
-			x_fprintf(x_stdout, "BH\n");
+			x_fprintf(x_stdout, "BH Out of memory\n");
 			data_blob_free(&request);
 			return;
 		}
@@ -892,14 +892,14 @@ static void manage_client_ntlmssp_request(enum stdio_helper_mode stdio_helper_mo
 			SAFE_FREE(key64);
 		}
 		else {
-			x_fprintf(x_stdout, "BH\n");
+			x_fprintf(x_stdout, "BH No session key available\n");
 		}
 
 		data_blob_free(&request);
 		return;
 	} else {
 		DEBUG(1, ("NTLMSSP query [%s] invalid", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH NTLMSSP query invalid\n");
 		return;
 	}
 
@@ -1027,7 +1027,7 @@ static void offer_gss_spnego_mechs(void) {
 
 	if (len == -1) {
 		DEBUG(1, ("Could not write SPNEGO data blob\n"));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH Could not write SPNEGO data blob\n");
 		return;
 	}
 
@@ -1058,7 +1058,7 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
 
 	if (strlen(buf) < 2) {
 		DEBUG(1, ("SPENGO query [%s] invalid", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH SPENGO query invalid\n");
 		return;
 	}
 
@@ -1069,7 +1069,7 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
 		
 	} else {
 		DEBUG(1, ("SPENGO query [%s] invalid", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH SPENGO query invalid\n");
 		return;
 	}
 
@@ -1086,7 +1086,7 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
 
 	if (strlen(buf) <= 3) {
 		DEBUG(1, ("GSS-SPNEGO query [%s] invalid\n", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH GSS-SPNEGO query invalid\n");
 		return;
 	}
 
@@ -1096,7 +1096,7 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
 
 	if (len == -1) {
 		DEBUG(1, ("GSS-SPNEGO query [%s] invalid", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH GSS-SPNEGO query invalid\n");
 		return;
 	}
 
@@ -1108,7 +1108,7 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
 		if ( (request.negTokenInit.mechTypes == NULL) ||
 		     (request.negTokenInit.mechTypes[0] == NULL) ) {
 			DEBUG(1, ("Client did not offer any mechanism"));
-			x_fprintf(x_stdout, "BH\n");
+			x_fprintf(x_stdout, "BH Client did not offer any mechanism\n");
 			return;
 		}
 
@@ -1116,15 +1116,15 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
 		if (strcmp(request.negTokenInit.mechTypes[0], OID_NTLMSSP) == 0) {
 
 			if ( request.negTokenInit.mechToken.data == NULL ) {
-				DEBUG(1, ("Client did not provide  NTLMSSP data\n"));
-				x_fprintf(x_stdout, "BH\n");
+				DEBUG(1, ("Client did not provide NTLMSSP data\n"));
+				x_fprintf(x_stdout, "BH Client did not provide NTLMSSP data\n");
 				return;
 			}
 
 			if ( ntlmssp_state != NULL ) {
 				DEBUG(1, ("Client wants a new NTLMSSP challenge, but "
 					  "already got one\n"));
-				x_fprintf(x_stdout, "BH\n");
+				x_fprintf(x_stdout, "BH Client wants a new NTLMSSP challenge, but already got one\n");
 				ntlmssp_end(&ntlmssp_state);
 				return;
 			}
@@ -1157,7 +1157,7 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
 
 			if ( request.negTokenInit.mechToken.data == NULL ) {
 				DEBUG(1, ("Client did not provide Kerberos data\n"));
-				x_fprintf(x_stdout, "BH\n");
+				x_fprintf(x_stdout, "BH Client did not provide Kerberos data\n");
 				return;
 			}
 
@@ -1183,7 +1183,7 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
 				if (domain == NULL) {
 					DEBUG(1, ("Did not get a valid principal "
 						  "from ads_verify_ticket\n"));
-					x_fprintf(x_stdout, "BH\n");
+					x_fprintf(x_stdout, "BH Did not get a valid principal from ads_verify_ticket\n");
 					return;
 				}
 
@@ -1206,13 +1206,13 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
 			   is the only one we support that sends this stuff */
 			DEBUG(1, ("Got a negTokenTarg for something non-NTLMSSP: %s\n",
 				  request.negTokenTarg.supportedMech));
-			x_fprintf(x_stdout, "BH\n");
+			x_fprintf(x_stdout, "BH Got a negTokenTarg for something non-NTLMSSP\n");
 			return;
 		}
 
 		if (request.negTokenTarg.responseToken.data == NULL) {
 			DEBUG(1, ("Got a negTokenTarg without a responseToken!\n"));
-			x_fprintf(x_stdout, "BH\n");
+			x_fprintf(x_stdout, "BH Got a negTokenTarg without a responseToken!\n");
 			return;
 		}
 
@@ -1256,7 +1256,7 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
 
 	if (len == -1) {
 		DEBUG(1, ("Could not write SPNEGO data blob\n"));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH Could not write SPNEGO data blob\n");
 		return;
 	}
 
@@ -1346,7 +1346,7 @@ static void manage_client_ntlmssp_targ(SPNEGO_DATA spnego)
 
 	if (client_ntlmssp_state == NULL) {
 		DEBUG(1, ("Got NTLMSSP tArg without a client state\n"));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH Got NTLMSSP tArg without a client state\n");
 		return;
 	}
 
@@ -1370,7 +1370,7 @@ static void manage_client_ntlmssp_targ(SPNEGO_DATA spnego)
 		DEBUG(1, ("Expected MORE_PROCESSING_REQUIRED from "
 			  "ntlmssp_client_update, got: %s\n",
 			  nt_errstr(status)));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH Expected MORE_PROCESSING_REQUIRED from ntlmssp_client_update\n");
 		data_blob_free(&request);
 		ntlmssp_end(&client_ntlmssp_state);
 		return;
@@ -1486,7 +1486,7 @@ static void manage_client_krb5_targ(SPNEGO_DATA spnego)
 	switch (spnego.negTokenTarg.negResult) {
 	case SPNEGO_ACCEPT_INCOMPLETE:
 		DEBUG(1, ("Got a Kerberos negTokenTarg with ACCEPT_INCOMPLETE\n"));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH Got a Kerberos negTokenTarg with ACCEPT_INCOMPLETE\n");
 		break;
 	case SPNEGO_ACCEPT_COMPLETED:
 		DEBUG(10, ("Accept completed\n"));
@@ -1518,7 +1518,7 @@ static void manage_gss_spnego_client_request(enum stdio_helper_mode stdio_helper
 
 	if (strlen(buf) <= 3) {
 		DEBUG(1, ("SPNEGO query [%s] too short\n", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH SPNEGO query too short\n");
 		return;
 	}
 
@@ -1532,7 +1532,7 @@ static void manage_gss_spnego_client_request(enum stdio_helper_mode stdio_helper
 		
 		if (opt_password == NULL) {
 			DEBUG(1, ("Out of memory\n"));
-			x_fprintf(x_stdout, "BH\n");
+			x_fprintf(x_stdout, "BH Out of memory\n");
 			data_blob_free(&request);
 			return;
 		}
@@ -1546,7 +1546,7 @@ static void manage_gss_spnego_client_request(enum stdio_helper_mode stdio_helper
 	     (strncmp(buf, "AF ", 3) != 0) &&
 	     (strncmp(buf, "NA ", 3) != 0) ) {
 		DEBUG(1, ("SPNEGO request [%s] invalid\n", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH SPNEGO request invalid\n");
 		data_blob_free(&request);
 		return;
 	}
@@ -1559,7 +1559,7 @@ static void manage_gss_spnego_client_request(enum stdio_helper_mode stdio_helper
 
 	if (len == -1) {
 		DEBUG(1, ("Could not read SPNEGO data for [%s]\n", buf));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH Could not read SPNEGO data\n");
 		return;
 	}
 
@@ -1588,7 +1588,7 @@ static void manage_gss_spnego_client_request(enum stdio_helper_mode stdio_helper
 		}
 
 		DEBUG(1, ("Server offered no compatible mechanism\n"));
-		x_fprintf(x_stdout, "BH\n");
+		x_fprintf(x_stdout, "BH Server offered no compatible mechanism\n");
 		return;
 	}
 
@@ -1610,7 +1610,7 @@ static void manage_gss_spnego_client_request(enum stdio_helper_mode stdio_helper
 				DEBUG(1, ("Got a negTokenTarg with no mech and an "
 					  "unknown negResult: %d\n",
 					  spnego.negTokenTarg.negResult));
-				x_fprintf(x_stdout, "BH\n");
+				x_fprintf(x_stdout, "BH Got a negTokenTarg with no mech and an unknown negResult\n");
 			}
 
 			ntlmssp_end(&client_ntlmssp_state);
@@ -1634,7 +1634,7 @@ static void manage_gss_spnego_client_request(enum stdio_helper_mode stdio_helper
 	}
 
 	DEBUG(1, ("Got an SPNEGO token I could not handle [%s]!\n", buf));
-	x_fprintf(x_stdout, "BH\n");
+	x_fprintf(x_stdout, "BH Got an SPNEGO token I could not handle\n");
 	return;
 
  out:


-- 
Samba Shared Repository


More information about the samba-cvs mailing list