From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Luis R. Rodriguez" Subject: [PATCH v5 05/14] oxenstored: force FD_CLOEXEC with Unix.set_close_on_exec on LSB init Date: Tue, 20 May 2014 05:31:26 -0700 Message-ID: <1400589095-3872-6-git-send-email-mcgrof@do-not-panic.com> References: <1400589095-3872-1-git-send-email-mcgrof@do-not-panic.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WmjDD-0006Dv-RL for xen-devel@lists.xenproject.org; Tue, 20 May 2014 12:32:08 +0000 Received: by mail-pd0-f173.google.com with SMTP id v10so284138pde.4 for ; Tue, 20 May 2014 05:32:04 -0700 (PDT) In-Reply-To: <1400589095-3872-1-git-send-email-mcgrof@do-not-panic.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: David Scott , Stefano Stabellini , Vincent Hanquez , "Luis R. Rodriguez" , Anil Madhavapeddy , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org From: "Luis R. Rodriguez" Lets match the systemd active socket activation implementation and ensure that FD_CLOEXEC is set by usin Unix.set_close_on_exec. David notes oxenstored likely does not exec but there is no harm in being careful just in case things change in the future. Cc: David Scott Cc: Anil Madhavapeddy Cc: Ian Jackson Cc: Stefano Stabellini Cc: Ian Campbell Cc: Vincent Hanquez Signed-off-by: Luis R. Rodriguez --- tools/ocaml/xenstored/utils.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml index 50f05c1..b206898 100644 --- a/tools/ocaml/xenstored/utils.ml +++ b/tools/ocaml/xenstored/utils.ml @@ -78,6 +78,7 @@ let create_regular_unix_socket name = Unixext.mkdir_rec (Filename.dirname name) 0o700; let sockaddr = Unix.ADDR_UNIX(name) in let sock = Unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0 in + Unix.set_close_on_exec sock; Unix.bind sock sockaddr; Unix.listen sock 1; sock -- 2.0.0.rc3.18.g00a5b79