提交 790f912b 编写于 作者: P Peter Krempa

qemu: Reject attempts to create snapshots with names containig '/'

The snapshot name is used to create path to the definition save file.
When the name contains slashes the creation of the file fails. Reject
such names.
上级 27054e12
......@@ -11347,6 +11347,16 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
parse_flags)))
goto cleanup;
/* reject snapshot names containing slashes as snapshot definitions are
* saved in files containing the name */
if (!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA) &&
strchr(def->name, '/')) {
virReportError(VIR_ERR_XML_DETAIL,
_("invalid snapshot name '%s': name can't contain '/'"),
def->name);
goto cleanup;
}
/* reject the VIR_DOMAIN_SNAPSHOT_CREATE_LIVE flag where not supported */
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_LIVE &&
(!virDomainObjIsActive(vm) ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册