From a2a3192802e12e056806d5921c3fc4a7a6df8b09 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 23 Aug 2002 16:41:38 +0000 Subject: Further cleanup around the edges of OPAQUE/pseudotype changes. Correct the declarations of some index access method support functions. Support SQL functions returning VOID. --- src/test/regress/expected/opr_sanity.out | 13 +++++++++++++ src/test/regress/sql/opr_sanity.sql | 11 +++++++++++ 2 files changed, 24 insertions(+) (limited to 'src/test') diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out index efdc8c6a500..66a2b71cac5 100644 --- a/src/test/regress/expected/opr_sanity.out +++ b/src/test/regress/expected/opr_sanity.out @@ -187,6 +187,19 @@ WHERE p1.oid != p2.oid AND -------------+------------- (0 rows) +-- Look for functions that return type "internal" and do not have any +-- "internal" argument. Such a function would be a security hole since +-- it might be used to call an internal function from an SQL command. +-- As of 7.3 this query should find only internal_in. +SELECT p1.oid, p1.proname +FROM pg_proc as p1 +WHERE p1.prorettype = 'internal'::regtype AND NOT + ('(' || oidvectortypes(p1.proargtypes) || ')') ~ '[^a-z0-9_]internal[^a-z0-9_]'; + oid | proname +------+------------- + 2304 | internal_in +(1 row) + -- **************** pg_cast **************** -- Look for casts from and to the same type. This is not harmful, but -- useless. diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql index d9be98a5fd3..531a5523e0a 100644 --- a/src/test/regress/sql/opr_sanity.sql +++ b/src/test/regress/sql/opr_sanity.sql @@ -148,6 +148,17 @@ WHERE p1.oid != p2.oid AND NOT p1.proisagg AND NOT p2.proisagg AND (p1.proargtypes[7] < p2.proargtypes[7]); +-- Look for functions that return type "internal" and do not have any +-- "internal" argument. Such a function would be a security hole since +-- it might be used to call an internal function from an SQL command. +-- As of 7.3 this query should find only internal_in. + +SELECT p1.oid, p1.proname +FROM pg_proc as p1 +WHERE p1.prorettype = 'internal'::regtype AND NOT + ('(' || oidvectortypes(p1.proargtypes) || ')') ~ '[^a-z0-9_]internal[^a-z0-9_]'; + + -- **************** pg_cast **************** -- Look for casts from and to the same type. This is not harmful, but -- cgit v1.2.3