NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: misc/49738 rc.subr leaks filedescriptors
The following reply was made to PR misc/49738; it has been noted by GNATS.
From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: christos%zoulas.com@localhost (Christos Zoulas)
Cc: gnats-bugs%NetBSD.org@localhost, misc-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
netbsd-bugs%netbsd.org@localhost, mlelstv%serpens.de@localhost
Subject: Re: misc/49738 rc.subr leaks filedescriptors
Date: Fri, 21 Oct 2016 06:25:35 +0700
Date: Thu, 20 Oct 2016 11:02:12 -0400
From: christos%zoulas.com@localhost (Christos Zoulas)
Message-ID: <20161020150212.8EFD617FDAB%rebar.astron.com@localhost>
| How about:
| http://www.netbsd.org/~christos/cloexec.diff and adding:
|
| cloexec +7 +8 in /etc/rc?
It would want to include fd 9 as well ... but at the expense of adding
more non-standard baggage to NetBSD's sh, and having the rc system not
workable on any other sh, then that would work.
I believe that mostly the rc system correctly closed the fd's it opens
(which is the standard way to handle this) - but that this fails when the
rc.d/script has its oeb start function (as for example, lvm does) which
knows nothing about needing to close rc maintained (they are not from rc.subr
the Subject of this PR is incorrect) file descriptors.
An alternative would be to add a new function to the rc system for scripts
to call, to close any fd's that the rc system has opened, and then have
the relevant scripts call that function - it could be made reasonably general
to allow for other similar future issues, perhaps "rc_exec_cleanup" or
something.
kre
Home |
Main Index |
Thread Index |
Old Index