From 5d1c041808a2496b1ff5c0914520d92982b4b37f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 14 Apr 2015 12:30:55 +0200 Subject: [PATCH] Ignore storage volumes with control codes in their names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To prevent generating invalid XML. https://bugzilla.redhat.com/show_bug.cgi?id=1066564 (cherry picked from commit 60db2bc80fb5048b227c77c5138fe0e2c97e9c14) Signed-off-by: Ján Tomko --- src/storage/storage_backend_fs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 0f8ceee549..10a8f3345b 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -863,6 +863,12 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED, while ((direrr = virDirRead(dir, &ent, pool->def->target.path)) > 0) { int ret; + if (virStringHasControlChars(ent->d_name)) { + VIR_WARN("Ignoring file with control characters under '%s'", + pool->def->target.path); + continue; + } + if (VIR_ALLOC(vol) < 0) goto error; -- GitLab