Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group