WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 1 of 5] CA-33440: remove an instance of an unsafe direc

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 1 of 5] CA-33440: remove an instance of an unsafe direct fork/exec
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Mon, 21 Dec 2009 18:03:38 +0000
Delivery-date: Mon, 21 Dec 2009 09:59:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1261418617@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1261410030 0
# Node ID 3b43ad69a94a6ad46e996dd5b2b566d5502111af
# Parent  156116b96b363d9d2227d2583dc58a46c2e0fd7f
CA-33440: remove an instance of an unsafe direct fork/exec

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 156116b96b36 -r 3b43ad69a94a ocaml/xapi/xapi_fuse.ml
--- a/ocaml/xapi/xapi_fuse.ml   Sat Dec 19 20:19:39 2009 +0000
+++ b/ocaml/xapi/xapi_fuse.ml   Mon Dec 21 15:40:30 2009 +0000
@@ -49,9 +49,8 @@
            (fun ()->
               Thread.delay (float_of_int Xapi_globs.fuse_time);
               (* this activates firstboot script and reboots the host *)
-              Unix.execv Forkhelpers.close_and_exec
-                          [| Forkhelpers.close_and_exec; "--"; 
"/sbin/service"; "firstboot"; "activate" |];
-               ()
+                  ignore (Forkhelpers.execute_command_get_output 
"/sbin/service" [ "firstboot"; "activate" ]);
+           ()
            ) ())
 
 let light_fuse_and_reboot ?(fuse_length=Xapi_globs.fuse_time) () =
1 file changed, 2 insertions(+), 3 deletions(-)
ocaml/xapi/xapi_fuse.ml |    5 ++---


Attachment: xen-api.hg-5.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api