File Fix-showing-the-local-inactive-profile-in-json-mode.patch of Package apparmor.15509

From da07cdf79c5643878712e5a6e0fb6d7aadf71c61 Mon Sep 17 00:00:00 2001
From: Christian Boltz <>
Date: Wed, 6 May 2020 23:20:07 +0200
Subject: [PATCH] Fix showing the local inactive profile in json mode

When aa-genprof proposes a local inactive profile, it had a hardcoded
call to 'less' to display that profile.

Unsurprisingly, this doesn't work in JSON mode and breaks YaST (luckily
it's only a case of "the button doesn't work").

(cherry picked from commit 68a258b0064d98c376631fa27904a5be1a2e0044)
(cherry picked from commit cb95e9a2568b19e2e7601c0af363e0605a6889d9)

diff --git a/utils/apparmor/ b/utils/apparmor/
index 3b5ad68f..92be3592 100644
--- a/utils/apparmor/
+++ b/utils/apparmor/
@@ -559,8 +559,7 @@ def get_profile(prof_name):
         p = profile_hash[options[arg]]
         q.selected = options.index(options[arg])
         if ans == 'CMD_VIEW_PROFILE':
-            pager = get_pager()
-  [pager, orig_filename])
+            aaui.UI_ShowFile(uname, orig_filename)
         elif ans == 'CMD_USE_PROFILE':
             if p['profile_type'] == 'INACTIVE_LOCAL':
                 profile_data = p['profile_data']
openSUSE Build Service is sponsored by