From: Jason Rogers Date: Mon, 15 Feb 2010 23:19:12 +0000 (-0600) Subject: prdb_verify -rebuild with supergroups fix X-Git-Tag: openafs-devel-1_5_73~176 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=fa2536c02cf26f7db30bf623e95f42be88138d14;p=packages%2Fo%2Fopenafs.git 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 --- diff --git a/src/ptserver/db_verify.c b/src/ptserver/db_verify.c index 533d1532a..0f0481311 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;