afs: on uuid init fail, don't leave garbage behind
authorDerrick Brashear <shadow@dementix.org>
Tue, 11 Oct 2011 19:21:12 +0000 (15:21 -0400)
committerDerrick Brashear <shadow@dementix.org>
Sun, 23 Oct 2011 22:38:37 +0000 (15:38 -0700)
make sure we zero the uuid if we failed

Change-Id: I9d21e003b68eff0ce9bea4634c601c4663a0c078
Reviewed-on: http://gerrit.openafs.org/5599
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

src/afs/afs_call.c

index 95c34fe..cf00d87 100644 (file)
@@ -1076,7 +1076,9 @@ afs_syscall_call(long parm, long parm2, long parm3,
 #if    (!defined(AFS_NONFSTRANS)) || defined(AFS_AIX_IAUTH_ENV)
        afs_nfsclient_init();
 #endif
-       afs_uuid_create(&afs_cb_interface.uuid);
+       if (afs_uuid_create(&afs_cb_interface.uuid) != 0)
+           memset(&afs_cb_interface.uuid, 0, sizeof(afsUUID));
+
        printf("found %d non-empty cache files (%d%%).\n",
               afs_stats_cmperf.cacheFilesReused,
               (100 * afs_stats_cmperf.cacheFilesReused) /