Blob Blame History Raw
From 1a092cd295fe4f13238d8147b1b2a0247394b0ca Mon Sep 17 00:00:00 2001
Message-Id: <1a092cd295fe4f13238d8147b1b2a0247394b0ca.1383321464.git.jdenemar@redhat.com>
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Wed, 30 Oct 2013 17:01:47 +0000
Subject: [PATCH] Set a sane $PATH for virt-login-shell

For

  https://bugzilla.redhat.com/show_bug.cgi?id=1015247

The virt-login-shell binary shouldn't need to execute programs
relying on $PATH, but just in case set a fixed $PATH value
of /bin:/usr/bin

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit d665003da1359410bc4036895a648a7d7256ddaa)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 tools/virt-login-shell.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/virt-login-shell.c b/tools/virt-login-shell.c
index c2c9947..baa6202 100644
--- a/tools/virt-login-shell.c
+++ b/tools/virt-login-shell.c
@@ -208,6 +208,8 @@ main(int argc, char **argv)
         return EXIT_FAILURE;
     }
 
+    setenv("PATH", "/bin:/usr/bin", 1);
+
     virSetErrorFunc(NULL, NULL);
     virSetErrorLogPriorityFunc(NULL);
 
-- 
1.8.4.2