Skip site navigation (1) Skip section navigation (2)

Re: MD5 use in PL/Perl

From: Alex Pilosov <alex(at)pilosoft(dot)com>
To: Marc Rassbach <marc(at)milestonerdl(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: MD5 use in PL/Perl
Date: 2000-12-30 04:45:29
Message-ID: Pine.BSO.4.10.10012292336030.16350-100000@spider.pilosoft.com (view raw or flat)
Thread:
Lists: pgsql-general
On Thu, 28 Dec 2000, Marc Rassbach wrote:

> Idea 1)  A call to a shell script.    A question was asked back in 1999 if
> there was a way to use a shell script in an SQL call.....that person had
> no public responses.  Moved onto 
> Idea 2) use PL/Perl to take in the text to be hashed, and output the
> hash.  Read the docs, looked on the list for more examples......
Nice try :) Good idea, however, you should take into account two things:
a) your functions run under "use Safe" and very restricted as far as what
they could do
b) your function is _not_ a package, it is only a sub, and hence cannot
'use' anything.

A thing to try for you is: 
a) change plperl, and where it does 'require Safe;' do 'use MD5; require
Safe;', recompile, etc. 

b) change plperl and change permit_only(':default') to
permit_only(':default','require')

It MIGHT work. You might have to add more ops that MD5 code uses though...

Good luck :)
 
Actually, a thing to consider would be to have a 'untrusted' PL/perl
language in postgres with use Safe disabled, along with a 'trusted' one.
(pluntrustedperl? plunsafeperl?) Same could be done for pltcl...

Comments?


In response to

Responses

pgsql-general by date

Next:From: Tom LaneDate: 2000-12-30 05:05:50
Subject: Re: MD5 use in PL/Perl
Previous:From: Tom LaneDate: 2000-12-30 04:31:36
Subject: Re: Error opening pgaccess

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group