RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1512639 - setsebool -P changes file mode of /etc/selinux/targeted/active/users_extra from installation value
Summary: setsebool -P changes file mode of /etc/selinux/targeted/active/users_extra fr...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libsemanage
Version: 7.4
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Vit Mojzis
QA Contact: Jan Zarsky
URL:
Whiteboard:
: 1561022 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-13 18:24 UTC by Skip Wyatt
Modified: 2022-03-13 14:32 UTC (History)
13 users (show)

Fixed In Version: libsemanage-2.5-12.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 09:35:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1512014 1 None None None 2024-03-25 15:01:51 UTC
Red Hat Knowledge Base (Solution) 3251591 0 None None None 2017-11-26 16:07:15 UTC
Red Hat Product Errata RHBA-2018:3088 0 None None None 2018-10-30 09:36:06 UTC

Internal Links: 1512014

Description Skip Wyatt 2017-11-13 18:24:29 UTC
Description of problem:
setsebool -P changes file mode of /etc/selinux/targeted/active/users_extra from installation value

Version-Release number of selected component (if applicable):
RHEL 7.4
selinux-policy-targeted-3.13.1-166.el7_4.4.noarch

How reproducible:
Consistent 

Steps to Reproduce:
1. Install system, note that file mode of /etc/selinux/targeted/active/users_extra is 0600 
2. setsebool -P mozilla_plugin_can_network_connect 1
3. New file mode is 0644

Actual results:
File mode changes.

Expected results:
File mode should not change

Additional info:
This will trigger permissions drift and a STIG finding.

Comment 7 Petr Lautrbach 2018-03-05 17:21:22 UTC
It looks like it came with this patch https://github.com/SELinuxProject/selinux/commit/8702a865e08b5660561e194a83e4a363061edc03 which provided some optimization when for setting booleans.

The problem is that it uses for users_extra and seusers default file-mode which is 644. "file-mode" can be changed in /etc/selinux/semanage.conf (file-mode=0600) But it would have a side effect that some of other files would not be readable for users, e.g. matchpathcon would stop work for regular uses.


The patch seems to be just to change from sh->conf->file_mode to 0

--- a/libsemanage/src/direct_api.c
+++ b/libsemanage/src/direct_api.c
@@ -1447,7 +1447,7 @@ rebuild:
                        retval = semanage_copy_file(path,
                                                    semanage_path(SEMANAGE_TMP,
                                                                  SEMANAGE_STORE_SEUSERS),
-                                                   sh->conf->file_mode);
+                                                   0);
                        if (retval < 0)
                                goto cleanup;
                        pseusers->dtable->drop_cache(pseusers->dbase);
@@ -1460,7 +1460,7 @@ rebuild:
                        retval = semanage_copy_file(path,
                                                    semanage_path(SEMANAGE_TMP,
                                                                  SEMANAGE_USERS_EXTRA),
-                                                   sh->conf->file_mode);
+                                                   0);
                        if (retval < 0)
                                goto cleanup;
                        pusers_extra->dtable->drop_cache(pusers_extra->dbase);

Comment 8 Lon Hohberger 2018-03-27 13:54:38 UTC
*** Bug 1561022 has been marked as a duplicate of this bug. ***

Comment 14 errata-xmlrpc 2018-10-30 09:35:42 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, 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-2018:3088


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