diff options
Diffstat (limited to 'src/backend/tcop/fastpath.c')
-rw-r--r-- | src/backend/tcop/fastpath.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c index 7d001e0f824..472a567d0fa 100644 --- a/src/backend/tcop/fastpath.c +++ b/src/backend/tcop/fastpath.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.83.2.2 2006/06/11 15:49:36 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.83.2.3 2010/06/30 18:11:19 heikki Exp $ * * NOTES * This cruft is the server side of PQfn. @@ -28,6 +28,7 @@ #include "tcop/fastpath.h" #include "tcop/tcopprot.h" #include "utils/acl.h" +#include "utils/fmgroids.h" #include "utils/lsyscache.h" #include "utils/syscache.h" #include "utils/tqual.h" @@ -344,6 +345,16 @@ HandleFunctionRequest(StringInfo msgBuf) get_func_name(fid)); /* + * Restrict access to pg_get_expr(). This reflects the hack in + * transformFuncCall() in parse_expr.c, see comments there for an + * explanation. + */ + if ((fid == F_PG_GET_EXPR || fid == F_PG_GET_EXPR_EXT) && !superuser()) + ereport(ERROR, + (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), + errmsg("argument to pg_get_expr() must come from system catalogs"))); + + /* * Prepare function call info block and insert arguments. */ InitFunctionCallInfoData(fcinfo, &fip->flinfo, 0, NULL, NULL); |