import policycoreutils-2.9-18.el8

This commit is contained in:
CentOS Sources 2022-01-19 21:23:42 +00:00 committed by Stepan Oksanichenko
parent 73a626826d
commit f186488901
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,41 @@
From 69da6239d8505a9d6ca547187f71a351df17f157 Mon Sep 17 00:00:00 2001
From: Vit Mojzis <vmojzis@redhat.com>
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 <vmojzis@redhat.com>
---
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 d3335d1a..ba2668b3 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.30.2

View File

@ -12,7 +12,7 @@
Summary: SELinux policy core utilities Summary: SELinux policy core utilities
Name: policycoreutils Name: policycoreutils
Version: 2.9 Version: 2.9
Release: 17%{?dist} Release: 18%{?dist}
License: GPLv2 License: GPLv2
# https://github.com/SELinuxProject/selinux/wiki/Releases # https://github.com/SELinuxProject/selinux/wiki/Releases
Source0: https://github.com/SELinuxProject/selinux/releases/download/20190315/policycoreutils-2.9.tar.gz Source0: https://github.com/SELinuxProject/selinux/releases/download/20190315/policycoreutils-2.9.tar.gz
@ -81,6 +81,7 @@ Patch0040: 0040-policycoreutils-setfiles-do-not-restrict-checks-agai.patch
Patch0041: 0041-semodule-add-m-checksum-option.patch Patch0041: 0041-semodule-add-m-checksum-option.patch
Patch0042: 0042-semodule-Fix-lang_ext-column-index.patch Patch0042: 0042-semodule-Fix-lang_ext-column-index.patch
Patch0043: 0043-semodule-Don-t-forget-to-munmap-data.patch Patch0043: 0043-semodule-Don-t-forget-to-munmap-data.patch
Patch0044: 0044-policycoreutils-Improve-error-message-when-selabel_o.patch
Obsoletes: policycoreutils < 2.0.61-2 Obsoletes: policycoreutils < 2.0.61-2
Conflicts: filesystem < 3, selinux-policy-base < 3.13.1-138 Conflicts: filesystem < 3, selinux-policy-base < 3.13.1-138
@ -520,6 +521,9 @@ The policycoreutils-restorecond package contains the restorecond service.
%systemd_postun_with_restart restorecond.service %systemd_postun_with_restart restorecond.service
%changelog %changelog
* Fri Jan 14 2022 Vit Mojzis <vmojzis@redhat.com> - 2.9-18
- Improve error message when selabel_open fails (#1926511)
* Tue Nov 30 2021 Petr Lautrbach <plautrba@redhat.com> - 2.9-17 * Tue Nov 30 2021 Petr Lautrbach <plautrba@redhat.com> - 2.9-17
- semodule: add -m | --checksum option - semodule: add -m | --checksum option