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 6 of 6] CA-33440: when starting an stunnel process, c

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 6 of 6] CA-33440: when starting an stunnel process, careful to handle the case where we still do fork the binary directly i.e. that used by quicktest and the CLI
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Fri, 18 Dec 2009 20:51:18 +0000
Delivery-date: Fri, 18 Dec 2009 12:51:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1261169472@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 1261169317 0
# Node ID bd8e01f7ec1b2bea5216a9da0361d194795926c2
# Parent  c6eff72def0786b1989ada4ca79d2617c45d15b3
CA-33440: when starting an stunnel process, careful to handle the case where we 
still do fork the binary directly i.e. that used by quicktest and the CLI.

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

diff -r c6eff72def07 -r bd8e01f7ec1b stunnel/stunnel.ml
--- a/stunnel/stunnel.ml        Fri Dec 18 20:48:36 2009 +0000
+++ b/stunnel/stunnel.ml        Fri Dec 18 20:48:37 2009 +0000
@@ -150,19 +150,20 @@
           Forkhelpers.Dup2(data_in, Unix.stdout);
           Forkhelpers.Dup2(logfd, Unix.stderr) ] in
        let fds_needed = [ Unix.stdin; Unix.stdout; Unix.stderr; config_out ] in
-       let args = [ "-fd"; config_out_uuid ] in
+       let args_external = [ "-fd"; config_out_uuid ] in
+          let args_internal = [ "-fd"; string_of_int 
(Unixext.int_of_file_descr config_out) ] in
        if use_external_fd_wrapper then begin
-        let cmdline = Printf.sprintf "Using commandline: %s\n" (String.concat 
" " (path::args)) in
+        let cmdline = Printf.sprintf "Using commandline: %s\n" (String.concat 
" " (path::args_external)) in
         write_to_log cmdline;
        end;
        t.pid <-
         if use_external_fd_wrapper
-        then Forkhelpers.safe_close_and_exec (Some data_in) (Some data_in) 
(Some logfd) [(config_out_uuid, config_out)] path args
+        then Forkhelpers.safe_close_and_exec (Some data_in) (Some data_in) 
(Some logfd) [(config_out_uuid, config_out)] path args_external
         else Forkhelpers.fork_and_exec ~pre_exec:
                          (fun _ -> 
                            List.iter Forkhelpers.do_fd_operation fdops;
                            Unixext.close_all_fds_except fds_needed) 
-                         (path::args);
+                         (path::args_internal);
        List.iter close [ data_in; config_out; ]; 
        (* Make sure we close config_in eventually *)
        finally
1 file changed, 5 insertions(+), 4 deletions(-)
stunnel/stunnel.ml |    9 +++++----


Attachment: xen-api-libs.hg-6.patch
Description: Text Data

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