From 885ac290ea8742d3f156aa70a6ef18620d431e8b Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Sat, 29 Mar 2014 13:04:47 -0600 Subject: [PATCH] util: don't support loopback and nbd when setuid 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 --- src/Makefile.am | 1 - src/util/virfile.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 38b269758c..f6690b6cd7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 \ diff --git a/src/util/virfile.c b/src/util/virfile.c index fcc65b1b45..a28cbf1441 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -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 -- GitLab