mirror of
https://github.com/postgres/postgres.git
synced 2026-04-29 18:32:53 -04:00
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
52 lines
1.7 KiB
C
52 lines
1.7 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* utility.h
|
|
* prototypes for utility.c.
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/tcop/utility.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef UTILITY_H
|
|
#define UTILITY_H
|
|
|
|
#include "tcop/tcopprot.h"
|
|
|
|
typedef enum
|
|
{
|
|
PROCESS_UTILITY_TOPLEVEL, /* toplevel interactive command */
|
|
PROCESS_UTILITY_QUERY, /* a complete query, but not toplevel */
|
|
PROCESS_UTILITY_SUBCOMMAND /* a portion of a query */
|
|
} ProcessUtilityContext;
|
|
|
|
/* Hook for plugins to get control in ProcessUtility() */
|
|
typedef void (*ProcessUtility_hook_type) (Node *parsetree,
|
|
const char *queryString, ProcessUtilityContext context,
|
|
ParamListInfo params,
|
|
DestReceiver *dest, char *completionTag);
|
|
extern PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook;
|
|
|
|
extern void ProcessUtility(Node *parsetree, const char *queryString,
|
|
ProcessUtilityContext context, ParamListInfo params,
|
|
DestReceiver *dest, char *completionTag);
|
|
extern void standard_ProcessUtility(Node *parsetree, const char *queryString,
|
|
ProcessUtilityContext context, ParamListInfo params,
|
|
DestReceiver *dest, char *completionTag);
|
|
|
|
extern bool UtilityReturnsTuples(Node *parsetree);
|
|
|
|
extern TupleDesc UtilityTupleDescriptor(Node *parsetree);
|
|
|
|
extern Query *UtilityContainsQuery(Node *parsetree);
|
|
|
|
extern const char *CreateCommandTag(Node *parsetree);
|
|
|
|
extern LogStmtLevel GetCommandLogLevel(Node *parsetree);
|
|
|
|
extern bool CommandIsReadOnly(Node *parsetree);
|
|
|
|
#endif /* UTILITY_H */
|