]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: don't support loopback and nbd when setuid
authorEric Blake <eblake@redhat.com>
Sat, 29 Mar 2014 19:04:47 +0000 (13:04 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 1 Apr 2014 16:38:14 +0000 (10:38 -0600)
The only remaining reason that virt-login-shell was trying to
link against virstoragefile was because of a call to
virStorageFileFormatTypeToString when spawning a qemu-nbd
process - but setuid processes shouldn't be spawning qemu-nbd.

* src/util/virfile.c (virFileLoopDeviceAssociate)
(virFileNBDDeviceAssociate): Cripple in setuid builds.
* src/Makefile.am (libvirt_setuid_rpc_client_la_SOURCES):
Drop virstoragefile from the list.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/Makefile.am
src/util/virfile.c

index 38b269758c6e86139820d1abff38c355ba20117c..f6690b6cd708198cd4d643d43645a007a79c7b5e 100644 (file)
@@ -2069,7 +2069,6 @@ libvirt_setuid_rpc_client_la_SOURCES =            \
                util/virprocess.c               \
                util/virrandom.c                \
                util/virsocketaddr.c            \
-               util/virstoragefile.c           \
                util/virstring.c                \
                util/virtime.c                  \
                util/virthread.c                \
index fcc65b1b45ece9618f17d05d194a57bf844f4cea..a28cbf144190cdc40c571f4efef666c98b4b6d65 100644 (file)
@@ -540,7 +540,8 @@ int virFileUpdatePerm(const char *path,
 }
 
 
-#if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR
+#if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR && \
+    !defined(LIBVIRT_SETUID_RPC_CLIENT)
 
 # if HAVE_DECL_LOOP_CTL_GET_FREE