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

[libvirt] [PATCH] Don't fail if SELinux is diabled



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


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