SIGCHLD may be inherited blocked

Nicolas.Williams at ubsw.com Nicolas.Williams at ubsw.com
Sat Jun 8 08:16:48 EST 2002


Looking further into this, yes, it's clear that POSIX requires
signal masks to be inherited across exec. This kinda sucks and
the standard says as much and  puts the burden of making sure
to unblock signals on the programs themselves, both parents
and children, though the emphasis appears to be on the parents
on account of many programs lacking knowledge of signal masks.

In other words, programs, such as shells, which generally
create new processes ought to ensure that signal masks are
cleared before calling exec*().

I would dare say that this applies to sshd as well and that it
does so for all signals, not just SIGCHLD.

Anyways, that is my interpretation of the text quoted below.

See: http://www.opengroup.org/onlinepubs/007904975/functions/exec.html

Specifically:

"
This volume of IEEE Std 1003.1-2001 specifies that signals set to SIG_IGN remain set to SIG_IGN, and that the process signal mask be unchanged across an exec. This is consistent with historical implementations, and it permits some useful functionality, such as the nohup command. However, it should be noted that many existing applications wrongly assume that they start with certain signals set to the default action and/or unblocked. In particular, applications written with a simpler signal model that does not include blocking of signals, such as the one in the ISO C standard, may not behave properly if invoked with some signals blocked. Therefore, it is best not to block or ignore signals across execs without explicit reason to do so, and especially not to block signals across execs of arbitrary (not closely co-operating) programs.
"

Nico
-- 
-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.




More information about the openssh-unix-dev mailing list