8000 CLUSTER did no permissions checking, forsooth ... · postgrespro/postgres_cluster@218f357 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

< 8000 /div>
Appearance settings

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)
0