From: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-hackers@postgresql.org
Subject: SHOW ALL does not honor pg_read_all_settings membership
Date: Thu, 01 Mar 2018 16:22:38 +0100
Message-ID: <1519917758.6586.8.camel@cybertec.at> (raw)
I noticed that commit 25fff40798fc4ac11a241bfd9ab0c45c085e2212 forgot
to teach SHOW ALL to show all GUCs when the user belongs to pg_read_all_settings.
Patch attached; I think this should be backpatched.
Yours,
Laurenz Albe
Attachments:0001-Teach-SHOW-ALL-to-honor-pg_read_all_settings-members.patch (text/x-patch, 1.1K) download
From f3a92a6ecc8dc116a6843c1bd76aa5e2a97785ff Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@cybertec.at>
Date: Thu, 1 Mar 2018 16:18:04 +0100
Subject: [PATCH] Teach SHOW ALL to honor pg_read_all_settings membership
This was an oversight in commit 25fff40798fc4ac11a241bfd9ab0c45c085e2212.
---
src/backend/utils/misc/guc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.cindex 87ba67661a..a8c8330dde 100644--- a/src/backend/utils/misc/guc.c+++ b/src/backend/utils/misc/guc.c@@ -8012,7 +8012,6 @@ ShowGUCConfigOption(const char *name, DestReceiver *dest)
static void
ShowAllGUCConfig(DestReceiver *dest)
{
- bool am_superuser = superuser();
int i;
TupOutputState *tstate;
TupleDesc tupdesc;
@@ -8037,7 +8036,8 @@ ShowAllGUCConfig(DestReceiver *dest)
char *setting;
if ((conf->flags & GUC_NO_SHOW_ALL) ||
- ((conf->flags & GUC_SUPERUSER_ONLY) && !am_superuser))+ ((conf->flags & GUC_SUPERUSER_ONLY) &&+ !is_member_of_role(GetUserId(), DEFAULT_ROLE_READ_ALL_SETTINGS)))
continue;
/* assign to the values array */
--
2.14.3
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: laurenz.albe@cybertec.at
Subject: Re: SHOW ALL does not honor pg_read_all_settings membership
In-Reply-To: <1519917758.6586.8.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox