]> xenbits.xensource.com Git - libvirt.git/commitdiff
Set a sane $PATH for virt-login-shell
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 9 Oct 2013 10:19:52 +0000 (11:19 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 21 Oct 2013 13:03:52 +0000 (14:03 +0100)
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>
tools/virt-login-shell.c

index 01969506c26e75c29d2083f495c8f9a9802498c4..758d1af17f4b79eada6e720c7fe8aed11f2be6c9 100644 (file)
@@ -212,6 +212,8 @@ main(int argc, char **argv)
         return EXIT_FAILURE;
     }
 
+    setenv("PATH", "/bin:/usr/bin", 1);
+
     virSetErrorFunc(NULL, NULL);
     virSetErrorLogPriorityFunc(NULL);