]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
aklog: Dispose of the pointless confname string
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 12 Feb 2010 10:29:00 +0000 (10:29 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 17 Feb 2010 13:12:52 +0000 (05:12 -0800)
confname makes a static copy of the AFSDIR_CLIENT_ETC_DIRPATH string. As
pr_Initialize takes it as const, there's no need to maintain our own
copy, and so this is superfluous. Remove it.

Change-Id: I64b13aae80b15f6b7511a040f39467bca76186b8
Reviewed-on: http://gerrit.openafs.org/1322
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/aklog/aklog.c

index d35cfe14e32ce88d90a3fa2a58952d5b2682780e..89e90e5255e539bb7787ad67af3d16dc935e5c5f 100644 (file)
@@ -415,7 +415,6 @@ auth_to_cell(krb5_context context, char *cell, char *realm, char **linkedcell)
     int retry;                   /* round, and round we go ... */
     
     char *local_cell = NULL;
-    static char confname[512] = { 0 };
     krb5_creds *v5cred = NULL;
     struct ktc_principal aserver;
     struct ktc_principal aclient;
@@ -424,11 +423,6 @@ auth_to_cell(krb5_context context, char *cell, char *realm, char **linkedcell)
 
     memset(realm_of_user, 0, sizeof(realm_of_user));
 
-    if (confname[0] == '\0') {
-       strncpy(confname, AFSDIR_CLIENT_ETC_DIRPATH, sizeof(confname));
-       confname[sizeof(confname) - 2] = '\0';
-    }
-
     /* NULL or empty cell returns information on local cell */
     if ((status = get_cellconfig(cell, &cellconf, &local_cell)))
        return(status);
@@ -792,8 +786,8 @@ auth_to_cell(krb5_context context, char *cell, char *realm, char **linkedcell)
                        username, aserver.cell);
            }
 
-           if (!pr_Initialize (0, confname, aserver.cell))
-                   status = pr_SNameToId (username, &viceId);
+           if (!pr_Initialize (0,  AFSDIR_CLIENT_ETC_DIRPATH, aserver.cell))
+               status = pr_SNameToId (username, &viceId);
            
            if (dflag) {
                if (status) 
@@ -833,7 +827,8 @@ auth_to_cell(krb5_context context, char *cell, char *realm, char **linkedcell)
                 * level
                 */
 
-               if ((status = pr_Initialize(1L, confname, aserver.cell))) {
+               if ((status = pr_Initialize(1L,  AFSDIR_CLIENT_ETC_DIRPATH,
+                                           aserver.cell))) {
                    printf("Error %d\n", status);
                }