[libvirt] [PATCH 3/7] Add debug for envp[] in virExecWithHook()

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

 



Some callers may have set envp[].
---

 src/util/util.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/util/util.c b/src/util/util.c
index 81b743c..e5135fc 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -601,12 +601,23 @@ virExecWithHook(virConnectPtr conn,
                 char *pidfile)
 {
     char *argv_str;
+    char *envp_str;
 
     if ((argv_str = virArgvToString(argv)) == NULL) {
         virReportOOMError(conn);
         return -1;
     }
-    DEBUG0(argv_str);
+
+    if (envp) {
+        if ((envp_str = virArgvToString(envp)) == NULL) {
+            virReportOOMError(conn);
+            return -1;
+        }
+        VIR_DEBUG("%s %s", envp_str, argv_str);
+        VIR_FREE(envp_str);
+    } else {
+        VIR_DEBUG0(argv_str);
+    }
     VIR_FREE(argv_str);
 
     return __virExec(conn, argv, envp, keepfd, retpid, infd, outfd, errfd,

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