svn commit: r252603 - head/usr.sbin/rwhod

Pawel Jakub Dawidek pjd at FreeBSD.org
Sat Aug 3 18:00:43 UTC 2013


On Sun, Aug 04, 2013 at 01:24:45AM +0900, Hiroki Sato wrote:
> Pawel Jakub Dawidek <pjd at FreeBSD.org> wrote
>   in <201307032104.r63L4KEE015937 at 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 <oshogbo at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20130803/a303e3d1/attachment.sig>


More information about the svn-src-head mailing list