From ae381879f3d7d2d3ae6c80ef7de5dfd74eb10f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awek=20Kap=C5=82o=C5=84ski?= Date: Fri, 11 Nov 2016 10:17:38 +0100 Subject: [PATCH] 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 --- docs/news.html.in | 2 ++ src/storage/storage_driver.c | 3 +++ 2 files changed, 5 insertions(+) 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;