svn commit: samba r11278 - in branches/SAMBA_4_0/source/auth/gensec: .

metze at samba.org metze at samba.org
Mon Oct 24 15:38:08 GMT 2005


Author: metze
Date: 2005-10-24 15:38:07 +0000 (Mon, 24 Oct 2005)
New Revision: 11278

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11278

Log:
fix compiler warnings

metze
Modified:
   branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c
===================================================================
--- branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c	2005-10-24 15:27:59 UTC (rev 11277)
+++ branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c	2005-10-24 15:38:07 UTC (rev 11278)
@@ -155,7 +155,7 @@
 	NTSTATUS nt_status;
 	OM_uint32 maj_stat, min_stat;
 	int ret;
-	gss_buffer_desc name_token;
+	const char *principal;
 	struct gensec_gssapi_state *gensec_gssapi_state;
 	struct cli_credentials *machine_account;
 
@@ -179,12 +179,15 @@
 		}
 	}
 
-	name_token.value = cli_credentials_get_principal(machine_account, 
-							 machine_account);
+	principal = cli_credentials_get_principal(machine_account, 
+						  machine_account);
 
 	/* This might have been explicity set to NULL, ie use what the client calls us */
-	if (name_token.value) {
-		name_token.length = strlen(name_token.value);
+	if (principal) {
+		gss_buffer_desc name_token;
+
+		name_token.value  = discard_const_p(uint8_t, principal);
+		name_token.length = strlen(principal);
 		
 		maj_stat = gss_import_name (&min_stat,
 					    &name_token,
@@ -260,9 +263,10 @@
 		return NT_STATUS_UNSUCCESSFUL;
 	}
 
-	name_token.value = cli_credentials_get_principal(creds, 
-							 gensec_gssapi_state);
-	name_token.length = strlen(name_token.value);
+	principal = cli_credentials_get_principal(creds, 
+						  gensec_gssapi_state);
+	name_token.value  = discard_const_p(uint8_t, principal);
+	name_token.length = strlen(principal);
 
 	maj_stat = gss_import_name (&min_stat,
 				    &name_token,
@@ -277,14 +281,18 @@
 
 	principal = gensec_get_target_principal(gensec_security);
 	if (principal && lp_client_use_spnego_principal()) {
-		name_token.value = gensec_get_target_principal(gensec_security);
-		name_token.length = strlen(name_token.value);
+		name_token.value  = discard_const_p(uint8_t, principal);
+		name_token.length = strlen(principal);
+
 		name_type = GSS_C_NULL_OID;
 	} else {
-		name_token.value = talloc_asprintf(gensec_gssapi_state, "%s@%s", 
-						   gensec_get_target_service(gensec_security), 
-						   hostname);
-		name_token.length = strlen(name_token.value);
+		principal = talloc_asprintf(gensec_gssapi_state, "%s@%s", 
+					    gensec_get_target_service(gensec_security), 
+					    hostname);
+
+		name_token.value  = discard_const_p(uint8_t, principal);
+		name_token.length = strlen(principal);
+
 		name_type = GSS_C_NT_HOSTBASED_SERVICE;
 	}		
 



More information about the samba-cvs mailing list