[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] oxenstored: force FD_CLOEXEC with Unix.set_close_on_exec on LSB init



commit 5be3f335e0d0dd1e449cdd23be3c37366c114b86
Author:     Luis R. Rodriguez <mcgrof@xxxxxxxx>
AuthorDate: Thu Jul 17 16:28:15 2014 -0700
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Thu Jul 24 16:23:20 2014 +0100

    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@xxxxxxxxxxxxx>
    Cc: Anil Madhavapeddy <anil@xxxxxxxxxx>
    Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
    Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Cc: Vincent Hanquez <Vincent.Hanquez@xxxxxxxxxxxxx>
    Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/ocaml/xenstored/utils.ml |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index 0cfeded..61321c6 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
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.