On Sun, Aug 04, 2013 at 01:24:45AM +0900, Hiroki Sato wrote:
> Pawel Jakub Dawidek <p...@freebsd.org> wrote
>   in <201307032104.r63l4kee015...@svn.freebsd.org>:
> 
> pj> Author: pjd
> pj> Date: Wed Jul  3 21:04:20 2013
> pj> New Revision: 252603
> pj> URL: http://svnweb.freebsd.org/changeset/base/252603
> pj>
> pj> Log:
> pj>   The whole sending functionality was implemented within signal handler,
> pj>   which is very bad idea. Split sending and receiving in two processes,
> pj>   which fixes this problem and will help to sandbox rwhod.
> pj>
> pj>   Submitted by:   Mariusz Zaborski <osho...@freebsd.org>
> pj>   Sponsored by:   Google Summer of Code 2013
> pj>   Reviewed by:    pjd
> pj>   MFC after:      1 month
> 
> (snip)
> 
> pj>   if (!quiet_mode) {
> pj> -         signal(SIGALRM, onalrm);
> pj> -         onalrm(0);
> pj> +         pid_child_receiver = pdfork(&fdp, 0);
> pj> +         if (pid_child_receiver == 0) {
> pj> +                 receiver_process();
> pj> +         } else if (pid_child_receiver > 0) {
> pj> +                 sender_process();
> pj> +         } else if (pid_child_receiver == -1) {
> pj> +                 syslog(LOG_ERR, "pdfork: %m");
> pj> +                 exit(1);
> pj> +         }
> 
>  pdfork() is available only when options PROCDESC is defined and
>  GENERIC does not have it.

Ah, indeed. Thanks for letting me know. I think the proper fix here is
to just add PROCDESC to GENERIC as it will be used more and more
frequently.

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://mobter.com

Attachment: pgpCy8c7X14eQ.pgp
Description: PGP signature

Reply via email to