[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: rpm leaks an fd in install/erase scripts



On Thu, Jul 31, 2003 at 07:54:29PM -0700, Frank Cusack wrote:
> On Thu, Jul 31, 2003 at 08:22:07PM -0400, Jeff Johnson wrote:
> > If you mean that sshd is carrying an open file descriptor, then there's
> > a missing FD_CLOEXEC that's missing in fdDup() on the payload
> > file descriptor. I'll take a look ...
> 
> That's what I mean.
> 
> > IMHO, sshd really needs to be fixed to close file descriptors when
> > restarted. It's not just rpm %post, and open file descriptors will
> > remain when sshd is restarted from other contexts. That can be fixed
> > most easily by closing file descriptors in sshd, not trying to fix each
> > and every context that might restart sshd.
> 
> It's not an sshd problem, it's rpm.  It's not specific to restarting
> sshd, it's starting any background process.  %post inherits an fd from
> rpm, and the bg process also inherits that fd.  If the bg process doesn't
> close all possibly open fd's, it keeps the extra fd (pipe to rpm to sshd)
> open which sshd hangs waiting on.
> 

This isn't either rpm or sshd is broke, both are.

> You are correct, sshd (and all processes claiming to be daemons) should
> run through open fd's and close them.  But that doesn't absolve rpm from
> also having a bug.
> 

I'm not asking for absolution, I'm asking for sshd to be "fixed". Almost
every daemon does the equivalent of daemonize(). Does rpm need to do
FD_CLOEXEC so that a RDONLY, positioned at EOF, file descriptor goes away.

Sure, I can/will fix in rpm.

Now go get sshd fixed too.

73 de Jeff

-- 
Jeff Johnson	ARS N3NPQ
jbj@redhat.com (jbj@jbj.org)
Chapel Hill, NC




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []