[PATCH] Don't fail if SELinux is diabled

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

 



but libvirt is built with --with-selinux. In this case getpeercon
returns ENOPROTOOPT so dont' return an error in that case but simply
don't set seccon.
---
 src/rpc/virnetsocket.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 39504ac..c4fd9ee 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -1171,7 +1171,7 @@ int virNetSocketGetSecurityContext(virNetSocketPtr sock,
 
     virObjectLock(sock);
     if (getpeercon(sock->fd, &seccon) < 0) {
-        if (errno == ENOSYS) {
+        if (errno == ENOSYS || errno == ENOPROTOOPT) {
             ret = 0;
             goto cleanup;
         }
-- 
1.7.10.4

--
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]