[PATCH 2/3] util: allow retrieving ethtool features when unprivileged

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

 



The only reason that the ethtool features weren't being retrieved in
an unprivileged libvirtd was because they required ioctl(), and the
ioctl was using an AF_PACKET socket, which requires root. Now that we
are using AF_UNIX for ioctl(), this restriction can be removed.
---
 src/util/virnetdev.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index b0159b2..0d19432 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -2980,12 +2980,6 @@ virNetDevGetFeatures(const char *ifname,
     if (!(*out = virBitmapNew(VIR_NET_DEV_FEAT_LAST)))
         return -1;
 
-    /* Only fetch features if we're privileged, but no need to fail */
-    if (geteuid() != 0) {
-        VIR_DEBUG("ETHTOOL feature bits not available in session mode");
-        return 0;
-    }
-
     /* Ultimately uses AF_PACKET for socket which requires privileged
      * daemon support.
      */
-- 
2.9.3

--
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]
  Powered by Linux