From c8e8ea4b2eb297ddbe1d3cbe46364311704110f7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 5 Apr 2022 06:57:22 -0400 Subject: [PATCH] import policycoreutils-3.3-6.el9_0 --- .policycoreutils.metadata | 2 +- ...Improve-error-message-when-selabel_o.patch | 41 +++++++++++++++++++ SPECS/policycoreutils.spec | 9 +++- 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 SOURCES/0026-policycoreutils-Improve-error-message-when-selabel_o.patch diff --git a/.policycoreutils.metadata b/.policycoreutils.metadata index 6638542..8eb80fb 100644 --- a/.policycoreutils.metadata +++ b/.policycoreutils.metadata @@ -1,6 +1,6 @@ e0c82a8693936806c4289f865712ba0e8fc94f91 SOURCES/gui-po.tgz c8279f87160e2ff16eb775287d529e5c49b19ae3 SOURCES/policycoreutils-po.tgz -606f854b945f4deae897770692707013b753b277 SOURCES/python-po.tgz +bca6372bd3e5b63e2b64ce4bf62a7b5934d933af SOURCES/python-po.tgz 413495010fcab556e8ea9f226c67557a23cc1498 SOURCES/sandbox-po.tgz cdde8ef04ac354b2499fd2822acbd11fc27843c8 SOURCES/selinux-3.3.tar.gz d849fa76cc3ef4a26047d8a69fef3a55d2f3097f SOURCES/sepolicy-icons.tgz diff --git a/SOURCES/0026-policycoreutils-Improve-error-message-when-selabel_o.patch b/SOURCES/0026-policycoreutils-Improve-error-message-when-selabel_o.patch new file mode 100644 index 0000000..46617fe --- /dev/null +++ b/SOURCES/0026-policycoreutils-Improve-error-message-when-selabel_o.patch @@ -0,0 +1,41 @@ +From d83caa39d7ff497bddabb54619a8985227ad1264 Mon Sep 17 00:00:00 2001 +From: Vit Mojzis +Date: Mon, 10 Jan 2022 18:35:27 +0100 +Subject: [PATCH] policycoreutils: Improve error message when selabel_open + fails + +When selabel_open fails to locate file_context files and +selabel_opt_path is not specified (e.g. when the policy type is +missconfigured in /etc/selinux/config), perror only prints +"No such file or directory". +This can be confusing in case of "restorecon" since it's +not apparent that the issue is in policy store. + +Before: + \# restorecon -v /tmp/foo.txt + No such file or directory +After: + \# restorecon -v /tmp/foo.txt + /etc/selinux/yolo/contexts/files/file_contexts: No such file or directory + +Signed-off-by: Vit Mojzis +--- + policycoreutils/setfiles/restore.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/policycoreutils/setfiles/restore.c b/policycoreutils/setfiles/restore.c +index 74d48bb3752d..e9ae33ad039a 100644 +--- a/policycoreutils/setfiles/restore.c ++++ b/policycoreutils/setfiles/restore.c +@@ -29,7 +29,7 @@ void restore_init(struct restore_opts *opts) + + opts->hnd = selabel_open(SELABEL_CTX_FILE, selinux_opts, 3); + if (!opts->hnd) { +- perror(opts->selabel_opt_path); ++ perror(opts->selabel_opt_path ? opts->selabel_opt_path : selinux_file_context_path()); + exit(1); + } + +-- +2.35.1 + diff --git a/SPECS/policycoreutils.spec b/SPECS/policycoreutils.spec index a965d36..36f041a 100644 --- a/SPECS/policycoreutils.spec +++ b/SPECS/policycoreutils.spec @@ -11,7 +11,7 @@ Summary: SELinux policy core utilities Name: policycoreutils Version: 3.3 -Release: 4.2%{?dist} +Release: 6%{?dist} License: GPLv2 # https://github.com/SELinuxProject/selinux/wiki/Releases Source0: https://github.com/SELinuxProject/selinux/releases/download/3.3/selinux-3.3.tar.gz @@ -56,6 +56,7 @@ Patch0022: 0022-semodule-Don-t-forget-to-munmap-data.patch Patch0023: 0023-semodule-libsemanage-move-module-hashing-into-libsem.patch Patch0024: 0024-semodule-add-command-line-option-to-detect-module-ch.patch Patch0025: 0025-policycoreutils-fixfiles-Use-parallel-relabeling.patch +Patch0026: 0026-policycoreutils-Improve-error-message-when-selabel_o.patch # Patch list end Obsoletes: policycoreutils < 2.0.61-2 @@ -482,9 +483,15 @@ The policycoreutils-restorecond package contains the restorecond service. %systemd_postun_with_restart restorecond.service %changelog +* Fri Mar 04 2022 Vit Mojzis - 3.3-6 +- Update translations (#2017376) + * Tue Feb 15 2022 Petr Lautrbach - 3.3-4.2 - semodule: add command-line option to detect module changes +* Tue Feb 22 2022 Petr Lautrbach - 3.3-5 +- Improve error message when selabel_open fails + * Mon Feb 14 2022 Petr Lautrbach - 3.3-3 - fixfiles: Use parallel relabeling