Re: CREATE USER and pg_user

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, William ZHANG <uniware(at)zedware(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: CREATE USER and pg_user
Date: 2005-08-23 02:42:15
Message-ID: 27661.1124764935@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> My original point was that if you don't have permission to do something,
> you shouldn't be able to grant permissions to do it. This applies to all
> the permissions, not just superuser (though that one's obviously the
> most dangerous). Granted, at this point I think the only permission this
> would really matter on (other than SUPERUSER/CREATEUSER) is CREATEDB,
> but that will probably change if more privleges are added. It seems we
> should set the standard now that if you don't have a permission you
> can't grant it, rather than wait 'til later.

I'm not convinced. It seems reasonable to say that you can't grant
CREATEDB if you don't have it, but that's only because it's hard to
imagine why anyone would make a role that's CREATEROLE and not CREATEDB.
But, for example, we allow a CREATEROLE role to grant and revoke role
memberships without itself being an admin of those roles.

Basically the point of CREATEROLE is to be a safer kind of superuser:
you can do what you like with respect to creating and dropping and
altering users and groups (other than superusers), but you don't have
permission to, say, "DELETE FROM pg_proc". If we restrict CREATEROLE
to not have any privileges that an ordinary user wouldn't have except
the ability to create users, then we'll be back at square one in the
sense that lots of common administrative situations will require
superuser privilege.

It's quite likely that we don't have CREATEROLE fully done yet, and
that it still needs some more tweaks that we haven't thought of.
But I don't think I buy the premise that it ought to be confined to
creating users with no other special privileges. If we do that,
we'll just have to re-invent the limited-superuser facility under
a different name, because there's a serious need for that.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Satoshi Nagayasu 2005-08-23 02:52:57 Re: Pre-allocated free space for row updating (like PCTFREE)
Previous Message Tom Lane 2005-08-23 02:18:25 Re: Pre-allocated free space for row updating (like PCTFREE)