PlPerl.c patch

Started by Travis Baueralmost 25 years ago4 messages
#1Travis Bauer
trbauer@indiana.edu
1 attachment(s)

I have attached a simple change to src/pl/plperl/plperl.c to
enable the :bash_math opcodes. Currently plperl.c only
enables the :default opcodes. This leave out about five of six
math functions including sqrt().

It might be worth considering allowing the user's to enable
other packages on the command line. However, most of the other
packages allow you to do things like access the underlying file
system (as the owner of the backend process), make system calls,
and perform network operations.

The patch is off of the 7.0.3 released code.

--
----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------

Attachments:

plchanges.txttext/plain; charset=us-asciiDownload
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Travis Bauer (#1)
Re: PlPerl.c patch

Travis Bauer <trbauer@indiana.edu> writes:

I have attached a simple change to src/pl/plperl/plperl.c to
enable the :bash_math opcodes. Currently plperl.c only
enables the :default opcodes. This leave out about five of six
math functions including sqrt().

This seems like a reasonable change, but could we trouble you to
submit it in diff -c format? Without the context it's way too
error-prone to apply.

regards, tom lane

#3Travis Bauer
trbauer@indiana.edu
In reply to: Tom Lane (#2)
1 attachment(s)
Re: PlPerl.c patch

Attached.

Tom Lane (tgl@sss.pgh.pa.us) wrote:

Travis Bauer <trbauer@indiana.edu> writes:

I have attached a simple change to src/pl/plperl/plperl.c to
enable the :bash_math opcodes. Currently plperl.c only
enables the :default opcodes. This leave out about five of six
math functions including sqrt().

This seems like a reasonable change, but could we trouble you to
submit it in diff -c format? Without the context it's way too
error-prone to apply.

regards, tom lane

--
----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------

Attachments:

plchanges2.txttext/plain; charset=us-asciiDownload
*** src/pl/plperl	Thu Jan 18 13:00:28 2001
--- plperl.c	Thu Jan 18 15:58:48 2001
***************
*** 224,230 ****
  		/* no commas between the next 4 please. They are supposed to be one string
  		 */
  		"require Safe; SPI::bootstrap();"
! 		"sub ::mksafefunc { my $x = new Safe; $x->permit_only(':default');"
  		"$x->share(qw[&elog &DEBUG &NOTICE &NOIND &ERROR]);"
  		" return $x->reval(qq[sub { $_[0] }]); }"
  		};
--- 224,230 ----
  		/* no commas between the next 4 please. They are supposed to be one string
  		 */
  		"require Safe; SPI::bootstrap();"
! 		"sub ::mksafefunc { my $x = new Safe; $x->permit_only(':default');$x->permit(':base_math');"
  		"$x->share(qw[&elog &DEBUG &NOTICE &NOIND &ERROR]);"
  		" return $x->reval(qq[sub { $_[0] }]); }"
  		};
#4Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Travis Bauer (#3)
Re: PlPerl.c patch

Thanks. Applied. (Tom already approved it.)

Attached.

Tom Lane (tgl@sss.pgh.pa.us) wrote:

Travis Bauer <trbauer@indiana.edu> writes:

I have attached a simple change to src/pl/plperl/plperl.c to
enable the :bash_math opcodes. Currently plperl.c only
enables the :default opcodes. This leave out about five of six
math functions including sqrt().

This seems like a reasonable change, but could we trouble you to
submit it in diff -c format? Without the context it's way too
error-prone to apply.

regards, tom lane

--
----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------

[ Attachment, skipping... ]

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026