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

Re: fixing debconf stdin bug



On Sat, Jan 10, 2004 at 11:50:45PM -0200, Henrique de Moraes Holschuh wrote:

> On Sat, 10 Jan 2004, Blars Blarson wrote:
> > Joey Hess beleives that this patch will cause problems for postinst
> > scripts that don't do db_stop before starting a daemon.  There appear
> 
> Any "daemon" that does NOT close all fds on startup is buggy (unless it is
> in debug mode, or it is not a normal daemon to begin with).
> 
> Unfortunately, the only way AFAIK to do so is to do a { for all descriptors
> in (insert arbitrary range here, I use 255): close it ignoring errors }
> loop.  Icky at best :(

for(int i = 0; i < sysconf(_SC_OPEN_MAX) - 1; ++i)
  close(i);

-- 
 - mdz



Reply to: