Currently when Squid is started it forcibly closes all "other" filedescriptors
other than stdin/stdout/stderr. While this is a reasonable security precaution
to clean up filedescriptor leakage from the caller it crashes some SSL libraries
and possibly other functions which opens internal filedescriptors on startup or
while the configuration is parsed.
It also causes problems for daemontools or other service monitors monitoring
the daemon by keeping a unused pipe open to the daemon process.
/*
- * $Id: main.cc,v 1.398 2004/12/21 17:28:29 robertc Exp $
+ * $Id: main.cc,v 1.399 2004/12/27 16:59:14 hno Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
setMaxFD();
- if (opt_catch_signals)
- for (n = Squid_MaxFD; n > 2; n--)
- close(n);
-
/* init comm module */
comm_init();
dup2(nullfd, 2);
}
- /* Close all else */
- for (i = 3; i < Squid_MaxFD; i++)
- close(i);
-
for (;;) {
mainStartScript(argv[0]);