BUG #5609: Exclusive Locks & Permission - Mailing list pgsql-bugs

From Rob Brucks
Subject BUG #5609: Exclusive Locks & Permission
Date
Msg-id 201008091913.o79JDUPh016674@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5609: Exclusive Locks & Permission
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5609
Logged by:          Rob Brucks
Email address:      rob.brucks@rackspace.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

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: postgres 9.0 beta libpq empty binary array error
Next
From: Robert Haas
Date:
Subject: Re: BUG #5587: Installer non-default file association problem