2019-04-12 12:41:10 +00:00
|
|
|
# vim: filetype=automake
|
|
|
|
|
2018-02-21 18:05:56 +00:00
|
|
|
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \
|
|
|
|
$(DATATYPES_SOURCES) \
|
|
|
|
security/virt-aa-helper.c \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
SECURITY_DRIVER_SOURCES = \
|
|
|
|
security/security_driver.h \
|
|
|
|
security/security_driver.c \
|
|
|
|
security/security_nop.h \
|
|
|
|
security/security_nop.c \
|
|
|
|
security/security_stack.h \
|
|
|
|
security/security_stack.c \
|
|
|
|
security/security_dac.h \
|
|
|
|
security/security_dac.c \
|
|
|
|
security/security_manager.h \
|
|
|
|
security/security_manager.c \
|
2018-08-06 10:14:41 +00:00
|
|
|
security/security_util.h \
|
|
|
|
security/security_util.c \
|
2018-02-21 18:05:56 +00:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
SECURITY_DRIVER_SELINUX_SOURCES = \
|
|
|
|
security/security_selinux.h \
|
|
|
|
security/security_selinux.c \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
SECURITY_DRIVER_APPARMOR_SOURCES = \
|
|
|
|
security/security_apparmor.h \
|
|
|
|
security/security_apparmor.c \
|
|
|
|
$(NULL)
|
|
|
|
|
2020-01-30 10:06:47 +00:00
|
|
|
SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES_IN = \
|
|
|
|
security/apparmor/usr.lib.libvirt.virt-aa-helper.in \
|
|
|
|
security/apparmor/usr.sbin.libvirtd.in \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES = \
|
|
|
|
$(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES_IN:%.in=%)
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
security/apparmor/%: $(srcdir)/security/apparmor/%.in
|
|
|
|
$(AM_V_GEN)$(MKDIR_P) `dirname $@` && \
|
|
|
|
$(SED) \
|
|
|
|
-e 's|[@]sysconfdir[@]|@sysconfdir@|' \
|
|
|
|
-e 's|[@]sbindir[@]|@sbindir@|' \
|
|
|
|
-e 's|[@]runstatedir[@]|@runstatedir@|' \
|
|
|
|
-e 's|[@]libexecdir[@]|@libexecdir@|' \
|
|
|
|
$< > $@
|
|
|
|
|
|
|
|
BUILT_SOURCES += $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES)
|
|
|
|
CLEANFILES += $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES)
|
|
|
|
|
2018-02-21 18:05:56 +00:00
|
|
|
EXTRA_DIST += \
|
|
|
|
$(SECURITY_DRIVER_SELINUX_SOURCES) \
|
|
|
|
$(SECURITY_DRIVER_APPARMOR_SOURCES) \
|
|
|
|
$(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES) \
|
2020-01-30 10:06:47 +00:00
|
|
|
$(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES_IN) \
|
2019-01-09 15:51:43 +00:00
|
|
|
security/apparmor/TEMPLATE.qemu \
|
|
|
|
security/apparmor/TEMPLATE.lxc \
|
|
|
|
security/apparmor/libvirt-qemu \
|
|
|
|
security/apparmor/libvirt-lxc \
|
2018-02-21 18:05:56 +00:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
libvirt_security_manager_la_SOURCES = $(SECURITY_DRIVER_SOURCES)
|
|
|
|
noinst_LTLIBRARIES += libvirt_security_manager.la
|
|
|
|
libvirt_la_BUILT_LIBADD += libvirt_security_manager.la
|
|
|
|
libvirt_security_manager_la_CFLAGS = \
|
|
|
|
-I$(srcdir)/conf \
|
|
|
|
$(AM_CFLAGS) \
|
|
|
|
$(NULL)
|
|
|
|
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
|
|
|
|
libvirt_security_manager_la_LIBADD =
|
|
|
|
|
|
|
|
if WITH_SECDRIVER_SELINUX
|
|
|
|
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
|
|
|
|
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
|
|
|
|
endif WITH_SECDRIVER_SELINUX
|
|
|
|
|
|
|
|
if WITH_SECDRIVER_APPARMOR
|
|
|
|
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
|
|
|
|
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
|
|
|
|
|
|
|
|
if WITH_LIBVIRTD
|
|
|
|
libexec_PROGRAMS += virt-aa-helper
|
|
|
|
|
|
|
|
virt_aa_helper_SOURCES = $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)
|
|
|
|
|
|
|
|
virt_aa_helper_LDFLAGS = \
|
|
|
|
$(AM_LDFLAGS) \
|
|
|
|
$(PIE_LDFLAGS) \
|
|
|
|
$(NULL)
|
|
|
|
virt_aa_helper_LDADD = \
|
|
|
|
libvirt.la \
|
|
|
|
libvirt_driver_storage_impl.la \
|
build: link to glib library
Add the main glib.h to internal.h so that all common code can use it.
Historically glib allowed applications to register an alternative
memory allocator, so mixing g_malloc/g_free with malloc/free was not
safe.
This was feature was dropped in 2.46.0 with:
commit 3be6ed60aa58095691bd697344765e715a327fc1
Author: Alexander Larsson <alexl@redhat.com>
Date: Sat Jun 27 18:38:42 2015 +0200
Deprecate and drop support for memory vtables
Applications are still encourged to match g_malloc/g_free, but it is no
longer a mandatory requirement for correctness, just stylistic. This is
explicitly clarified in
commit 1f24b36607bf708f037396014b2cdbc08d67b275
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Thu Sep 5 14:37:54 2019 +0100
gmem: clarify that g_malloc always uses the system allocator
Applications can still use custom allocators in general, but they must
do this by linking to a library that replaces the core malloc/free
implemenentation entirely, instead of via a glib specific call.
This means that libvirt does not need to be concerned about use of
g_malloc/g_free causing an ABI change in the public libary, and can
avoid memory copying when talking to external libraries.
This patch probes for glib, which provides the foundation layer with
a collection of data structures, helper APIs, and platform portability
logic.
Later patches will introduce linkage to gobject which provides the
object type system, built on glib, and gio which providing objects
for various interesting tasks, most notably including DBus client
and server support and portable sockets APIs, but much more too.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-29 15:12:24 +00:00
|
|
|
$(GLIB_LIBS) \
|
2018-02-21 18:05:56 +00:00
|
|
|
$(NULL)
|
|
|
|
if WITH_DTRACE_PROBES
|
|
|
|
virt_aa_helper_LDADD += libvirt_probes.lo
|
|
|
|
endif WITH_DTRACE_PROBES
|
|
|
|
virt_aa_helper_CFLAGS = \
|
|
|
|
-I$(srcdir)/conf \
|
2020-02-22 16:52:59 +00:00
|
|
|
-I$(top_srcdir)/src/hypervisor \
|
2018-02-21 18:05:56 +00:00
|
|
|
-I$(srcdir)/security \
|
|
|
|
$(AM_CFLAGS) \
|
|
|
|
$(PIE_CFLAGS) \
|
|
|
|
$(NULL)
|
|
|
|
endif WITH_LIBVIRTD
|
|
|
|
endif WITH_SECDRIVER_APPARMOR
|
2019-01-09 15:51:43 +00:00
|
|
|
|
|
|
|
if WITH_APPARMOR_PROFILES
|
|
|
|
apparmordir = $(sysconfdir)/apparmor.d/
|
|
|
|
apparmor_DATA = \
|
2020-01-30 10:06:47 +00:00
|
|
|
$(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES)
|
2019-01-09 15:51:43 +00:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
abstractionsdir = $(apparmordir)/abstractions
|
|
|
|
abstractions_DATA = \
|
|
|
|
security/apparmor/libvirt-qemu \
|
|
|
|
security/apparmor/libvirt-lxc \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
templatesdir = $(apparmordir)/libvirt
|
|
|
|
templates_DATA = \
|
|
|
|
security/apparmor/TEMPLATE.qemu \
|
|
|
|
security/apparmor/TEMPLATE.lxc \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
APPARMOR_LOCAL_DIR = "$(DESTDIR)$(apparmordir)/local"
|
2020-01-30 10:06:47 +00:00
|
|
|
install-apparmor-local: $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES)
|
2019-01-09 15:51:43 +00:00
|
|
|
$(MKDIR_P) "$(APPARMOR_LOCAL_DIR)"
|
|
|
|
echo "# Site-specific additions and overrides for \
|
|
|
|
'usr.lib.libvirt.virt-aa-helper'" \
|
|
|
|
>"$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper"
|
|
|
|
|
|
|
|
uninstall-apparmor-local:
|
|
|
|
rm -f "$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper"
|
|
|
|
rmdir "$(APPARMOR_LOCAL_DIR)" || :
|
|
|
|
|
|
|
|
INSTALL_DATA_LOCAL += install-apparmor-local
|
|
|
|
UNINSTALL_LOCAL += uninstall-apparmor-local
|
|
|
|
endif WITH_APPARMOR_PROFILES
|