pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make inherited LOCK TABLE perform access permission checks on pa
Date: Tue, 18 Feb 2020 04:15:30 +0000
Message-ID: <E1j3uIE-0006xn-0w@gemulon.postgresql.org> (raw)

Make inherited LOCK TABLE perform access permission checks on parent table only.

Previously, LOCK TABLE command through a parent table checked
the permissions on not only the parent table but also the children
tables inherited from it. This was a bug and inherited queries should
perform access permission checks on the parent table only. This
commit fixes LOCK TABLE so that it does not check the permission
on children tables.

This patch is applied only in the master branch. We decided not to
back-patch because it's not hard to imagine that there are some
applications expecting the old behavior and the change breaks their
security.

Author: Amit Langote
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/CAHGQGwE+GauyG7POtRfRwwthAGwTjPQYdFHR97+LzA4RHGnJxA@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/commands/lockcmds.c          | 33 +++++++++++---------------------
src/test/regress/expected/lock.out       | 10 +++++++---
src/test/regress/expected/privileges.out |  7 +++++++
src/test/regress/sql/lock.sql            |  8 ++++++--
src/test/regress/sql/privileges.sql      |  6 ++++++
5 files changed, 37 insertions(+), 27 deletions(-)



Message-ID: <E1j3uIE-0006xn-0w@gemulon.postgresql.org>
Permalink:  ../E1j3uIE-0006xn-0w@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1j3uIE-0006xn-0w@gemulon.postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org
  Subject: Re: pgsql: Make inherited LOCK TABLE perform access permission checks on pa
  In-Reply-To: <E1j3uIE-0006xn-0w@gemulon.postgresql.org>
  References: <E1j3uIE-0006xn-0w@gemulon.postgresql.org>

* 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