[libvirt] [PATCH 3/7] netfs: Check for validity of pool source hostname

John Ferlan jferlan at redhat.com
Mon Apr 20 00:49:08 UTC 2015


Before attempting to mount the netfs pool, ensure the source pool
hostname can be resolved to something this host knows.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/storage/storage_backend_fs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index 521dc70..7f99cb1 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -408,6 +408,8 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool)
                            "%s", _("missing source path"));
             return -1;
         }
+        if (!virIsValidHostname(pool->def->source.hosts[0].name))
+            return -1;
     } else {
         if (pool->def->source.ndevice != 1) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-- 
2.1.0




More information about the libvir-list mailing list