aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1998-01-30 15:03:35 +0000
committerMarc G. Fournier <scrappy@hub.org>1998-01-30 15:03:35 +0000
commit2df6bba3ca3343f8ed8283f0974e5c0089280cba (patch)
tree14680a81cdcd9c92c2271627528036e526d43e60
parentb7ed95ae1566fca6e436848a4d404fb121333a67 (diff)
downloadpostgresql-2df6bba3ca3343f8ed8283f0974e5c0089280cba.tar.gz
postgresql-2df6bba3ca3343f8ed8283f0974e5c0089280cba.zip
From: PostgreSQL DataBase <postgres@scuba.pcpipeline.com>
This again fixes the problem with the default permissions for PUBLIC and the preventing of statements like "GRANT null on test to test_user;".
-rw-r--r--src/bin/pg_dump/pg_dump.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 8dd8ef28cb7..6b2b718c107 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.61 1998/01/29 02:26:25 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.62 1998/01/30 15:03:35 scrappy Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@@ -2481,11 +2481,26 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
if (acls) {
ACLlist = ParseACL(tblinfo[i].relacl, &l);
+ if (ACLlist == (ACL *)NULL)
+ if (l == 0)
+ continue;
+ else {
+ fprintf(stderr,"Could not parse ACL list for %s...Exiting!\n",
+ tblinfo[i].relname);
+ exit_nicely(g_conn);
+ }
+
+ /* Revoke Default permissions for PUBLIC */
+ fprintf(fout,
+ "REVOKE ALL on %s from PUBLIC;\n",
+ tblinfo[i].relname);
+
for(k = 0; k < l; k++) {
- fprintf(fout,
- "GRANT %s on %s to %s;\n",
- ACLlist[k].privledges, tblinfo[i].relname,
- ACLlist[k].user);
+ if (ACLlist[k].privledges != (char *)NULL)
+ fprintf(fout,
+ "GRANT %s on %s to %s;\n",
+ ACLlist[k].privledges, tblinfo[i].relname,
+ ACLlist[k].user);
}
}
}