Re: PlPython

From: elein <elein(at)varlena(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Jacobs <jacobs(at)penguin(dot)theopalgroup(dot)com>
Cc: joconnor(at)cybermesa(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: PlPython
Date: 2003-06-30 20:34:34
Message-ID: 200306301334.34047.elein@varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


According to my testing that statement about dictionaries
is still valid.

Did you see my other note about which imports
were allowed?

I have only been able to do a tiny bit of further
testing and found that my test for zlib was wrong, it does
load and my test for module mpz was
inconclusive--there is some unidentified symbol.

I am only sure that codecs kicks out
as an untrusted module.

ERROR: plpython: Call of function `__plpython_procedure_import_test_1849240' failed.
exceptions.SystemError: Failed to load the builtin codecs: untrusted dynamic module: _codecs

I don't think this is a bug until we decide how it is supposed to work
but the documentation text does say that the whole set is
not supposed to work so that must change somehow.

elein

>Just for general knowledge, with python 2.1.1, I was able to
>import the following documented as "forbidden" modules.
>I have only used "string" so I do NOT assume that enabling
>import means that they all work. (more testing...)

> array bisect binascii calendar cmath errno
> marshal math md5 operator pcre pickle
> random re regex sha StringIO struct
> time whrandom string
>
>The following modules from the forbidden
>list caused import errors as expected:
> zlib, codecs, mpz

On Monday 30 June 2003 11:11, Tom Lane wrote:
> Kevin Jacobs <jacobs(at)penguin(dot)theopalgroup(dot)com> writes:
> > Attached is a patch that removes all of the RExec code from plpython from
> > the current PostgreSQL CVS. In addition, plpython needs to be changed to an
> > untrusted language in createlang.
>
> I'm working on the latter and cleaning up the documentation. How does
> your patch affect this statement in the plpython documentation?
>
> Each function gets its own restricted execution object in the
> Python interpreter, so that global data and function arguments from
> <function>myfunc</function> are not available to
> <function>myfunc2</function>. The exception is the data in the
> <varname>GD</varname> dictionary, as mentioned above.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>

--
=============================================================
elein(at)varlena(dot)com Database Consulting www.varlena.com
PostgreSQL General Bits http:/www.varlena.com/GeneralBits/
"Free your mind the rest will follow" -- en vogue

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-06-30 20:45:50 Re: PlPython
Previous Message Tilo Schwarz 2003-06-30 20:28:56 Re: PlPython

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2003-06-30 20:42:22 Re: [HACKERS] Missing array support
Previous Message Cuong bui 2003-06-30 20:32:58 some questions about buffer management