From: Eric Blake Date: Tue, 22 Mar 2011 22:39:01 +0000 (-0600) Subject: command: reject pidfile on non-daemon X-Git-Tag: CVE-2011-1486~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee691d84333a67fe914c05a928adb4c9d3b3deca;p=thirdparty%2Flibvirt.git command: reject pidfile on non-daemon * src/util/command.c (virCommandRunAsync): Since virExec only creates pidfiles for daemon, enforce this in virCommand. --- diff --git a/src/util/command.c b/src/util/command.c index 22f350b656..a33d3339cf 100644 --- a/src/util/command.c +++ b/src/util/command.c @@ -1146,7 +1146,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]);