aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/equalfuncs.c
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:33 -0500
commit820ab11fbfd508fc75a39c43ad2c1b3e79c4982b (patch)
treeda6ccc56e89c3f83bb5ca76eb53a68fedf00bfc5 /src/backend/nodes/equalfuncs.c
parentc38c3080cb43e78bd1d082ad1ec3ad2af89c2601 (diff)
downloadpostgresql-820ab11fbfd508fc75a39c43ad2c1b3e79c4982b.tar.gz
postgresql-820ab11fbfd508fc75a39c43ad2c1b3e79c4982b.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/backend/nodes/equalfuncs.c')
-rw-r--r--src/backend/nodes/equalfuncs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index d185654f711..f8770b0b612 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -2143,6 +2143,7 @@ _equalConstraint(const Constraint *a, const Constraint *b)
COMPARE_SCALAR_FIELD(fk_upd_action);
COMPARE_SCALAR_FIELD(fk_del_action);
COMPARE_NODE_FIELD(old_conpfeqop);
+ COMPARE_SCALAR_FIELD(old_pktable_oid);
COMPARE_SCALAR_FIELD(skip_validation);
COMPARE_SCALAR_FIELD(initially_valid);