[libvirt] [PATCH] libvirt_setuid_rpc_client_la: Link APPARMOR libs

Michal Privoznik mprivozn at redhat.com
Tue Oct 22 10:23:38 UTC 2013


The libvirt_setuid_rpc_client_la depends on vircommand.c, in which we
are conditionally calling aa_change_profile() - an AppArmor helper
function. However, in linking the libvirt-setuid-rpc-client.la we have
forgot to link AppArmor libraries leaving us with following error:

make[3]: Entering directory `/home/zippy/work/libvirt/libvirt.git/tools'
  CCLD     virsh
  CCLD     virt-host-validate
  CCLD     virt-login-shell
../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec':
/home/zippy/work/libvirt/libvirt.git/src/util/vircommand.c:653: undefined reference to `aa_change_profile'
collect2: error: ld returned 1 exit status
make[3]: *** [virt-login-shell] Error 1
make[3]: *** Waiting for unfinished jobs....

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/Makefile.am | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 9dab4df..688c34c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2027,15 +2027,19 @@ libvirt_setuid_rpc_client_la_SOURCES = 		\
 libvirt_setuid_rpc_client_la_LDFLAGS =		\
 		$(AM_LDFLAGS)			\
 		$(LIBXML_LIBS)			\
-		$(SELINUX_LIBS)			\
-		$(NULL)
+		$(SELINUX_LIBS)
 libvirt_setuid_rpc_client_la_CFLAGS =		\
 		-DLIBVIRT_SETUID_RPC_CLIENT	\
 		-I$(top_srcdir)/src/conf	\
 		-I$(top_srcdir)/src/rpc		\
 		$(AM_CFLAGS)			\
-		$(SELINUX_CFLAGS)		\
-		$(NULL)
+		$(SELINUX_CFLAGS)
+
+if WITH_SECDRIVER_APPARMOR
+libvirt_setuid_rpc_client_la_LDFLAGS += $(APPARMOR_LIBS)
+libvirt_setuid_rpc_client_la_CFLAGS += $(APPARMOR_CFLAGS)
+endif WITH_SECDRIVER_APPARMOR
+
 endif WITH_LXC
 
 lockdriverdir = $(libdir)/libvirt/lock-driver
-- 
1.8.1.5




More information about the libvir-list mailing list