Bug 1926386 - setfiles fails on file /etc/.ip with ext4 immutable bit set
Summary: setfiles fails on file /etc/.ip with ext4 immutable bit set
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: policycoreutils
Version: 8.4
Hardware: All
OS: Linux
Target Milestone: rc
: 8.0
Assignee: Petr Lautrbach
QA Contact: Milos Malik
Khushbu Borole
Depends On:
TreeView+ depends on / blocked
Reported: 2021-02-08 18:54 UTC by Petr Lautrbach
Modified: 2021-05-18 15:09 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
.`setfiles` does not stop on labeling error Previously, the `setfiles` utility stopped whenever it failed to relabel a file. Consequently, mislabeled files were left in the target directory. With this update, `setfiles` skips files it cannot relabel, and as a result, `setfiles` processes all files in the target directory.
Clone Of:
Last Closed: 2021-05-18 15:09:18 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

Description Petr Lautrbach 2021-02-08 18:54:29 UTC
Either `setfiles` should not abort when it's not not able to set a new context, or it should provide an option which would on suppress aborting on labeling errors.

Simple reproducer:

$ mkdir -p r/1/1 r/1/2
$ sudo chown root: r/1/2
$ mkdir -p r/2/1 r/2/2
$ setfiles -v -r r /etc/selinux/targeted/contexts/files/file_contexts r
Relabeled r from unconfined_u:object_r:user_tmp_t:s0 to unconfined_u:object_r:root_t:s0
Relabeled r/1 from unconfined_u:object_r:user_tmp_t:s0 to unconfined_u:object_r:default_t:s0
Relabeled r/1/1 from unconfined_u:object_r:user_tmp_t:s0 to unconfined_u:object_r:default_t:s0
setfiles: Could not set context for r/1/2:  Operation not permitted

See https://bugzilla.redhat.com/show_bug.cgi?id=1794518 for more details

Comment 11 errata-xmlrpc 2021-05-18 15:09:18 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 (policycoreutils bug fix and enhancement update), and where to find the updated
files, follow the link below.

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


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