]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: drop remaining checks for apparmor version
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 31 Mar 2025 10:43:33 +0000 (11:43 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 1 Apr 2025 11:28:29 +0000 (12:28 +0100)
Now that we mandate version 3, any remaining conditional checks
in meson/source code can be removed.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
meson.build
src/security/apparmor/meson.build
src/security/virt-aa-helper.c

index f8742338f89a5a6f3a7a4de9f196ff7527c53c8b..bf4a245dd352285d6806086303a97bb58aee5005 100644 (file)
@@ -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
index 18968677df7deedae6aa569433546fa5fa681218..09d9fac02c201c7e376bd04338460e08000d710c 100644 (file)
@@ -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
index 034c0420073b89ea254e52ef324f28e416a5d2f7..e3802c18beba039e5887fef5ba5c67756c9ecef2 100644 (file)
@@ -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<libvirt/%s.files>\n", ifexists, ctl->uuid);
+            g_autofree char *tmp = g_strdup_printf(
+                "  #include if exists <libvirt/%s.files>\n", ctl->uuid);
 
             if (ctl->dryrun) {
                 vah_info(profile);