Re: [PATCH] conf: sanitize tap and vhost paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22.09.2014 16:34, Martin Kletzander wrote:
Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
  src/conf/domain_conf.c | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index bb4a4cb..9cc118c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7065,8 +7065,15 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
                  if (virNetDevVlanParse(cur, ctxt, &def->vlan) < 0)
                      goto error;
              } else if (xmlStrEqual(cur->name, BAD_CAST "backend")) {
-                def->backend.tap = virXMLPropString(cur, "tap");
-                def->backend.vhost = virXMLPropString(cur, "vhost");
+                char *tmp = NULL;
+
+                if ((tmp = virXMLPropString(cur, "tap")))
+                    def->backend.tap = virFileSanitizePath(tmp);
+                VIR_FREE(tmp);
+
+                if ((tmp = virXMLPropString(cur, "vhost")))
+                    def->backend.vhost = virFileSanitizePath(tmp);
+                VIR_FREE(tmp);
              }
          }
          cur = cur->next;


ACK. Although I've identified more places that need fixing, e.g. rom in virDomainDeviceInfoParseXML(). But that's not a show stopper for this one.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]