leapp-repository/SOURCES/0014-selinux-do-not-run-semodule-when-no-modules-are-sele.patch
eabdullin b1bd6e77a6 Import from CS git
(cherry picked from commit 5bdc5cf293)
2025-05-15 11:55:21 +03:00

41 lines
2.4 KiB
Diff

From 474b26cbcadc804ff50935a87ca78379999960d4 Mon Sep 17 00:00:00 2001
From: Vit Mojzis <vmojzis@redhat.com>
Date: Tue, 4 Mar 2025 11:49:05 +0100
Subject: [PATCH 14/37] selinux: do not run "semodule" when no modules are
selected
Fixes:
2025-03-04 11:21:31.550 DEBUG PID: 679 leapp.workflow.Applications.selinuxapplycustom: External command has finished: ['semodule', '-lfull']
2025-03-04 11:21:31.551 INFO PID: 679 leapp.workflow.Applications.selinuxapplycustom: Processing custom SELinux policy modules. Count: 1.
2025-03-04 11:21:31.551 INFO PID: 679 leapp.workflow.Applications.selinuxapplycustom: Skipping module permissive_rhcd_t on priority 400 because it is already installed.
2025-03-04 11:21:31.551 DEBUG PID: 679 leapp.workflow.Applications.selinuxapplycustom: External command has started: ['semodule']
2025-03-04 11:21:31.555 DEBUG PID: 679 leapp.workflow.Applications.selinuxapplycustom: At least one mode must be specified.
2025-03-04 11:21:31.555 DEBUG PID: 679 leapp.workflow.Applications.selinuxapplycustom: usage: semodule [option]... MODE...
2025-03-04 11:21:31.555 DEBUG PID: 679 leapp.workflow.Applications.selinuxapplycustom: Manage SELinux policy modules.
2025-03-04 11:21:31.556 DEBUG PID: 679 leapp.workflow.Applications.selinuxapplycustom: MODES:
2025-03-04 11:21:31.556 DEBUG PID: 679 leapp.workflow.Applications.selinuxapplycustom: -R, --reload reload policy
...
2025-03-04 11:21:31.564 WARNING PID: 679 leapp.workflow.Applications.selinuxapplycustom: Error installing modules in a single transaction:At least one mode must be specified.
---
.../common/actors/selinux/selinuxapplycustom/actor.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
index 55c64c3e..4856f36a 100644
--- a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
+++ b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
@@ -92,6 +92,10 @@ class SELinuxApplyCustom(Actor):
command.extend(['-X', str(module.priority), '-i', cil_filename])
+ if command == ['semodule']:
+ # no modules selected for installation
+ continue
+
try:
run(command)
except CalledProcessError as e:
--
2.49.0