aboutsummaryrefslogtreecommitdiff
path: root/src/include/parser/parse_utilcmd.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2014-02-17 09:33:31 -0500
committerRobert Haas <rhaas@postgresql.org>2014-02-17 09:33:38 -0500
commite464761333024d2c63f6b1d04af4ea7ca317003b (patch)
tree8c5a1369e87e46cff96581799d47c0ee77766b74 /src/include/parser/parse_utilcmd.h
parent09e2d4c145a6d796271cb8731c6201d76d0a0e9c (diff)
downloadpostgresql-e464761333024d2c63f6b1d04af4ea7ca317003b.tar.gz
postgresql-e464761333024d2c63f6b1d04af4ea7ca317003b.zip
Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent activity, we might perform some parts of the DDL on a different table than other parts. At least in the case of CREATE INDEX, this can be used to cause the permissions checks to be performed against a different table than the index creation, allowing for a privilege escalation attack. This changes the calling convention for DefineIndex, CreateTrigger, transformIndexStmt, transformAlterTableStmt, CheckIndexCompatible (in 9.2 and newer), and AlterTable (in 9.1 and older). In addition, CheckRelationOwnership is removed in 9.2 and newer and the calling convention is changed in older branches. A field has also been added to the Constraint node (FkConstraint in 8.4). Third-party code calling these functions or using the Constraint node will require updating. Report by Andres Freund. Patch by Robert Haas and Andres Freund, reviewed by Tom Lane. Security: CVE-2014-0062
Diffstat (limited to 'src/include/parser/parse_utilcmd.h')
-rw-r--r--src/include/parser/parse_utilcmd.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/include/parser/parse_utilcmd.h b/src/include/parser/parse_utilcmd.h
index 089c907c0e6..ec9e6d5623c 100644
--- a/src/include/parser/parse_utilcmd.h
+++ b/src/include/parser/parse_utilcmd.h
@@ -18,9 +18,10 @@
extern List *transformCreateStmt(CreateStmt *stmt, const char *queryString);
-extern List *transformAlterTableStmt(AlterTableStmt *stmt,
+extern List *transformAlterTableStmt(Oid relid, AlterTableStmt *stmt,
const char *queryString);
-extern IndexStmt *transformIndexStmt(IndexStmt *stmt, const char *queryString);
+extern IndexStmt *transformIndexStmt(Oid relid, IndexStmt *stmt,
+ const char *queryString);
extern void transformRuleStmt(RuleStmt *stmt, const char *queryString,
List **actions, Node **whereClause);
extern List *transformCreateSchemaStmt(CreateSchemaStmt *stmt);