From: Ján Tomko Date: Tue, 14 Apr 2015 10:30:55 +0000 (+0200) Subject: Ignore storage volumes with control codes in their names X-Git-Tag: v1.2.15-rc1~146 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60db2bc80fb5048b227c77c5138fe0e2c97e9c14;p=thirdparty%2Flibvirt.git Ignore storage volumes with control codes in their names To prevent generating invalid XML. https://bugzilla.redhat.com/show_bug.cgi?id=1066564 --- diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index d4d65bcf2e..521dc70075 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -860,6 +860,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;