]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Don't fail if SELinux is diabled
authorGuido Günther <agx@sigxcpu.org>
Wed, 20 Mar 2013 19:01:18 +0000 (20:01 +0100)
committerGuido Günther <agx@sigxcpu.org>
Wed, 20 Mar 2013 20:04:57 +0000 (21:04 +0100)
but libvirt is built with --with-selinux. In this case getpeercon
returns ENOPROTOOPT so don't return an error in that case but simply
don't set seccon.

src/rpc/virnetsocket.c

index 39504ac6e9248eb6fab0ef644328de475fdd1d56..c4fd9ee98157369cd8819d8e3252c8664bdb81b1 100644 (file)
@@ -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;
         }