43fe83
From 1a092cd295fe4f13238d8147b1b2a0247394b0ca Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <1a092cd295fe4f13238d8147b1b2a0247394b0ca.1383321464.git.jdenemar@redhat.com>
43fe83
From: "Daniel P. Berrange" <berrange@redhat.com>
43fe83
Date: Wed, 30 Oct 2013 17:01:47 +0000
43fe83
Subject: [PATCH] Set a sane $PATH for virt-login-shell
43fe83
43fe83
For
43fe83
43fe83
  https://bugzilla.redhat.com/show_bug.cgi?id=1015247
43fe83
43fe83
The virt-login-shell binary shouldn't need to execute programs
43fe83
relying on $PATH, but just in case set a fixed $PATH value
43fe83
of /bin:/usr/bin
43fe83
43fe83
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
43fe83
(cherry picked from commit d665003da1359410bc4036895a648a7d7256ddaa)
43fe83
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
43fe83
---
43fe83
 tools/virt-login-shell.c | 2 ++
43fe83
 1 file changed, 2 insertions(+)
43fe83
43fe83
diff --git a/tools/virt-login-shell.c b/tools/virt-login-shell.c
43fe83
index c2c9947..baa6202 100644
43fe83
--- a/tools/virt-login-shell.c
43fe83
+++ b/tools/virt-login-shell.c
43fe83
@@ -208,6 +208,8 @@ main(int argc, char **argv)
43fe83
         return EXIT_FAILURE;
43fe83
     }
43fe83
 
43fe83
+    setenv("PATH", "/bin:/usr/bin", 1);
43fe83
+
43fe83
     virSetErrorFunc(NULL, NULL);
43fe83
     virSetErrorLogPriorityFunc(NULL);
43fe83
 
43fe83
-- 
43fe83
1.8.4.2
43fe83