svn commit: samba r23587 - in branches: SAMBA_3_0/source/libsmb SAMBA_3_0_26/source/libsmb

gd at samba.org gd at samba.org
Fri Jun 22 14:50:17 GMT 2007


Author: gd
Date: 2007-06-22 14:50:15 +0000 (Fri, 22 Jun 2007)
New Revision: 23587

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

Log:
Cleanup redundant code in the krb5 renew function.

Guenther

Modified:
   branches/SAMBA_3_0/source/libsmb/clikrb5.c
   branches/SAMBA_3_0_26/source/libsmb/clikrb5.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/clikrb5.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clikrb5.c	2007-06-22 14:43:42 UTC (rev 23586)
+++ branches/SAMBA_3_0/source/libsmb/clikrb5.c	2007-06-22 14:50:15 UTC (rev 23587)
@@ -1159,22 +1159,22 @@
 		goto done;
 	}
 
+	if (client_string) {
+		ret = smb_krb5_parse_name(context, client_string, &client);
+		if (ret) {
+			goto done;
+		}
+	} else {
+		ret = krb5_cc_get_principal(context, ccache, &client);
+		if (ret) {
+			goto done;
+		}
+	}
+
 #ifdef HAVE_KRB5_GET_RENEWED_CREDS	/* MIT */
 	{
 		krb5_creds creds;
-	
-		if (client_string) {
-			ret = smb_krb5_parse_name(context, client_string, &client);
-			if (ret) {
-				goto done;
-			}
-		} else {
-			ret = krb5_cc_get_principal(context, ccache, &client);
-			if (ret) {
-				goto done;
-			}
-		}
-	
+
 		ret = krb5_get_renewed_creds(context, &creds, client, ccache, CONST_DISCARD(char *, service_string));
 		if (ret) {
 			DEBUG(10,("smb_krb5_renew_ticket: krb5_get_kdc_cred failed: %s\n", error_message(ret)));
@@ -1204,16 +1204,9 @@
 
 		memset(&creds_in, 0, sizeof(creds_in));
 
-		if (client_string) {
-			ret = smb_krb5_parse_name(context, client_string, &creds_in.client);
-			if (ret) {
-				goto done;
-			}
-		} else {
-			ret = krb5_cc_get_principal(context, ccache, &creds_in.client);
-			if (ret) {
-				goto done;
-			}
+		ret = krb5_copy_principal(context, client, &creds_in.client);
+		if (ret) {
+			goto done;
 		}
 
 		if (service_string) {

Modified: branches/SAMBA_3_0_26/source/libsmb/clikrb5.c
===================================================================
--- branches/SAMBA_3_0_26/source/libsmb/clikrb5.c	2007-06-22 14:43:42 UTC (rev 23586)
+++ branches/SAMBA_3_0_26/source/libsmb/clikrb5.c	2007-06-22 14:50:15 UTC (rev 23587)
@@ -1159,22 +1159,22 @@
 		goto done;
 	}
 
+	if (client_string) {
+		ret = smb_krb5_parse_name(context, client_string, &client);
+		if (ret) {
+			goto done;
+		}
+	} else {
+		ret = krb5_cc_get_principal(context, ccache, &client);
+		if (ret) {
+			goto done;
+		}
+	}
+
 #ifdef HAVE_KRB5_GET_RENEWED_CREDS	/* MIT */
 	{
 		krb5_creds creds;
-	
-		if (client_string) {
-			ret = smb_krb5_parse_name(context, client_string, &client);
-			if (ret) {
-				goto done;
-			}
-		} else {
-			ret = krb5_cc_get_principal(context, ccache, &client);
-			if (ret) {
-				goto done;
-			}
-		}
-	
+
 		ret = krb5_get_renewed_creds(context, &creds, client, ccache, CONST_DISCARD(char *, service_string));
 		if (ret) {
 			DEBUG(10,("smb_krb5_renew_ticket: krb5_get_kdc_cred failed: %s\n", error_message(ret)));
@@ -1204,16 +1204,9 @@
 
 		memset(&creds_in, 0, sizeof(creds_in));
 
-		if (client_string) {
-			ret = smb_krb5_parse_name(context, client_string, &creds_in.client);
-			if (ret) {
-				goto done;
-			}
-		} else {
-			ret = krb5_cc_get_principal(context, ccache, &creds_in.client);
-			if (ret) {
-				goto done;
-			}
+		ret = krb5_copy_principal(context, client, &creds_in.client);
+		if (ret) {
+			goto done;
 		}
 
 		if (service_string) {



More information about the samba-cvs mailing list