]> granicus.if.org Git - postgresql/commitdiff
Fix incorrect tracking of session authorization in the presence of ACLs
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 19 Jul 2004 21:02:42 +0000 (21:02 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 19 Jul 2004 21:02:42 +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 32615d9f71a3988ecd7b77ffe3d875c35b700867..41b573cea7e1d010316cc8b8e1941be8fafeb1ec 100644 (file)
@@ -15,7 +15,7 @@
  *
  *
  * IDENTIFICATION
- *             $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.79.2.2 2004/02/24 03:35:43 tgl Exp $
+ *             $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.79.2.3 2004/07/19 21:02:42 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -2262,6 +2262,17 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
                        ahprintf(AH, "%s\n\n", te->defn);
        }
 
+       /*
+        * 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;
 }