#include <afs/kautils.h>
#include "bnode.h"
+#include "bnode_internal.h"
#include "bosint.h"
#include "bosprototypes.h"
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;
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
/* 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
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)
goto fail;
}
- /* setup return code */
- code = 0;
-
bnode_Hold(tb);
bnode_SetStat(tb, BSTAT_SHUTDOWN);
code = bnode_WaitStatus(tb, BSTAT_SHUTDOWN); /* this can fail */