1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

Fix permission checking for temp-table namespace.

This commit is contained in:
Tom Lane
2002-08-07 21:45:02 +00:00
parent dfef56a92f
commit c1003339d6
5 changed files with 30 additions and 32 deletions

View File

@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.168 2002/08/04 04:31:44 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.169 2002/08/07 21:45:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -399,22 +399,17 @@ ProcessUtility(Node *parsetree,
/*
* RENAME TABLE requires that we (still) hold CREATE
* rights on the containing namespace, as well as
* ownership of the table. But skip check for
* temp tables.
* ownership of the table.
*/
Oid namespaceId = get_rel_namespace(relid);
AclResult aclresult;
if (!isTempNamespace(namespaceId))
{
AclResult aclresult;
aclresult = pg_namespace_aclcheck(namespaceId,
GetUserId(),
ACL_CREATE);
if (aclresult != ACLCHECK_OK)
aclcheck_error(aclresult,
get_namespace_name(namespaceId));
}
aclresult = pg_namespace_aclcheck(namespaceId,
GetUserId(),
ACL_CREATE);
if (aclresult != ACLCHECK_OK)
aclcheck_error(aclresult,
get_namespace_name(namespaceId));
renamerel(relid, stmt->newname);
break;