[PATCH] LXC: Allow to input relative path of program for lxc-enter-namespace

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

 



User execvp to replace execv, so user can use
relative path to exec programs in container.

Such as "lxc-enter-namespace domain ls"

And the user can still use absolute path to
exec programs.

Signed-off-by: Gao feng <gaofeng@xxxxxxxxxxxxxx>
---
 tools/virsh-domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 955e882..8161b23 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -7902,7 +7902,7 @@ cmdLxcEnterNamespace(vshControl *ctl, const vshCmd *cmd)
         if (virFork(&pid) < 0)
             _exit(255);
         if (pid == 0) {
-            execv(cmdargv[0], cmdargv);
+            execvp(cmdargv[0], cmdargv);
             _exit(255);
         } else {
             if (virProcessWait(pid, NULL) < 0)
-- 
1.8.1.4

--
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]