pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: maxim.boguk@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6422: User without any priviledges on a table can lock the table from other users in some cases
Date: Tue, 31 Jan 2012 03:41:19 +0000
Message-ID: <E1Rs4at-0004v5-KS@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      6422
Logged by:          Maxim Boguk
Email address:      maxim.boguk@gmail.com
PostgreSQL version: 9.1.2
Operating system:   Linux
Description:        

Hi.

Unfortunately I was hit by that problem in the real project.

During active pg_dump (or any long transaction keeping lock on table), any
users with access to database can lock table from access, even if that user
have absolutely no rights on that table.

Test scenario:

1)CREATE ROLE dummy with login password 'something';

2)start pg_dump on database or any long transactions involving table news


3)now:
psql -U dummy -d testdb

=> SELECT * from news;
ERROR:  permission denied for relation news

That perfectly ok...

sports=> begin;
BEGIN
sports=> lock table news;
oops... table locked from everyone access untill canceled or pg_dump
finished 

(and in realily - large web site down for 3 minute until my intervention).


The same can be done with any
alter table news ... ; statement.

Again I not sure is it an actual bug or feature. Seems Postgres trying to
put a lock on the table before check grants.

May be it's possible to check grants before set any heavy lock on the
table?

That behavior could be very troublesome in multi-user database environment.







Message-ID: <E1Rs4at-0004v5-KS@wrigleys.postgresql.org>
Permalink:  ../E1Rs4at-0004v5-KS@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1Rs4at-0004v5-KS@wrigleys.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-bugs@postgresql.org
  Cc: maxim.boguk@gmail.com
  Subject: Re: BUG #6422: User without any priviledges on a table can lock the table from other users in some cases
  In-Reply-To: <E1Rs4at-0004v5-KS@wrigleys.postgresql.org>
  References: <E1Rs4at-0004v5-KS@wrigleys.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