qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL for-2.5 1/3] qga: fix for default env processing for


From: Michael Roth
Subject: [Qemu-devel] [PULL for-2.5 1/3] qga: fix for default env processing for guest-exec
Date: Tue, 17 Nov 2015 17:06:51 -0600

From: Yuri Pudgorodskiy <address@hidden>

envp == NULL must be passed inside gspawn() if it was not passed with
the command line. Original code inherits environment from the QGA,
which is wrong.

Signed-off-by: Yuri Pudgorodskiy <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Michael Roth <address@hidden>
Signed-off-by: Michael Roth <address@hidden>
---
 qga/commands.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/commands.c b/qga/commands.c
index 0f80ce6..7644ca0 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -398,7 +398,7 @@ GuestExec *qmp_guest_exec(const char *path,
     arglist.next = has_arg ? arg : NULL;
 
     argv = guest_exec_get_args(&arglist, true);
-    envp = guest_exec_get_args(has_env ? env : NULL, false);
+    envp = has_env ? guest_exec_get_args(env, false) : NULL;
 
     flags = G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD;
     if (!has_output) {
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]