Commit 218f357d authored by Tom Lane's avatar Tom Lane

CLUSTER did no permissions checking, forsooth ...

parent e6e893e7
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.100 2000/11/07 02:17:50 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.101 2000/11/08 16:31:06 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -670,7 +670,14 @@ ProcessUtility(Node *parsetree, ...@@ -670,7 +670,14 @@ ProcessUtility(Node *parsetree,
set_ps_display(commandTag = "CLUSTER"); set_ps_display(commandTag = "CLUSTER");
cluster(stmt->relname, stmt->indexname); relname = stmt->relname;
if (IsSystemRelationName(relname))
elog(ERROR, "CLUSTER: relation \"%s\" is a system catalog",
relname);
if (!pg_ownercheck(GetUserId(), relname, RELNAME))
elog(ERROR, "permission denied");
cluster(relname, stmt->indexname);
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment