Re: plperl and the dynamic loader

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ragnar Hakonarson" <rhakonarson(at)conquestnetwork(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: plperl and the dynamic loader
Date: 2000-05-21 17:34:30
Message-ID: 9867.958930470@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Ragnar Hakonarson" <rhakonarson(at)conquestnetwork(dot)com> writes:
> Does plperl not load libraries dynamically?

> I am trying to import a .pm module from plperl and I get the following error
> message:
> creation of function failed : require trapped by operation mask at (eval 28) line 2.

Makes sense to me. plperl runs in a "safe" Perl interpreter, and if you
could load arbitrary perl code then the safety would be bypassed.

The reason for this restriction is that whatever the Perl code does will
be done with the permissions of the Postgres user (since it's running in
a Postgres-owned backend). It'd be a huge security hole if users could
invoke arbitrary Perl code in that environment. So, we only permit
"safe" operations.

If you like living dangerously you could weaken the protection to suit
your taste --- read about the Safe and Opcode perl modules, and then
twiddle the plperl source code to select whatever operator mask you
feel comfortable with.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-05-21 17:41:28 Re: No more <<EOF>>
Previous Message Tom Lane 2000-05-21 17:12:34 Re: Foreign keys breaks tables permissions