[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 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.

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.

/fc




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