mirror of
https://github.com/postgres/postgres.git
synced 2025-07-17 06:41:09 +03:00
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
This commit is contained in:
@ -109,7 +109,7 @@ extern PGDLLIMPORT int SessionReplicationRole;
|
||||
#define TRIGGER_DISABLED 'D'
|
||||
|
||||
extern Oid CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
|
||||
Oid constraintOid, Oid indexOid,
|
||||
Oid relOid, Oid refRelOid, Oid constraintOid, Oid indexOid,
|
||||
bool isInternal);
|
||||
|
||||
extern void RemoveTriggerById(Oid trigOid);
|
||||
|
Reference in New Issue
Block a user