pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Sandro Santilli <strk@keybit.net>
Cc: pgsql-bugs@postgresql.org
Cc: peter_e@gmx.net
Subject: Re: cache lookup failed from empty plpythonu function
Date: Fri, 25 Jan 2013 22:00:27 +0100
Message-ID: <20130125210026.GA24655@awork2.anarazel.de> (raw)
In-Reply-To: <5594.1359146446@sss.pgh.pa.us>
References: <20130124140336.GJ3157@gnash>
	<20130124141751.GB21296@awork2.anarazel.de>
	<19721.1359045633@sss.pgh.pa.us>
	<20130125132025.GD4289@awork2.anarazel.de>
	<1566.1359143499@sss.pgh.pa.us>
	<20130125200751.GA27601@awork2.anarazel.de>
	<20130125203501.GB27601@awork2.anarazel.de>
	<5594.1359146446@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2013-01-25 15:40:46 -0500, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > quite possibly doesn't work if copied from here but for quicker viewing:
> 
> > CREATE OR REPLACE FUNCTION "foo():
> > 	pass
> 
> > import os
> > os._exit(1)
> > def "() RETURNS void LANGUAGE plpythonu AS $$pass$$;
> 
> > Yep:
> > LOG:  server process (PID 29317) exited with exit code 1
> 
> Ooops.  Good thing plpython is already superuser-only, or this would be
> a security problem.  So should we stop including the SQL function name
> in the python name?

I don't think it's worth it and having something recognizable in there
is useful in (python) backtraces.
I am pretty sure I could do the same in the function source with some
trickery even without the function being executed just because python
also executes stuff during parsing, so I don't think it would buy
enough.
We probably should care about it if there were a trusted plpython (so
you couldn't cause an incomplete function being called or whatever) but
I don't see that happening anytime soon.

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (15+ messages)  latest in thread

Message-ID: <20130125210026.GA24655@awork2.anarazel.de>
Permalink:  ../20130125210026.GA24655@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20130125210026.GA24655@awork2.anarazel.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: andres@2ndquadrant.com, tgl@sss.pgh.pa.us, strk@keybit.net, peter_e@gmx.net
  Subject: Re: cache lookup failed from empty plpythonu function
  In-Reply-To: <20130125210026.GA24655@awork2.anarazel.de>
  References: <20130124140336.GJ3157@gnash> <20130124141751.GB21296@awork2.anarazel.de> <19721.1359045633@sss.pgh.pa.us> <20130125132025.GD4289@awork2.anarazel.de> <1566.1359143499@sss.pgh.pa.us> <20130125200751.GA27601@awork2.anarazel.de> <20130125203501.GB27601@awork2.anarazel.de> <5594.1359146446@sss.pgh.pa.us> <20130125210026.GA24655@awork2.anarazel.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