Re: CREATEROLE does not permit commenting on newly-created roles

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Owen Jacobson <owen(dot)jacobson(at)grimoire(dot)ca>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: CREATEROLE does not permit commenting on newly-created roles
Date: 2011-03-09 05:45:48
Message-ID: 10429.1299649548@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Tue, Mar 8, 2011 at 11:48 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> In particular, I suggest the attached patch (code-complete, but sans
>> documentation changes).

> I think it's a good change, but we should make sure to release-note it
> properly,

I had already drafted a commit message:

Adjust the permissions required for COMMENT ON ROLE.

Formerly, any member of a role could change the role's comment, as of
course could superusers; but holders of CREATEROLE privilege could not,
unless they were also members. This led to the odd situation that a
CREATEROLE holder could create a role but then could not comment on it.
It also seems a bit dubious to let an unprivileged user change his own
comment, let alone those of group roles he belongs to. So, change the
rule to be "you must be superuser to comment on a superuser role, or
hold CREATEROLE to comment on non-superuser roles". This is the same
as the privilege check for creating/dropping roles, and thus fits much
better with the rule for other object types, namely that only the owner
of an object can comment on it.

Per complaint from Owen Jacobson and subsequent discussion.

How that gets boiled down into a release note will depend on whoever
writes the release notes.

> along with the change you made for PLs.

Hrm?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sandy Test 2011-03-09 13:05:57 backup using pg_dump postgreSQL 8.3.8
Previous Message Robert Haas 2011-03-09 05:18:18 Re: CREATEROLE does not permit commenting on newly-created roles