]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
prdb_verify -rebuild with supergroups fix
authorJason Rogers <jrogers@sinenomine.net>
Mon, 15 Feb 2010 23:19:12 +0000 (17:19 -0600)
committerRuss Allbery <rra@debian.org>
Wed, 26 May 2010 15:24:14 +0000 (08:24 -0700)
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 <group> <member> instead
of au <member> <group>.

FIXES 126500

Change-Id: I087772b63934406273f153f4b8a581d965f1e4d5
Reviewed-on: http://gerrit.openafs.org/1316
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit fa2536c02cf26f7db30bf623e95f42be88138d14)
(cherry picked from commit dfa356732fd10073c3b777ccf48f753fcd528c93)
Reviewed-on: http://gerrit.openafs.org/1945
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3fc5c5311fc4bfe5586818fa26bdccd846d4c8cc)

src/ptserver/db_verify.c

index f1616ce21fe39c7e30c187e73eb1ec4f762cc4ea..1d8d41525c25ebc8b3277d6cc8a2fa6b4d7550c0 100644 (file)
@@ -1179,9 +1179,6 @@ DumpRecreate(char map[], struct misc_data *misc)
            if ((id < 0) && (flags & PRGRP)) {
                int count = 0;
                afs_int32 na;
-#if defined(SUPERGROUPS)
-               afs_int32 ng;
-#endif
                int i;
                for (i = 0; i < PRSIZE; i++) {
                    afs_int32 uid = ntohl(e.entries[i]);
@@ -1200,43 +1197,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;