From: Sławek Kapłoński Date: Fri, 11 Nov 2016 09:17:38 +0000 (+0100) Subject: Forbid new-line char in name of new storagepool X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ae381879f3d7d2d3ae6c80ef7de5dfd74eb10f6f;p=libvirt.git Forbid new-line char in name of new storagepool New line character in name of storagepool is now forbidden because it mess virsh output and can be confusing for users. Validation of name is done in driver, after parsing XML to avoid problems with dissappeared pools which was already created with new-line char in name. Signed-off-by: Michal Privoznik --- diff --git a/docs/news.html.in b/docs/news.html.in index aa4fd418e7..56c03b35c8 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -38,6 +38,8 @@ diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 4f990f4c48..9900596572 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -780,6 +780,9 @@ storagePoolDefineXML(virConnectPtr conn, if (!(def = virStoragePoolDefParseString(xml))) goto cleanup; + if (virXMLCheckIllegalChars("name", def->name, "\n") < 0) + goto cleanup; + if (virStoragePoolDefineXMLEnsureACL(conn, def) < 0) goto cleanup;