Fix incorrect tracking of session authorization in the presence of ACLs
authorTom Lane
Mon, 19 Jul 2004 21:02:17 +0000 (21:02 +0000)
committerTom Lane
Mon, 19 Jul 2004 21:02:17 +0000 (21:02 +0000)
that contain rights granted by non-owners.  Per bug report from
Nishad Prakash.

src/bin/pg_dump/pg_backup_archiver.c

index 19b080488842daaa24c2b0f218443f549e6b4fa6..5515f98db396095db1ff47e64cfec7484297b37f 100644 (file)
@@ -15,7 +15,7 @@
  *
  *
  * IDENTIFICATION
- *     $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.88 2004/07/13 03:00:17 momjian Exp $
+ *     $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.89 2004/07/19 21:02:17 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -2391,6 +2391,17 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
        _printTocHeader(AH, te, ropt, isData);
    }
 
+   /*
+    * If it's an ACL entry, it might contain SET SESSION AUTHORIZATION
+    * commands, so we can no longer assume we know the current auth setting.
+    */
+   if (strncmp(te->desc, "ACL", 3) == 0)
+   {
+       if (AH->currUser)
+           free(AH->currUser);
+       AH->currUser = NULL;
+   }
+
    return 1;
 }