# HG changeset patch # User David Scott # Date 1261404220 0 # Node ID d28edd3c8bd96f4f280d2e9080c0a7dfb830f889 # Parent 3dfa078d2b22ec7f821ac2388c420d10f00d546f CA-36075: add back in a sane default $PATH for subprocesses that need it. In particular the 'EXTSR' storage backend expects to find 'pvcreate' on the path. Rather than just fixing this one instance and then seeing what else fails, this patch should prevent this class of error recurring. Note that the only place we actually pass a custom environment to a subprocess is when installing the debian etch template. Signed-off-by: David Scott diff -r 3dfa078d2b22 -r d28edd3c8bd9 stdext/forkhelpers.ml --- a/stdext/forkhelpers.ml Sat Dec 19 16:37:00 2009 +0000 +++ b/stdext/forkhelpers.ml Mon Dec 21 14:03:40 2009 +0000 @@ -20,6 +20,8 @@ (since that would cause deadlock) *) (* XXX: this is a work in progress *) + +let default_path = [ "/sbin"; "/usr/sbin"; "/bin"; "/usr/bin" ] open Pervasiveext @@ -201,7 +203,7 @@ let env = match env with | Some e -> e - | None -> [||] + | None -> [| "PATH=" ^ (String.concat ":" default_path) |] in Fecomms.write_raw_rpc sock (Fe.Setup {Fe.cmdargs=(cmd::args); env=(Array.to_list env); id_to_fd_map = id_to_fd_map});