pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix SHOW ALL command for non-superusers with replication connect
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix SHOW ALL command for non-superusers with replication connect
@ 2019-04-15 03:35 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2019-04-15 03:35 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix SHOW ALL command for non-superusers with replication connection

Since Postgres 10, SHOW commands can be triggered with replication
connections in a WAL sender context, however it missed that a
transaction context is needed for syscache lookups.  This commit makes
sure that the syscache lookups can happen correctly by setting a
transaction context when running SHOW commands in a WAL sender.

Superuser-only parameters can be displayed using SHOW commands not only
to superusers, but also to members of system role pg_read_all_settings,
which requires a syscache lookup to check if the connected role is a
member of this system role or not, or the instance crashes.  Superusers
do not need to check the syscache so it worked correctly in this case.

New tests are added to cover this issue.

Reported-by: Alexander Kukushkin
Author: Michael Paquier
Reviewed-by: Álvaro Herrera
Discussion: https://postgr.es/m/15734-2daa8761eeed8e20@postgresql.org
Backpatch-through: 10

Branch
------
master

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

Modified Files
--------------
src/backend/replication/walsender.c   |  3 ++
src/test/recovery/t/001_stream_rep.pl | 56 +++++++++++++++++++++++++++++++++--
2 files changed, 57 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix SHOW ALL command for non-superusers with replication connect
@ 2019-04-15 03:35 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2019-04-15 03:35 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix SHOW ALL command for non-superusers with replication connection

Since Postgres 10, SHOW commands can be triggered with replication
connections in a WAL sender context, however it missed that a
transaction context is needed for syscache lookups.  This commit makes
sure that the syscache lookups can happen correctly by setting a
transaction context when running SHOW commands in a WAL sender.

Superuser-only parameters can be displayed using SHOW commands not only
to superusers, but also to members of system role pg_read_all_settings,
which requires a syscache lookup to check if the connected role is a
member of this system role or not, or the instance crashes.  Superusers
do not need to check the syscache so it worked correctly in this case.

New tests are added to cover this issue.

Reported-by: Alexander Kukushkin
Author: Michael Paquier
Reviewed-by: Álvaro Herrera
Discussion: https://postgr.es/m/15734-2daa8761eeed8e20@postgresql.org
Backpatch-through: 10

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/51290264346f0afce9752e5f6c957e1bfa3d2391

Modified Files
--------------
src/backend/replication/walsender.c   |  3 ++
src/test/perl/PostgresNode.pm         |  3 +-
src/test/recovery/t/001_stream_rep.pl | 56 +++++++++++++++++++++++++++++++++--
3 files changed, 59 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix SHOW ALL command for non-superusers with replication connect
@ 2019-04-15 03:35 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2019-04-15 03:35 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix SHOW ALL command for non-superusers with replication connection

Since Postgres 10, SHOW commands can be triggered with replication
connections in a WAL sender context, however it missed that a
transaction context is needed for syscache lookups.  This commit makes
sure that the syscache lookups can happen correctly by setting a
transaction context when running SHOW commands in a WAL sender.

Superuser-only parameters can be displayed using SHOW commands not only
to superusers, but also to members of system role pg_read_all_settings,
which requires a syscache lookup to check if the connected role is a
member of this system role or not, or the instance crashes.  Superusers
do not need to check the syscache so it worked correctly in this case.

New tests are added to cover this issue.

Reported-by: Alexander Kukushkin
Author: Michael Paquier
Reviewed-by: Álvaro Herrera
Discussion: https://postgr.es/m/15734-2daa8761eeed8e20@postgresql.org
Backpatch-through: 10

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/replication/walsender.c   |  3 ++
src/test/perl/PostgresNode.pm         |  3 +-
src/test/recovery/t/001_stream_rep.pl | 56 +++++++++++++++++++++++++++++++++--
3 files changed, 59 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-04-15 03:35 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-04-15 03:35 pgsql: Fix SHOW ALL command for non-superusers with replication connect Michael Paquier <michael@paquier.xyz>
2019-04-15 03:35 pgsql: Fix SHOW ALL command for non-superusers with replication connect Michael Paquier <michael@paquier.xyz>
2019-04-15 03:35 pgsql: Fix SHOW ALL command for non-superusers with replication connect Michael Paquier <michael@paquier.xyz>

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