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

Minor changed needed to doc on untrusted pl/perl example

From: Bob <luckyratfoot(at)gmail(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Minor changed needed to doc on untrusted pl/perl example
Date: 2005-10-21 18:06:05
Message-ID: 762e5c0510211106m12896b11t5d6ab62865620b5d@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-docs
I know this is minor but we all long for perfection.:)

The current doc shows
37.5. Trusted and Untrusted PL/Perl

Normally, PL/Perl is installed as a "trusted" programming language named
plperl. In this setup, certain Perl operations are disabled to preserve
security. In general, the operations that are restricted are those that
interact with the environment. This includes file handle operations, require,
and use (for external modules). There is no way to access internals of the
database server process or to gain OS-level access with the permissions of
the server process, as a C function can do. Thus, any unprivileged database
user may be permitted to use this language.

Here is an example of a function that will not work because file system
operations are not allowed for security reasons:

CREATE FUNCTION badfunc() RETURNS integer AS $$
    open(TEMP, ">/tmp/badfile");
    print TEMP "Gotcha!\n";
    return 1;
$$ LANGUAGE plperl;


I believe the code snippet should look like this for it to work correctly:


CREATE FUNCTION badfunc() RETURNS integer AS $$
    open(TEMP, ">/tmp/badfile");
    print TEMP "Gotcha!\n";
    close(TEMP);
    return 1;
$$ LANGUAGE plperl;

Responses

pgsql-docs by date

Next:From: Michael FuhrDate: 2005-10-21 20:51:16
Subject: Re: Minor changed needed to doc on untrusted pl/perl example
Previous:From: Oleg BartunovDate: 2005-10-21 14:40:03
Subject: Re: Multicolumn index doc out of date?

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