pgsql: Clean up package namespace use and use of Safe in plperl.

Started by Nonamealmost 16 years ago3 messages
#1Noname
adunstan@postgresql.org

Log Message:
-----------
Clean up package namespace use and use of Safe in plperl.
Prevent use of another buggy version of Safe.pm.
Only register the exit handler if we have successfully created an interpreter.
Change log level of perl warnings from NOTICE to WARNING.

The infrastructure is there if in future we decide to allow
DBAs to specify extra modules that will be allowed in trusted code.
However, for now the relevant variables are declared as lexicals
rather than as package variables, so that they are not (or should not be)
accessible.

Mostly code from Tim Bunce, reviewed by Alex Hunsaker, with some
tweaks by me.

Modified Files:
--------------
pgsql/src/pl/plperl:
plc_perlboot.pl (r1.4 -> r1.5)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plperl/plc_perlboot.pl?r1=1.4&r2=1.5)
plc_safe_ok.pl (r1.4 -> r1.5)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plperl/plc_safe_ok.pl?r1=1.4&r2=1.5)
plperl.c (r1.167 -> r1.168)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plperl/plperl.c?r1=1.167&r2=1.168)
pgsql/src/pl/plperl/expected:
plperl.out (r1.18 -> r1.19)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plperl/expected/plperl.out?r1=1.18&r2=1.19)
plperl_elog.out (r1.8 -> r1.9)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plperl/expected/plperl_elog.out?r1=1.8&r2=1.9)
plperlu.out (r1.2 -> r1.3)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plperl/expected/plperlu.out?r1=1.2&r2=1.3)
pgsql/src/pl/plperl/sql:
plperl.sql (r1.16 -> r1.17)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plperl/sql/plperl.sql?r1=1.16&r2=1.17)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: [COMMITTERS] pgsql: Clean up package namespace use and use of Safe in plperl.

adunstan@postgresql.org (Andrew Dunstan) writes:

Clean up package namespace use and use of Safe in plperl.

According to buildfarm member kite, there is more than one spelling of
the Perl warning message that was (randomly?) chosen for the test added
here.  I doubt it's worth maintaining a variant expected file for this
--- I'd suggest picking a simpler warning or dropping the actual
warning-generation aspect of the test.

regards, tom lane

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#2)
Re: [COMMITTERS] pgsql: Clean up package namespace use and use of Safe in plperl.

Tom Lane wrote:

adunstan@postgresql.org (Andrew Dunstan) writes:

Clean up package namespace use and use of Safe in plperl.

According to buildfarm member kite, there is more than one spelling of
the Perl warning message that was (randomly?) chosen for the test added
here.  I doubt it's worth maintaining a variant expected file for this
--- I'd suggest picking a simpler warning or dropping the actual
warning-generation aspect of the test.

Thanks for the report. I have committed a test that I hope will have a
more portable message.

cheers

andrew