diff options
| author | Stephen Frost | 2017-01-30 04:05:07 +0000 |
|---|---|---|
| committer | Stephen Frost | 2017-01-30 04:05:07 +0000 |
| commit | e54f75722c720b596ec5e72154cc899da199de5b (patch) | |
| tree | 4ea64893fb063beb96d9014ec53c08ec9bcb7c18 /src/include | |
| parent | fb94ca77f1400e236b00d432dccfbe4f1124971c (diff) | |
Handle ALTER EXTENSION ADD/DROP with pg_init_privs
In commit 6c268df, pg_init_privs was added to track the initial
privileges of catalog objects and extensions. Unfortunately, that
commit didn't include understanding of ALTER EXTENSION ADD/DROP, which
allows the objects associated with an extension to be changed after the
initial CREATE EXTENSION script has been run.
The result of this meant that ACLs for objects added through
ALTER EXTENSION ADD were not recorded into pg_init_privs and we would
end up including those ACLs in pg_dump when we shouldn't have.
This commit corrects that by making sure to have pg_init_privs updated
when ALTER EXTENSION ADD/DROP is run, recording the permissions as they
are at ALTER EXTENSION ADD time, and removing any if/when ALTER
EXTENSION DROP is called.
This issue was pointed out by Moshe Jacobson as commentary on bug #14456
(which was actually a bug about versions prior to 9.6 not handling
custom ACLs on extensions correctly, an issue now addressed with
pg_init_privs in 9.6).
Back-patch to 9.6 where pg_init_privs was introduced.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/utils/acl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h index 686141b5f9a..0d118525c9c 100644 --- a/src/include/utils/acl.h +++ b/src/include/utils/acl.h @@ -300,6 +300,10 @@ extern void aclcheck_error_col(AclResult aclerr, AclObjectKind objectkind, extern void aclcheck_error_type(AclResult aclerr, Oid typeOid); +extern void recordExtObjInitPriv(Oid objoid, Oid classoid); +extern void removeExtObjInitPriv(Oid objoid, Oid classoid); + + /* ownercheck routines just return true (owner) or false (not) */ extern bool pg_class_ownercheck(Oid class_oid, Oid roleid); extern bool pg_type_ownercheck(Oid type_oid, Oid roleid); |
