Re: (Fwd) Re: includes inside squid.conf

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 3 Apr 2002 12:17:35 +0200

On Wednesday 03 April 2002 11:43, Robert Collins wrote:

> Good point.... But don't we drop root before starting the real
> squid anyway? If so, then surely this isn't an issue.

Not fully unless you use chroot_dir. This because of silly aspects
like binding to low ports on reconfigure etc..

> If they have a really efficient fork(), then do we care? :].

Exacly. And is what all modern OS:es have except for the small detail
about temporary swap allocation (not use).

> > c) Things crash an burn if the child receives a signal between
> > vfork() and execve().
>
> Why would a child receive a signal? (Other than sigsegv or
> something similar, which will make anything crash and burn).

Who knows..

> > d) There is no directly clean way to handle a failed execve()
> > when vfork() is used.
>
> What about the return code from _exit() ? That's then seen by the
> parent in the wait() call.

except for the small detail of errno and possibly other shared data
touched by execve() when it fails. Because of this the situation in
the parent is slightly undefined upon a failed execve in the child.
In a normal "plain" application this is usually safe, but if the
application compiled with threading enabled (such as Squid often is)
then errno is not always safe to update in a vfork()..

Note: As you probably know you are not allowed to use any of the
other exec() calls in a vfork. Only execve can be used as this is the
only form where everything is prepared by the caller.

Regards
Henrik
Received on Wed Apr 03 2002 - 03:19:21 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:57 MST