X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D12CC53913 for ; Fri, 22 Apr 2005 09:41:41 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 16452-10 for ; Fri, 22 Apr 2005 12:41:32 +0000 (GMT) Received: from is.rice.edu (is.rice.edu [128.42.42.24]) by svr1.postgresql.org (Postfix) with ESMTP id 15EB553884 for ; Fri, 22 Apr 2005 09:41:31 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by is.rice.edu (Postfix) with ESMTP id AFF184182B; Fri, 22 Apr 2005 07:41:34 -0500 (CDT) Received: from is.rice.edu ([127.0.0.1]) by localhost (it.is.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14653-01-33; Fri, 22 Apr 2005 07:41:31 -0500 (CDT) Received: by is.rice.edu (Postfix, from userid 18612) id 2A85B41822; Fri, 22 Apr 2005 07:41:31 -0500 (CDT) Date: Fri, 22 Apr 2005 07:41:30 -0500 From: Kenneth Marshall To: Keith Worthington Cc: PostgreSQL Interfaces Subject: Re: plperl user function Message-ID: <20050422124130.GB14229@it.is.rice.edu> References: <20050421194438.M68704@narrowpathinc.com> <42680480.7080805@commandprompt.com> <20050421200109.M30783@narrowpathinc.com> <42680F29.4030907@commandprompt.com> <20050422121739.M32137@narrowpathinc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050422121739.M32137@narrowpathinc.com> User-Agent: Mutt/1.4.2i X-Virus-Scanned: by amavis-2.2.1 at is.rice.edu X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200504/75 X-Sequence-Number: 5491 Keith, The untrusted language function is not neccessarily any less secure than the trusted language function. You just need to vet the function more carefully because it is allowed access to the local filesystem and other system functions. Once the function is created, only those who are given execute permission can run it. Ken On Fri, Apr 22, 2005 at 08:29:39AM -0400, Keith Worthington wrote: > > > > This leaves me with two questions. > > > 1) Why can I not use "use strict;" or "use warnings;" as they are > > > apparently good perl programming practice. I say apparently > > > because if you remember I started learning this language 3 days > > > ago and must be considered a neophyte. :-) > > > You can't use "use" instruction for security reason. All disk access > > are denied and use need a disk access. > > > > I think you need to use plperlu. > > Yes. That fixed my use problems. I am not sure I like the idea of using an > untrusted language. I wonder if it causes a potential security issue. > > > 2) What is wrong with the use of RETURN? > > According to Michael (whose email I can't access at the moment) it has to be > lowercase. I never dreamed Perl would be case sensitive but after changing > the case, voila! :-) > > > > Another question: Is there an issue with using the untrusted perl > > > language? > > > > IIRC you have to be a postgresql superuser (postgres) to execute an > > untrusted language function. > > I just tested the untrusted function using a normal user and it worked. > > > > If the code is tested and working is there any real reason to > > > continue to have "use strict;" and "use warnings;" in the function? > > > > Only for manageability in the future. > > Hmmm well I have this gut feeling that it is better to use a trusted language > than an untrusted one but I have no idea if that is supported by fact. My > inclination is that now that the function is working and tested that I should > comment out the two "use" commands and recreate the function with the trusted > version. > > Kind Regards, > Keith > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org