Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 Aug 2013 01:24:45 +0900 (JST)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        pjd@FreeBSD.org
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r252603 - head/usr.sbin/rwhod
Message-ID:  <20130804.012445.1330578101731029775.hrs@allbsd.org>
In-Reply-To: <201307032104.r63L4KEE015937@svn.freebsd.org>
References:  <201307032104.r63L4KEE015937@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart(Sun_Aug__4_01_24_45_2013_098)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Pawel Jakub Dawidek <pjd@FreeBSD.org> wrote
  in <201307032104.r63L4KEE015937@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@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.

-- Hiroki

----Security_Multipart(Sun_Aug__4_01_24_45_2013_098)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (FreeBSD)

iEYEABECAAYFAlH9Ls0ACgkQTyzT2CeTzy3zhQCgyqLDaLEevKuT+U4a7LLsubl1
GXIAn1hB/cOIFW8nx3+dvEKH5Ppj6zc0
=0G45
-----END PGP SIGNATURE-----

----Security_Multipart(Sun_Aug__4_01_24_45_2013_098)----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130804.012445.1330578101731029775.hrs>