pgsql: Fix pg_dump for GRANT OPTION among initial privileges.

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix pg_dump for GRANT OPTION among initial privileges.
Date: 2021-01-16 20:22:20
Message-ID: E1l0s5U-0002N1-0j@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix pg_dump for GRANT OPTION among initial privileges.

The context is an object that no longer bears some aclitem that it bore
initially. (A user issued REVOKE or GRANT statements upon the object.)
pg_dump is forming SQL to reproduce the object ACL. Since initdb
creates no ACL bearing GRANT OPTION, reaching this bug requires an
extension where the creation script establishes such an ACL. No PGXN
extension does that. If an installation did reach the bug, pg_dump
would have omitted a semicolon, causing a REVOKE and the next SQL
statement to fail. Separately, since the affected code exists to
eliminate an entire aclitem, it wants plain REVOKE, not REVOKE GRANT
OPTION FOR. Back-patch to 9.6, where commit
23f34fa4ba358671adab16773e79c17c92cbc870 first appeared.

Discussion: https://postgr.es/m/20210109102423.GA160022@rfd.leadboat.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ad2b7c9bb061e85d1afe0debb916e00ca8cf8d5b

Modified Files
--------------
src/bin/pg_dump/dumputils.c | 65 ++++++++--------------
src/test/modules/test_pg_dump/t/001_base.pl | 51 +++++++++++++++++
.../modules/test_pg_dump/test_pg_dump--1.0.sql | 9 +++
3 files changed, 84 insertions(+), 41 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2021-01-16 22:49:33 pgsql: Documenation fixups for replication protocol.
Previous Message Noah Misch 2021-01-16 20:22:19 pgsql: Fix pg_dump for GRANT OPTION among initial privileges.