Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2df6bba

Browse files
committed
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;".
1 parent b7ed95a commit 2df6bba

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*
2323
* IDENTIFICATION
24-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.61 1998/01/29 02:26:25 scrappy Exp $
24+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.62 1998/01/30 15:03:35 scrappy Exp $
2525
*
2626
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2727
*
@@ -2481,11 +2481,26 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
24812481

24822482
if (acls) {
24832483
ACLlist = ParseACL(tblinfo[i].relacl, &l);
2484+
if (ACLlist == (ACL *)NULL)
2485+
if (l == 0)
2486+
continue;
2487+
else {
2488+
fprintf(stderr,"Could not parse ACL list for %s...Exiting!\n",
2489+
tblinfo[i].relname);
2490+
exit_nicely(g_conn);
2491+
}
2492+
2493+
/* Revoke Default permissions for PUBLIC */
2494+
fprintf(fout,
2495+
"REVOKE ALL on %s from PUBLIC;\n",
2496+
tblinfo[i].relname);
2497+
24842498
for(k = 0; k < l; k++) {
2485-
fprintf(fout,
2486-
"GRANT %s on %s to %s;\n",
2487-
ACLlist[k].privledges, tblinfo[i].relname,
2488-
ACLlist[k].user);
2499+
if (ACLlist[k].privledges != (char *)NULL)
2500+
fprintf(fout,
2501+
"GRANT %s on %s to %s;\n",
2502+
ACLlist[k].privledges, tblinfo[i].relname,
2503+
ACLlist[k].user);
24892504
}
24902505
}
24912506
}

0 commit comments

Comments
 (0)