setroubleshoot-plugins/SOURCES/0002-plugins-Update-xen_image-plugin.patch

43 lines
1.5 KiB
Diff
Raw Normal View History

From e51acac53be8e8dea80f3a025f9cd7d5e8e910d7 Mon Sep 17 00:00:00 2001
From: Vit Mojzis <vmojzis@redhat.com>
Date: Fri, 2 Aug 2019 17:20:16 +0200
Subject: [PATCH 2/3] plugins: Update "xen_image" plugin
- use virsh_t instead of xm_t, which is now an alias
- Enable fix button
Resolves: rhbz#1649831
---
plugins/src/xen_image.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/plugins/src/xen_image.py b/plugins/src/xen_image.py
index 5dcdbab..a46798d 100644
--- a/plugins/src/xen_image.py
+++ b/plugins/src/xen_image.py
@@ -43,7 +43,7 @@ class plugin(Plugin):
You must also change the default file context files on the system in order to preserve them even on a full relabel. "semanage fcontext -a -t xen_image_t '$FIX_TARGET_PATH'"
''')
- fix_cmd = "chcon -t xen_image_t '$TARGET_PATH'"
+ fix_cmd = "/usr/bin/chcon -t xen_image_t '$TARGET_PATH'"
then_text = _("You need to change the label on '$FIX_TARGET_PATH'")
@@ -52,9 +52,11 @@ class plugin(Plugin):
def __init__(self):
Plugin.__init__(self, __name__)
+ self.fixable=True
+ self.button_text = _("Change the file label to xen_image_t.")
def analyze(self, avc):
- if (avc.matches_source_types(['xend_t', 'xm_t']) and
+ if (avc.matches_source_types(['xend_t', 'virsh_t']) and
avc.all_accesses_are_in(avc.r_file_perms + avc.r_dir_perms) and
avc.has_tclass_in(['file', 'dir']) and
avc.path_is_not_standard_directory()):
--
2.17.2