Skip to content

Commit 218f357

Browse files
committed
CLUSTER did no permissions checking, forsooth ...
1 parent e6e893e commit 218f357

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/backend/tcop/utility.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.100 2000/11/07 02:17:50 tgl Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.101 2000/11/08 16:31:06 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -670,7 +670,14 @@ ProcessUtility(Node *parsetree,
670670

671671
set_ps_display(commandTag = "CLUSTER");
672672

673-
cluster(stmt->relname, stmt->indexname);
673+
relname = stmt->relname;
674+
if (IsSystemRelationName(relname))
675+
elog(ERROR, "CLUSTER: relation \"%s\" is a system catalog",
676+
relname);
677+
if (!pg_ownercheck(GetUserId(), relname, RELNAME))
678+
elog(ERROR, "permission denied");
679+
680+
cluster(relname, stmt->indexname);
674681
}
675682
break;
676683

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy