c5b0b3
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
c5b0b3
Date: Tue, 14 Apr 2015 12:30:55 +0200
c5b0b3
Subject: [PATCH] Ignore storage volumes with control codes in their names
c5b0b3
c5b0b3
To prevent generating invalid XML.
c5b0b3
c5b0b3
https://bugzilla.redhat.com/show_bug.cgi?id=1066564
c5b0b3
(cherry picked from commit 60db2bc80fb5048b227c77c5138fe0e2c97e9c14)
c5b0b3
---
c5b0b3
 src/storage/storage_backend_fs.c | 6 ++++++
c5b0b3
 1 file changed, 6 insertions(+)
c5b0b3
c5b0b3
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
c5b0b3
index 35385db..4561ee0 100644
c5b0b3
--- a/src/storage/storage_backend_fs.c
c5b0b3
+++ b/src/storage/storage_backend_fs.c
c5b0b3
@@ -861,6 +861,12 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
c5b0b3
     while ((direrr = virDirRead(dir, &ent, pool->def->target.path)) > 0) {
c5b0b3
         int ret;
c5b0b3
 
c5b0b3
+        if (virStringHasControlChars(ent->d_name)) {
c5b0b3
+            VIR_WARN("Ignoring file with control characters under '%s'",
c5b0b3
+                     pool->def->target.path);
c5b0b3
+            continue;
c5b0b3
+        }
c5b0b3
+
c5b0b3
         if (VIR_ALLOC(vol) < 0)
c5b0b3
             goto error;
c5b0b3