]> granicus.if.org Git - postgresql/commitdiff
Fix security definer functions with polymorphic arguments. This case has
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 Jul 2007 15:50:01 +0000 (15:50 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 Jul 2007 15:50:01 +0000 (15:50 +0000)
never worked because fmgr_security_definer() neglected to pass the fn_expr
information through.  Per report from Viatcheslav Kalinin.

src/backend/utils/fmgr/fmgr.c

index 4d9aa23be5a53a32c8be9e80cfd9ed58e5c08239..f380ad428d000c6bcb124525339265b4f9fe63d5 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.97.2.1 2005/11/22 18:23:23 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.97.2.2 2007/07/31 15:50:01 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -793,6 +793,7 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
 
                fmgr_info_cxt_security(fcinfo->flinfo->fn_oid, &fcache->flinfo,
                                                           fcinfo->flinfo->fn_mcxt, true);
+               fcache->flinfo.fn_expr = fcinfo->flinfo->fn_expr;
 
                tuple = SearchSysCache(PROCOID,
                                                           ObjectIdGetDatum(fcinfo->flinfo->fn_oid),