diff options
author | Noah Misch <noah@leadboat.com> | 2019-08-05 07:48:41 -0700 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2019-08-05 07:48:45 -0700 |
commit | 752fa3dbfc36c70a692986b56daac41410fca3f6 (patch) | |
tree | 57569a9b106aa92376f0a11b2a23ac506a10f192 /src/include | |
parent | 0e9e7e28902ca0a01b0d36cbdd155abe4ea63cfe (diff) |
Require the schema qualification in pg_temp.type_name(arg).
Commit aa27977fe21a7dfa4da4376ad66ae37cb8f0d0b5 introduced this
restriction for pg_temp.function_name(arg); do likewise for types
created in temporary schemas. Programs that this breaks should add
"pg_temp." schema qualification or switch to arg::type_name syntax.
Back-patch to 9.4 (all supported versions).
Reviewed by Tom Lane. Reported by Tom Lane.
Security: CVE-2019-10208
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/namespace.h | 1 | ||||
-rw-r--r-- | src/include/parser/parse_type.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h index f3b005fa9d8..e2a11c65aa0 100644 --- a/src/include/catalog/namespace.h +++ b/src/include/catalog/namespace.h @@ -66,6 +66,7 @@ extern Oid RelnameGetRelid(const char *relname); extern bool RelationIsVisible(Oid relid); extern Oid TypenameGetTypid(const char *typname); +extern Oid TypenameGetTypidExtended(const char *typname, bool temp_ok); extern bool TypeIsVisible(Oid typid); extern FuncCandidateList FuncnameGetCandidates(List *names, diff --git a/src/include/parser/parse_type.h b/src/include/parser/parse_type.h index f95bfe78eab..6f1a7b993e9 100644 --- a/src/include/parser/parse_type.h +++ b/src/include/parser/parse_type.h @@ -21,6 +21,9 @@ typedef HeapTuple Type; extern Type LookupTypeName(ParseState *pstate, const TypeName *typeName, int32 *typmod_p, bool missing_ok); +extern Type LookupTypeNameExtended(ParseState *pstate, + const TypeName *typeName, int32 *typmod_p, + bool temp_ok, bool missing_ok); extern Oid LookupTypeNameOid(ParseState *pstate, const TypeName *typeName, bool missing_ok); extern Type typenameType(ParseState *pstate, const TypeName *typeName, |