[libvirt PATCH 0/2] meson: AppArmor fixes

Found while updating the Debian package for libvirt to a snapshot taken from master. Possibly more to come. Andrea Bolognani (2): meson: Set WITH_APPARMOR_PROFILES meson: Don't hardcode /etc in APPARMOR_DIR meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.26.2

This variable is used in src/security/meson.build to decide whether to install the AppArmor profiles, and at the moment even when the user specifies -Dapparmor_profiles=true they don't get installed. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meson.build b/meson.build index a72d0c0e85..c10b63ba69 100644 --- a/meson.build +++ b/meson.build @@ -966,6 +966,9 @@ endif apparmor_dep = dependency('libapparmor', required: get_option('apparmor')) if apparmor_dep.found() + if get_option('apparmor_profiles') + conf.set('WITH_APPARMOR_PROFILES', 1) + endif conf.set('WITH_APPARMOR', 1) conf.set_quoted('APPARMOR_DIR', '/etc/apparmor.d') conf.set_quoted('APPARMOR_PROFILES_PATH', '/sys/kernel/security/apparmor/profiles') -- 2.26.2

src/security/apparmor/meson.build builds this path dynamically based on the value of sysconfdir, so we should do the same here or the code and the filesystem might end up disagreeing. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c10b63ba69..2846c9b9f2 100644 --- a/meson.build +++ b/meson.build @@ -970,7 +970,7 @@ if apparmor_dep.found() conf.set('WITH_APPARMOR_PROFILES', 1) endif conf.set('WITH_APPARMOR', 1) - conf.set_quoted('APPARMOR_DIR', '/etc/apparmor.d') + conf.set_quoted('APPARMOR_DIR', sysconfdir / 'apparmor.d') conf.set_quoted('APPARMOR_PROFILES_PATH', '/sys/kernel/security/apparmor/profiles') endif -- 2.26.2

On Wed, Aug 19, 2020 at 1:39 AM Andrea Bolognani <abologna@redhat.com> wrote:
Found while updating the Debian package for libvirt to a snapshot taken from master. Possibly more to come.
Andrea Bolognani (2): meson: Set WITH_APPARMOR_PROFILES meson: Don't hardcode /etc in APPARMOR_DIR
Thanks a lot for doing this work early on! Changes LGTM Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
-- 2.26.2
-- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd
participants (2)
-
Andrea Bolognani
-
Christian Ehrhardt