bozo: Ignore ListKeys ka_KeyCheckSum return value
[openafs.git] / src / bozo / bosoprocs.c
index 79c6aaf..20dd956 100644 (file)
@@ -29,6 +29,7 @@
 #include <afs/kautils.h>
 
 #include "bnode.h"
+#include "bnode_internal.h"
 #include "bosint.h"
 #include "bosprototypes.h"
 
@@ -197,16 +198,16 @@ SBOZO_UnInstall(struct rx_call *acall, char *aname)
     strcpy(fpOld, filepath);
     strcat(fpOld, ".OLD");
 
-    code = renamefile(fpBak, filepath);
+    code = rk_rename(fpBak, filepath);
     if (code) {
        /* can't find .BAK, try .OLD */
-       code = renamefile(fpOld, filepath);
+       code = rk_rename(fpOld, filepath);
        if (code && errno == ENOENT)    /* If doesn't exist don't fail */
            code = 0;
     } else {
        /* now rename .OLD to .BAK */
        if (stat(fpOld, &tstat) == 0)
-           code = renamefile(fpOld, fpBak);
+           code = rk_rename(fpOld, fpBak);
     }
     if (code)
        code = errno;
@@ -251,11 +252,11 @@ SaveOldFiles(char *aname)
 
     if (bakTime && (oldTime == 0 || bakTime < now - BOZO_OLDTIME)) {
        /* no .OLD file, or .BAK is at least a week old */
-       code = renamefile(bbuffer, obuffer);
+       rk_rename(bbuffer, obuffer);
     }
 
     /* finally rename to .BAK extension */
-    renamefile(aname, bbuffer);
+    rk_rename(aname, bbuffer);
 }
 
 afs_int32
@@ -325,7 +326,7 @@ SBOZO_Install(struct rx_call *acall, char *aname, afs_int32 asize, afs_int32 mod
     /* all done, rename to final name */
     strcpy(tbuffer, filepath);
     strcat(tbuffer, ".NEW");
-    code = (renamefile(tbuffer, filepath) ? errno : 0);
+    code = (rk_rename(tbuffer, filepath) ? errno : 0);
 
     /* label file with same time for our sanity */
 #ifdef AFS_NT40_ENV
@@ -611,8 +612,11 @@ SBOZO_ListKeys(struct rx_call *acall, afs_int32 an, afs_int32 *akvno,
     if (code == 0) {
        akeyinfo->mod_sec = tstat.st_mtime;
     }
-    ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum);
-    /* only errors is bad key parity */
+
+    /* This will return an error if the key is 'bad' (bad checksum, weak DES
+     * key, etc). But we don't care, since we can still return the other
+     * information about the key, so ignore the result. */
+    (void)ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum);
 
   fail:
     if (noauth)
@@ -1005,9 +1009,6 @@ SBOZO_Restart(struct rx_call *acall, char *ainstance)
        goto fail;
     }
 
-    /* setup return code */
-    code = 0;
-
     bnode_Hold(tb);
     bnode_SetStat(tb, BSTAT_SHUTDOWN);
     code = bnode_WaitStatus(tb, BSTAT_SHUTDOWN);       /* this can fail */