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 1496243 - /usr/lib/tmpfiles.d/svnserve.conf fights with RPM package over mode of /run/svnserve
Summary: /usr/lib/tmpfiles.d/svnserve.conf fights with RPM package over mode of /run/s...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subversion
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Joe Orton
QA Contact: Leos Pol
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-26 18:39 UTC by James Ralston
Modified: 2021-06-10 13:08 UTC (History)
0 users

Fixed In Version: subversion-1.7.14-13.el7
Doc Type: Bug Fix
Doc Text:
Cause: The /run/svnserve directory was packaged with different permissions to those specified in the tmpfiles configuration. Consequence: Consequently, "rpm --verify subversion" would fail after each boot. Fix: The permissions of /run/svserve have been changed to 0700, to match the tmpfiles configuration. Result: As a result, "rpm --verify subversion" should now succeed after each boot.
Clone Of:
Environment:
Last Closed: 2018-04-10 17:31:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
change subversion.spec file to package /run/svnserve as mode 0700 (356 bytes, patch)
2017-09-26 19:37 UTC, James Ralston
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0938 0 None None None 2018-04-10 17:32:10 UTC

Description James Ralston 2017-09-26 18:39:57 UTC
Description of problem:

The subversion RPM package packages the /run/svnserve directory as user root, group root, mode 0755:

$ rpm -qlv subversion | grep /run/svnserve
drwxr-xr-x    2 root    root                        0 Aug  9 09:35 /run/svnserv

Because on RHEL7 the /run directory is tmpfs and therefore /run/svnserve will disappear at every reboot, the subversion package contributes a /usr/lib/tmpfiles.d/svnserve.conf file that contains:

$ cat /usr/lib/tmpfiles.d/svnserve.conf
D /run/svnserve 0700 root root -

Therefore, systemd-tmpfiles creates /run/svnserve with a mode that disagrees with the RPM package:

$ rpm --verify subversion
.M.......    /run/svnserve

Thus, the Subversion packaging is broken, and should be corrected.

This might not seem like a big deal, but on hosts that are required to comply with the United States Government Defense Information Systems Agency (DISA) Security Technical Implementation Guides (STIGs), when a package's on-disk contents differs in owners, groups, or file modes from what the package database asserts is correct, that is a Category I finding (the most severe finding).

Version-Release number of selected component (if applicable):

subversion-1.7.14-11.el7_4.x86_64

How reproducible:

Running the following commands will demonstrate the problem:

$ yum erase subversion
$ rm -rf /run/svnserve
$ yum install subversion
$ rpm --verify subversion; echo EOF
EOF
$ systemd-tmpfiles --create
$ rpm --verify subversion; echo EOF
.M.......    /run/svnserve
EOF

Actual results:

After systemd-tmpfiles --create runs, it changes the permissions of the /run/svnserve directory to disagree with the subversion RPM package, which rpm --verify will then flag.

Expected results:

systemd-tmpfiles --create should create /run/svnserve with attributes (owner, group, mode) that match the RPM package.

Additional info:

I think the correct thing to do here is to modify the subversion RPM package's SPEC file to package /run/svnserve mode 0700, instead of changing /usr/lib/tmpfiles.d/svnserve.conf to create /run/svnserve as mode 0755.

Because systemd-tmpfiles is already enforcing mode 0700, this would represent no change to the installed subversion package; it would merely align the RPM packaging with the state of the installed package.

Comment 2 Joe Orton 2017-09-26 19:16:57 UTC
Thanks for the report James.  This was fixed in Fedora already, and will be simple to merge.  If this affecting you in production, please file a support request so we can prioritise appropriately.

Comment 3 James Ralston 2017-09-26 19:37:01 UTC
Created attachment 1331224 [details]
change subversion.spec file to package /run/svnserve as mode 0700

Here's literally a one-line patch to the subversion.spec file to package /run/svnserve as mode 0700.

Comment 4 James Ralston 2017-09-26 19:50:50 UTC
(In reply to Joe Orton from comment #2)
> Thanks for the report James.  This was fixed in Fedora already, and will be
> simple to merge.  If this affecting you in production, please file a support
> request so we can prioritise appropriately.

Thanks; I filed a support request for escalation of this BZ.

Since Fedora also chose to resolve the inconsistency to mode 0700, we'll roll our own subversion package for our RHEL7 hosts with my patch until the official fix appears for RHEL7. (Hopefully that doesn't have to wait for 7.5)

Comment 8 Leos Pol 2018-01-23 15:08:49 UTC
$ rpm -q subversion
subversion-1.7.14-11.el7_4.x86_64
$ reboot
$ rpm -V subversion
.M.......    /run/svnserve
$ stat /run/svnserve
  File: ‘/run/svnserve’
  Size: 40        	Blocks: 0          IO Block: 4096   directory
Device: 14h/20d	Inode: 12860       Links: 2
Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:svnserve_var_run_t:s0
Access: 2018-01-23 10:04:04.277000000 -0500
Modify: 2018-01-23 10:04:04.277000000 -0500
Change: 2018-01-23 10:04:04.277000000 -0500
 Birth: -

$ rpm -q subversion
subversion-1.7.14-14.el7.x86_64
$ reboot
$ rpm -V subversion
$ stat /run/svnserve
  File: ‘/run/svnserve’
  Size: 40        	Blocks: 0          IO Block: 4096   directory
Device: 14h/20d	Inode: 12817       Links: 2
Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:svnserve_var_run_t:s0
Access: 2018-01-23 10:04:05.189000000 -0500
Modify: 2018-01-23 10:04:05.189000000 -0500
Change: 2018-01-23 10:04:05.189000000 -0500
 Birth: -

Comment 11 errata-xmlrpc 2018-04-10 17:31:32 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/RHEA-2018:0938


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