From fa2536c02cf26f7db30bf623e95f42be88138d14 Mon Sep 17 00:00:00 2001 From: Jason Rogers Date: Mon, 15 Feb 2010 17:19:12 -0600 Subject: [PATCH] prdb_verify -rebuild with supergroups fix This change eliminates the redundant iteration over the supergroup[] array in DumpRecreate. By iterating over both this array and entries[], duplicate au lines are created and the count variable becomes incorrect. Furthermore, the au lines created in the supergroups[] section were incorrectly in the form of au instead of au . FIXES 126500 Change-Id: I087772b63934406273f153f4b8a581d965f1e4d5 Reviewed-on: http://gerrit.openafs.org/1316 Reviewed-by: Michael Meffie Tested-by: Michael Meffie Reviewed-by: Alistair Ferguson Reviewed-by: Derrick Brashear --- src/ptserver/db_verify.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/src/ptserver/db_verify.c b/src/ptserver/db_verify.c index 533d153..0f04813 100644 --- a/src/ptserver/db_verify.c +++ b/src/ptserver/db_verify.c @@ -1201,43 +1201,6 @@ DumpRecreate(char map[], struct misc_data *misc) id); #endif } -#if defined(SUPERGROUPS) -#define g (*((struct prentryg *)&e)) - ng = ntohl(g.nextsg); - for (i = 0; i < SGSIZE; i++) { - afs_int32 uid = ntohl(g.supergroup[i]); - if (uid == 0) - break; - if (uid == PRBADID) - continue; - fprintf(rc, "au %d %d\n", uid, id); - count++; - } - while (ng) { - struct prentry c; - code = pr_Read(ng, (char *)&c, sizeof(c)); - if (code) - return code; - - if ((id == ntohl(c.id)) && (c.flags & htonl(PRCONT))) { - for (i = 0; i < COSIZE; i++) { - afs_int32 uid = ntohl(c.entries[i]); - if (uid == 0) - break; - if (uid == PRBADID) - continue; - fprintf(rc, "au %d %d\n", uid, id); - count++; - } - } else { - fprintf(stderr, "Skipping continuation block at %d\n", - ng); - break; - } - ng = ntohl(c.next); - } -#undef g -#endif /* SUPERGROUPS */ na = ntohl(e.next); while (na) { struct prentry c; -- 1.9.4