Re: Should libpq set close-on-exec flag on its socket?

From: Kevin Brown <kevin(at)sysexperts(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Should libpq set close-on-exec flag on its socket?
Date: 2004-10-21 23:28:44
Message-ID: 20041021232844.GD29476@filer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org> writes:
> > On Thu, 21 Oct 2004, Tom Lane wrote:
> >> It was suggested to me off-list that libpq should do
> >> "fcntl(fd, F_SETFD, FD_CLOEXEC)" on the socket connecting to the server.
> >> This would prevent any child program from accidentally or maliciously
> >> interfering with the connection.
>
> > Either way that the lib sets it, the client can alter the setting itself
> > by issuing a new SETFD command.
>
> That's a fair point, and certainly passing it down to the child
> intentionally wouldn't be a common case. I'll put the change in.

Since program authors who would care about this one way or another
probably won't be expecting this behavior, it should also be
documented reasonably well -- something which I'm rather sure you were
going to do anyway.

--
Kevin Brown kevin(at)sysexperts(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2004-10-21 23:48:17 Re: code question: storing INTO relation
Previous Message Marc G. Fournier 2004-10-21 23:05:46 Upcoming v8.0.0 Beta 4 ...