[PATCH 05/14] Set a sane $PATH for virt-login-shell

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 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 0196950..758d1af 100644
--- a/tools/virt-login-shell.c
+++ b/tools/virt-login-shell.c
@@ -212,6 +212,8 @@ main(int argc, char **argv)
         return EXIT_FAILURE;
     }
 
+    setenv("PATH", "/bin:/usr/bin", 1);
+
     virSetErrorFunc(NULL, NULL);
     virSetErrorLogPriorityFunc(NULL);
 
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]