]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Ignore storage volumes with control codes in their names
authorJán Tomko <jtomko@redhat.com>
Tue, 14 Apr 2015 10:30:55 +0000 (12:30 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 15 Apr 2015 17:26:31 +0000 (19:26 +0200)
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 <jtomko@redhat.com>
src/storage/storage_backend_fs.c

index 0f8ceee5498c61f7f472023f41131eec5886df12..10a8f3345b83f28c02e8d292de59dd1e4883c308 100644 (file)
@@ -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;