From: Luis R. Rodriguez Date: Thu, 17 Jul 2014 23:28:15 +0000 (-0700) Subject: oxenstored: force FD_CLOEXEC with Unix.set_close_on_exec on LSB init X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4596 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5be3f335e0d0dd1e449cdd23be3c37366c114b86;p=xen.git oxenstored: force FD_CLOEXEC with Unix.set_close_on_exec on LSB init 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 Acked-by: Ian Campbell --- diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml index 0cfededb48..61321c619b 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