[PATCH 2/1] command: reject pidfile on non-daemon

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

 



* src/util/command.c (virCommandRunAsync): Since virExec only
creates pidfiles for daemon, enforce this in virCommand.
---
 src/util/command.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/util/command.c b/src/util/command.c
index 89f82c7..7b4337f 100644
--- a/src/util/command.c
+++ b/src/util/command.c
@@ -1172,7 +1172,11 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
                         cmd->pwd);
         return -1;
     }
-
+    if (cmd->pidfile && !(cmd->flags & VIR_EXEC_DAEMON)) {
+        virCommandError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("creation of pid file requires daemonized command"));
+        return -1;
+    }

     str = virCommandToString(cmd);
     VIR_DEBUG("About to run %s", str ? str : cmd->args[0]);
-- 
1.7.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]