pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: C function - other process
Date: Fri, 22 Apr 2005 14:36:30 -0600
Message-ID: <20050422203629.GA94052@winnie.fuhr.org> (raw)
In-Reply-To: <12489.1114200468@sss.pgh.pa.us>
References: <20050422211800.241cf201@localhost>
	<12255.1114198795@sss.pgh.pa.us>
	<20050422200150.GA93845@winnie.fuhr.org>
	<12489.1114200468@sss.pgh.pa.us>

On Fri, Apr 22, 2005 at 04:07:48PM -0400, Tom Lane wrote:
> 
> Execing some new program is safe enough, although you might wish to
> explicitly close the various sockets the backend holds to make sure
> the new program doesn't maliciously scribble on them.

Is there a way to find out which fds to close, or should a function
just close everything from, say, 3 to <some value> (assuming that
0, 1, and 2 are stdin, stdout, and stderr)?  I could think of
non-portable ways like looking under /proc/<pid>/fd, but I was
wondering if the backend keeps track of its fds somewhere.

Thanks.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



view thread (5+ messages)

Message-ID: <20050422203629.GA94052@winnie.fuhr.org>
Permalink:  ../20050422203629.GA94052@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050422203629.GA94052@winnie.fuhr.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, tgl@sss.pgh.pa.us
  Subject: Re: C function - other process
  In-Reply-To: <20050422203629.GA94052@winnie.fuhr.org>

* 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