]> granicus.if.org Git - postgresql/commit
Adjust permissions checking for ALTER OWNER commands: instead of
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 14 Jul 2005 21:46:30 +0000 (21:46 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 14 Jul 2005 21:46:30 +0000 (21:46 +0000)
commitaa1110624c08298393dfce996f7b21809d98d3fd
treeb698817242cc44d7ad14cbd68cb0b96e751e4e13
parentbd157821649ae203b9c8ce8daf4ec027a0003351
Adjust permissions checking for ALTER OWNER commands: instead of
requiring superuserness always, allow an owner to reassign ownership
to any role he is a member of, if that role would have the right to
create a similar object.  These three requirements essentially state
that the would-be alterer has enough privilege to DROP the existing
object and then re-CREATE it as the new role; so we might as well
let him do it in one step.  The ALTER TABLESPACE case is a bit
squirrely, but the whole concept of non-superuser tablespace owners
is pretty dubious anyway.  Stephen Frost, code review by Tom Lane.
12 files changed:
src/backend/commands/aggregatecmds.c
src/backend/commands/conversioncmds.c
src/backend/commands/dbcommands.c
src/backend/commands/functioncmds.c
src/backend/commands/opclasscmds.c
src/backend/commands/operatorcmds.c
src/backend/commands/schemacmds.c
src/backend/commands/tablecmds.c
src/backend/commands/tablespace.c
src/backend/commands/typecmds.c
src/backend/utils/adt/acl.c
src/include/utils/acl.h