<div dir="ltr"><div>Yea, that code ...</div><div><br><div>I'm sitting on set of changes:</div><div><br></div><div>- stop kernel.c randomly discarding sigchilds (oops)</div><div>- stop the strangeness where signal handlers are installed twice; only the second is needed, the first looks like hangover from pre-event-loop days</div><div>- get this code correctly working with multiple children and multiple forks</div><div><br></div><div><div>+<span style="white-space:pre">    </span>/*</div><div>+<span style="white-space:pre">   </span> * ??? Super tricky:</div><div>+<span style="white-space:pre"> </span> * If addconn_child_pid == 0 (i.e. there is no addcon child)</div><div>+<span style="white-space:pre"> </span> * wait for any child process whose process group ID is equal to that of the calling process.</div><div>+<span style="white-space:pre">        </span> * Otherwise: wait specifically for the addconn_child_pid.</div><div>+<span style="white-space:pre">   </span> */</div></div><div><br></div><div>I don't think that was the intent (I suspect you're giving the code too much credit :-).</div><div><br></div><div>The signal handler is currently set up to fire only once and the code seems to expect it to be from addconn.</div><div><br></div><div>Now the scary bit - the reason for the fork() is so that PAM can run in a separate process.</div><div><br></div><div>While my code passes the test suite, that isn't saying much.   After the fork(),  I know I need to restore the signal table; I'm wondering what else.</div><div>(technically this is the simplistic fork() implementation, I believe SSH always two processes chatting to each other, and then has one of them forking when pam is needed)</div><div><br></div><div>Andrew</div><div><br></div><div>---------- Forwarded message ----------</div><div><div class="gmail_quote">From: <b class="gmail_sendername">D. Hugh Redelmeier</b> <span dir="ltr"><<a href="mailto:hugh@vault.libreswan.fi">hugh@vault.libreswan.fi</a>></span><br>Date: 18 October 2017 at 03:13<br>Subject: [Swan-commit] Changes to ref refs/heads/master<br>To: <a href="mailto:swan-commit@lists.libreswan.org">swan-commit@lists.libreswan.org</a><br><br><br>New commits:<br>
commit b59e3acd24b5617ee7aa623f46f65f<wbr>35addb0dab<br>
<span class="gmail-">Author: D. Hugh Redelmeier <<a href="mailto:hugh@mimosa.com">hugh@mimosa.com</a>><br>
</span>Date:   Wed Oct 18 03:11:15 2017 -0400<br>
<br>
    pluto: server.c: illuminate childhandler_cb; ditch side-effects from passert arg<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
______________________________<wbr>_________________<br>
Swan-commit mailing list<br>
<a href="mailto:Swan-commit@lists.libreswan.org">Swan-commit@lists.libreswan.<wbr>org</a><br>
<a href="https://lists.libreswan.org/mailman/listinfo/swan-commit" rel="noreferrer" target="_blank">https://lists.libreswan.org/<wbr>mailman/listinfo/swan-commit</a><br>
</div></div></div><br></div></div></div>