From: Daniel P. Berrangé Date: Mon, 31 Mar 2025 10:43:33 +0000 (+0100) Subject: meson: drop remaining checks for apparmor version X-Git-Tag: v11.3.0-rc1~102 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ed5673ebf040a0f9dd97bb63869b57a2d5172d5;p=thirdparty%2Flibvirt.git meson: drop remaining checks for apparmor version Now that we mandate version 3, any remaining conditional checks in meson/source code can be removed. Reviewed-by: Pavel Hrdina Signed-off-by: Daniel P. Berrangé --- diff --git a/meson.build b/meson.build index f8742338f8..bf4a245dd3 100644 --- a/meson.build +++ b/meson.build @@ -931,7 +931,6 @@ apparmor_dep = dependency('libapparmor', version: '>=' + apparmor_version, required: get_option('apparmor')) if apparmor_dep.found() conf.set('WITH_APPARMOR', 1) - conf.set('WITH_APPARMOR_3', 1) conf.set_quoted('APPARMOR_DIR', sysconfdir / 'apparmor.d') conf.set_quoted('APPARMOR_PROFILES_PATH', '/sys/kernel/security/apparmor/profiles') endif diff --git a/src/security/apparmor/meson.build b/src/security/apparmor/meson.build index 18968677df..09d9fac02c 100644 --- a/src/security/apparmor/meson.build +++ b/src/security/apparmor/meson.build @@ -33,14 +33,3 @@ install_data( [ 'TEMPLATE.qemu', 'TEMPLATE.lxc' ], install_dir: apparmor_dir / 'libvirt', ) - -if not conf.has('WITH_APPARMOR_3') - # We only install the empty local override for AppArmor 2.x. For - # AppArmor 3.x, upstream's preference is to avoid creating these - # files in order to limit the amount of filesystem clutter. - install_data( - 'usr.lib.libvirt.virt-aa-helper.local', - install_dir: apparmor_dir / 'local', - rename: 'usr.lib.libvirt.virt-aa-helper', - ) -endif diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 034c042007..e3802c18be 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1560,13 +1560,8 @@ main(int argc, char **argv) /* create the profile from TEMPLATE */ if (ctl->cmd == 'c' || purged) { - g_autofree char *tmp = NULL; -#if defined(WITH_APPARMOR_3) - const char *ifexists = "if exists "; -#else - const char *ifexists = ""; -#endif - tmp = g_strdup_printf(" #include %s\n", ifexists, ctl->uuid); + g_autofree char *tmp = g_strdup_printf( + " #include if exists \n", ctl->uuid); if (ctl->dryrun) { vah_info(profile);