SMP workers in trunk start without root privileges. This results in startup
failures when workers need to use a privileged port (e.g., 443) or other
root-only features such as TPROXY.
The watch_child function, responsible to watch and start squid workers for
the squid monitor process, called after a enter_suid() call, but the
writePidFile() call, inside the watch_child(), will leave suid mode before exit.
This patch add enter_suid() cals after the writePidFile and removePidFile()
inside the watch_child() function.
This is a Measurement Factory project
}
writePidFile();
+ enter_suid(); // writePidFile() uses leave_suid()
#if defined(_SQUID_LINUX_THREADS_)
squid_signal(SIGQUIT, rotate_logs, 0);
enter_suid();
removePidFile();
+ enter_suid(); // removePidFile() uses leave_suid()
if (TheKids.someSignaled(SIGINT) || TheKids.someSignaled(SIGTERM)) {
syslog(LOG_ALERT, "Exiting due to unexpected forced shutdown");
exit(1);