Ignore SECURITY DEFINER and SET attributes for a PL's call handler.
Ignore SECURITY DEFINER and SET attributes for a PL's call handler.

It's not very sensible to set such attributes on a handler function;
but if one were to do so, fmgr.c went into infinite recursion because
it would call fmgr_security_definer instead of the handler function proper.
There is no way for fmgr_security_definer to know that it ought to call the
handler and not the original function referenced by the FmgrInfo's fn_oid,
so it tries to do the latter, causing the whole process to start over
again.

Ordinarily such misconfiguration of a procedural language's handler could
be written off as superuser error.  However, because we allow non-superuser
database owners to create procedural languages and the handler for such a
language becomes owned by the database owner, it is possible for a database
owner to crash the backend, which ideally shouldn't be possible without
superuser privileges.  In 9.2 and up we will adjust things so that the
handler functions are always owned by superusers, but in existing branches
this is a minor security fix.

Problem noted by Noah Misch (after several of us had failed to detect
it :-().  This is CVE-2012-2655.

ahachete/gpdb,0x0FFF/gpdb,janebeckman/gpdb,0x0FFF/gpdb,greenplum-db/gpdb,xuegang/gpdb,ahachete/gpdb,xinzweb/gpdb,jmcatamney/gpdb,xuegang/gpdb,cjcjameson/gpdb,royc1/gpdb,lintzc/gpdb,kaknikhil/gpdb,ahachete/gpdb,yuanzhao/gpdb,royc1/gpdb,greenplum-db/gpdb,royc1/gpdb,chrishajas/gpdb,chrishajas/gpdb,CraigHarris/gpdb,Quikling/gpdb,jmcatamney/gpdb,edespino/gpdb,jmcatamney/gpdb,xuegang/gpdb,jmcatamney/gpdb,lintzc/gpdb,ahachete/gpdb,cjcjameson/gpdb,rvs/gpdb,ashwinstar/gpdb,royc1/gpdb,jmcatamney/gpdb,janebeckman/gpdb,chrishajas/gpdb,lisakowen/gpdb,xinzweb/gpdb,Chibin/gpdb,50wu/gpdb,edespino/gpdb,cjcjameson/gpdb,janebeckman/gpdb,ashwinstar/gpdb,zaksoup/gpdb,Chibin/gpdb,0x0FFF/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,Quikling/gpdb,yuanzhao/gpdb,Chibin/gpdb,Quikling/gpdb,rvs/gpdb,jmcatamney/gpdb,xuegang/gpdb,kaknikhil/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,rvs/gpdb,Chibin/gpdb,adam8157/gpdb,xinzweb/gpdb,Quikling/gpdb,adam8157/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,Quikling/gpdb,edespino/gpdb,edespino/gpdb,Chibin/gpdb,50wu/gpdb,lintzc/gpdb,xuegang/gpdb,yuanzhao/gpdb,lintzc/gpdb,royc1/gpdb,royc1/gpdb,lintzc/gpdb,lisakowen/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,xinzweb/gpdb,ashwinstar/gpdb,royc1/gpdb,xinzweb/gpdb,janebeckman/gpdb,edespino/gpdb,cjcjameson/gpdb,zaksoup/gpdb,CraigHarris/gpdb,edespino/gpdb,Quikling/gpdb,CraigHarris/gpdb,Chibin/gpdb,edespino/gpdb,xuegang/gpdb,yuanzhao/gpdb,Quikling/gpdb,ashwinstar/gpdb,50wu/gpdb,Chibin/gpdb,edespino/gpdb,zaksoup/gpdb,kaknikhil/gpdb,lisakowen/gpdb,chrishajas/gpdb,lintzc/gpdb,50wu/gpdb,cjcjameson/gpdb,CraigHarris/gpdb,chrishajas/gpdb,lisakowen/gpdb,0x0FFF/gpdb,janebeckman/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,kaknikhil/gpdb,lisakowen/gpdb,xuegang/gpdb,50wu/gpdb,ashwinstar/gpdb,lintzc/gpdb,rvs/gpdb,edespino/gpdb,ahachete/gpdb,adam8157/gpdb,cjcjameson/gpdb,janebeckman/gpdb,cjcjameson/gpdb,Chibin/gpdb,rvs/gpdb,chrishajas/gpdb,Quikling/gpdb,rvs/gpdb,xuegang/gpdb,CraigHarris/gpdb,xinzweb/gpdb,rvs/gpdb,zaksoup/gpdb,janebeckman/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,zaksoup/gpdb,jmcatamney/gpdb,CraigHarris/gpdb,50wu/gpdb,lisakowen/gpdb,50wu/gpdb,rvs/gpdb,ahachete/gpdb,0x0FFF/gpdb,xinzweb/gpdb,kaknikhil/gpdb,zaksoup/gpdb,ahachete/gpdb,adam8157/gpdb,greenplum-db/gpdb,0x0FFF/gpdb,chrishajas/gpdb,Quikling/gpdb,royc1/gpdb,ahachete/gpdb,xinzweb/gpdb,adam8157/gpdb,kaknikhil/gpdb,greenplum-db/gpdb,janebeckman/gpdb,cjcjameson/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,adam8157/gpdb,xuegang/gpdb,CraigHarris/gpdb,Chibin/gpdb,edespino/gpdb,0x0FFF/gpdb,Quikling/gpdb,Chibin/gpdb,lisakowen/gpdb,rvs/gpdb,rvs/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,lintzc/gpdb,janebeckman/gpdb,lintzc/gpdb,50wu/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,adam8157/gpdb,zaksoup/gpdb,adam8157/gpdb,zaksoup/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,janebeckman/gpdb,kaknikhil/gpdb,kaknikhil/gpdb,chrishajas/gpdb,lisakowen/gpdb