Fix updateAclDependencies() to not assume that ACL role dependencies can only
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Apr 2010 01:09:53 +0000 (01:09 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Apr 2010 01:09:53 +0000 (01:09 +0000)
commit9029df17c4a885b83ea2b000b4114d438578a51a
tree47b37cd6f3fc1830d6e4a4a79347619c8ced881f
parent80390f493a612a135157ee05cfd1945d234753ce
Fix updateAclDependencies() to not assume that ACL role dependencies can only
be added during GRANT and can only be removed during REVOKE; and fix its
callers to not lie to it about the existing set of dependencies when
instantiating a formerly-default ACL.  The previous coding accidentally failed
to malfunction so long as default ACLs contain only references to the object's
owning role, because that role is ignored by updateAclDependencies.  However
this is obviously pretty fragile, as well as being an undocumented assumption.
The new coding is a few lines longer but IMO much clearer.
src/backend/catalog/aclchk.c
src/backend/catalog/heap.c
src/backend/catalog/pg_proc.c
src/backend/catalog/pg_shdepend.c
src/include/catalog/dependency.h