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 <dave.scott@eu.citrix.com>
Cc: Anil Madhavapeddy <anil@recoil.org>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Luis R. Rodriguez authored and Ian Campbell committed 2014-07-24 16:23:20 +01:00
1 parent c9c1373347
commit 5be3f335e0
1 file changed
+1
+1
View File
@@ -78,6 +78,7 @@ let create_regular_unix_socket name =
Unixext.mkdir_rec (Filename.dirname name) 0o700; Unixext.mkdir_rec (Filename.dirname name) 0o700;
let sockaddr = Unix.ADDR_UNIX(name) in let sockaddr = Unix.ADDR_UNIX(name) in
let sock = Unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0 in let sock = Unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0 in
Unix.set_close_on_exec sock;
Unix.bind sock sockaddr; Unix.bind sock sockaddr;
Unix.listen sock 1; Unix.listen sock 1;
sock sock
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.