svn commit: samba r21848 - in branches/SAMBA_3_0/source/libaddns: .

jerry at samba.org jerry at samba.org
Thu Mar 15 22:09:05 GMT 2007


Author: jerry
Date: 2007-03-15 22:09:03 +0000 (Thu, 15 Mar 2007)
New Revision: 21848

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

Log:
add a comment about gss_import_name() and when to free the krb5 principal data
Modified:
   branches/SAMBA_3_0/source/libaddns/dnsgss.c


Changeset:
Modified: branches/SAMBA_3_0/source/libaddns/dnsgss.c
===================================================================
--- branches/SAMBA_3_0/source/libaddns/dnsgss.c	2007-03-15 21:53:53 UTC (rev 21847)
+++ branches/SAMBA_3_0/source/libaddns/dnsgss.c	2007-03-15 22:09:03 UTC (rev 21848)
@@ -252,6 +252,11 @@
 	krb5_init_context( &krb_ctx );
 	krb5_parse_name( krb_ctx, targetname, &host_principal );
 
+	/* don't free the printcap until after you call
+	   gss_release_name() or else you'll get a segv
+	   as the krb5_copy_principal() does a structure 
+	   copy and not a deep copy.    --jerry*/
+
 	input_name.value = &host_principal;
 	input_name.length = sizeof( host_principal );
 
@@ -267,8 +272,11 @@
 
 	err = dns_negotiate_gss_ctx_int(mem_ctx, conn, keyname, 
 					targ_name, gss_ctx, srv_type );
+	
+	gss_release_name( &minor, &targ_name );
 
-	gss_release_name( &minor, &targ_name );
+	/* now we can feree the principal */
+
 	krb5_free_principal( krb_ctx, host_principal );
 	krb5_free_context( krb_ctx );
 



More information about the samba-cvs mailing list