From: Julio Faracco Date: Tue, 1 May 2018 15:56:09 +0000 (-0300) Subject: test: avoid slash characters to the new domain name. X-Git-Tag: v4.4.0-rc1~354 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=054a66037dc0cb9834e05b7582804fa22e04db1d;p=thirdparty%2Flibvirt.git test: avoid slash characters to the new domain name. 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 Reviewed-by: John Ferlan --- diff --git a/src/test/test_driver.c b/src/test/test_driver.c index a1888c0c9f..974369f28a 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -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;