]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
CA-36554: call setsid() before exec() to make sure children don't accidentally kill...
authorDavid Scott <dave.scott@eu.citrix.com>
Wed, 3 Feb 2010 22:33:21 +0000 (22:33 +0000)
committerDavid Scott <dave.scott@eu.citrix.com>
Wed, 3 Feb 2010 22:33:21 +0000 (22:33 +0000)
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
forking_executioner/child.ml

index 464e657d594c20f73e015160287108069376d2af..9ebe326a31cd7d87250bcf0874166a4179f641d2 100644 (file)
@@ -129,6 +129,9 @@ let run state comms_sock fd_sock fd_sock_path =
       (* Now let's close everything except those fds mentioned in the ids_received list *)
       Unixext.close_all_fds_except ([Unix.stdin; Unix.stdout; Unix.stderr] @ fds);
       
+         (* Distance ourselves from our parent process: *)
+         if Unix.setsid () == -1 then failwith "Unix.setsid failed";     
+
       (* And exec *)
       Unix.execve (List.hd args) (Array.of_list args) (Array.of_list state.env)
     end else begin