Re: [PATCH] untrusted plperl

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Alex Pilosov <alex(at)pilosoft(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] untrusted plperl
Date: 2001-06-18 21:40:22
Message-ID: 200106182140.f5ILeMb27573@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Patch applied. Thanks. Waiting for doc updates.

> Well, after persuading cvsup and cvs that it _is_ possible to have local
> modifiable repositories, I have a clean untrusted plperl patch to offer
> you :)
>
> Highlights:
> * There's one perl interpreter used for both trusted and untrusted
> procedures. I do think its unnecessary to keep two perl
> interpreters around. If someone can break out from trusted "Safe" perl
> mode, well, they can do what they want already. If someone disagrees, I
> can change this.
>
> * Opcode is not statically loaded anymore. Instead, we load Dynaloader,
> which then can grab Opcode (and anything else you can 'use') on its own.
>
> * Checked to work on FreeBSD 4.3 + perl 5.5.3 , OpenBSD 2.8 + perl5.6.1,
> RedHat 6.2 + perl 5.5.3
>
> * Uses ExtUtils::Embed to find what options are necessary to link with
> perl shared libraries
>
> * createlang is also updated, it can create untrusted perl using 'plperlu'
>
> * Example script (assuming you have Mail::Sendmail installed):
> create function foo() returns text as '
> use Mail::Sendmail;
>
> %mail = ( To => q(you(at)yourname(dot)com),
> From => q(me(at)here(dot)com),
> Message => "This is a very short message"
> );
> sendmail(%mail) or die $Mail::Sendmail::error;
> return "OK. Log says:\n", $Mail::Sendmail::log;
> ' language 'plperlu';
>
>
> (well, change the name in the To: line :)
>
>
> Hope someone finds that useful and maybe even merged :)
>
> -alex

Content-Description: plperlu.diff

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2001-06-18 22:15:32 Re: Doc translation
Previous Message Bruce Momjian 2001-06-18 21:32:44 Re: corrupted document in 7.1.2