pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve White <swhite@aip.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Feature request: include script file into function body
Date: Tue, 1 Feb 2011 17:44:22 +0100
Message-ID: <20110201164422.GA3023@cashmere.aip.de> (raw)
In-Reply-To: <26900.1296576145@sss.pgh.pa.us>
References: <20110201112120.GA1327@cashmere.aip.de>
	<26900.1296576145@sss.pgh.pa.us>

Hi Tom,

This seems like a detail that is beside the point I'm making.
But security is important, so let's think about it.

PostgreSQL has an \i command, which loads the text from any readable file
interpretes and executes it as further PostgreSQL commands.  I'm proposing
a similar mechanism that would load a file containing script language, and
process it as though it were in the current funcition body.

Isn't the \i command a similar security hole?

If somehow loading script text for a function is substantially different 
from loading it by \i, and if there is some problem, it seems to me that
some simple restriction could solve it, such as restricting the directories 
from which such files can be read.  But I'm just guessing here.

I'll leave it to the security experts explicitly by amending my original
proposal with this:

        " -- without doing anything stupid that would open a security hole."

Cheers again!


On  1.02.11, Tom Lane wrote:
> Steve White <swhite@aip.de> writes:
> > It would be really nice to have a way to load script (especially Python
> > and Perl) from a separate file into a function body.
> 
> This seems like a security hole, ie, you could use it to read any file
> the backend has access to.
> 
> 			regards, tom lane
> 

-- 
| -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
| Steve White                                             +49(331)7499-202
| E-Science                                        Zi. 27  Villa Turbulenz 
| -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
| Astrophysikalisches Institut Potsdam (AIP)
| An der Sternwarte 16, D-14482 Potsdam
|
| Vorstand: Prof. Dr. Matthias Steinmetz, Peter A. Stolz
|
| Stiftung privaten Rechts, Stiftungsverzeichnis Brandenburg: III/7-71-026
| -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -



view thread (33+ messages)  latest in thread

Message-ID: <20110201164422.GA3023@cashmere.aip.de>
Permalink:  ../20110201164422.GA3023@cashmere.aip.de/
Also on:    postgresql.org/message-id/20110201164422.GA3023@cashmere.aip.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: swhite@aip.de, tgl@sss.pgh.pa.us
  Subject: Re: Feature request: include script file into function body
  In-Reply-To: <20110201164422.GA3023@cashmere.aip.de>
  References: <20110201112120.GA1327@cashmere.aip.de> <26900.1296576145@sss.pgh.pa.us> <20110201164422.GA3023@cashmere.aip.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox