r23587: Cleanup redundant code in the krb5 renew function.
authorGünther Deschner <gd@samba.org>
Fri, 22 Jun 2007 14:50:15 +0000 (14:50 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:33 +0000 (12:23 -0500)
Guenther

source/libsmb/clikrb5.c

index 0180bef47ae84fbf82fbddedaef17d420c6393d1..be6fb1bda8ffe6d15c0c8901e8b7774550f784a5 100644 (file)
@@ -1159,22 +1159,22 @@ out:
                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 @@ out:
 
                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) {