Bug 2041975 - restorecon ENOENT policy error is unclear
Summary: restorecon ENOENT policy error is unclear
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: policycoreutils
Version: 9.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Petr Lautrbach
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-18 16:18 UTC by Milos Malik
Modified: 2022-05-17 16:13 UTC (History)
7 users (show)

Fixed In Version: policycoreutils-3.3-5.el9
Doc Type: No Doc Update
Doc Text:
Clone Of: 1926511
Environment:
Last Closed: 2022-05-17 15:50:30 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-108493 0 None None None 2022-01-18 16:27:00 UTC
Red Hat Product Errata RHBA-2022:3920 0 None None None 2022-05-17 15:50:41 UTC

Description Milos Malik 2022-01-18 16:18:25 UTC
+++ This bug was initially created as a clone of Bug #1926511 +++

Description of problem:
When I do not have selinux-policy-targeted installed and I still have "SELINUXTYPE=targeted" configured in /etc/selinux/config, restorecon will return hard-to-understand ENOENT error messages.

Version-Release number of selected component (if applicable):
policycoreutils-3.3-2.el9.x86_64

How reproducible:
always

Steps to Reproduce:
1. Uninstall selinux-policy-targeted and install selinux-policy-minimum
2. Ensure /etc/selinux/config has "SELINUXTYPE=targeted" (the WRONG policy)
3. touch /tmp/foo.txt
4. restorecon -v /tmp/foo.txt

Actual results:
restorecon fails with a mysterious error message "No such file or directory". Users are confused because /tmp/foo.txt does exist.

Expected results:
restorecon shows the user the exact path that corresponds to the fatal ENOENT error message. It's not /tmp/foo.txt, but it's something under /etc/selinux/targeted/.

Comment 9 errata-xmlrpc 2022-05-17 15:50:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: policycoreutils), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:3920


Note You need to log in before you can comment on or make changes to this bug.