BUG #5609: Exclusive Locks & Permission

From: "Rob Brucks" <rob(dot)brucks(at)rackspace(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5609: Exclusive Locks & Permission
Date: 2010-08-09 19:13:30
Message-ID: 201008091913.o79JDUPh016674@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5609
Logged by: Rob Brucks
Email address: rob(dot)brucks(at)rackspace(dot)com
PostgreSQL version: 8.3.7
Operating system: Ubuntu 8.04
Description: Exclusive Locks & Permission
Details:

If a user that does not have permission to alter a table issues an alter he
acquires an exclusive lock BEFORE permission is checked and an error is
issued.

This causes concurrency problems since the unprivileged user causes other
threads to wait while it attempts to acquire an exclusive lock, only to have
it ultimately fail.

The user's permissions need to be checked before requesting an exclusive
lock on the table for the alter.

To re-create:
psql -U postgres -d postgres
postgres=# CREATE ROLE nobody NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT
LOGIN;
postgres=# CREATE TABLE tab1 (a int);
postgres=# REVOKE ALL ON tab1

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2010-08-09 19:15:00 Re: BUG #5587: Installer non-default file association problem
Previous Message Heikki Linnakangas 2010-08-09 18:29:10 Re: postgres 9.0 beta libpq empty binary array error