]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
test: avoid slash characters to the new domain name.
authorJulio Faracco <jcfaracco@gmail.com>
Tue, 1 May 2018 15:56:09 +0000 (12:56 -0300)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 3 May 2018 15:25:01 +0000 (11:25 -0400)
As QEMU driver, test driver does not accept slashes inside domain names.
This commit fixes this problem checking slashes inside the new name when
'domrename' is executed.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/test/test_driver.c

index a1888c0c9fe5a79f416cf12170610dfc6dbac939..974369f28a1d0e1dfededba6866f114bb821ffd6 100644 (file)
@@ -2638,6 +2638,12 @@ testDomainRenameCallback(virDomainObjPtr privdom,
 
     virCheckFlags(0, -1);
 
+    if (strchr(new_name, '/')) {
+        virReportError(VIR_ERR_XML_ERROR,
+                       _("name %s cannot contain '/'"), new_name);
+        return -1;
+    }
+
     if (VIR_STRDUP(new_dom_name, new_name) < 0)
         goto cleanup;