Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
A tmpfiles.d entry of the form
R! /foo/.*
appears to be interpreted by systemd-tmpfiles as something similar to
R! /
destroying the filesystem.
Version-Release number of selected component (if applicable):
219-30.el7_3.7
How reproducible:
Consistently reproducible.
Steps to Reproduce:
1. Create the directory /foo.
2. In /etc/tmpfiles.d create the file foo.conf containing the one line
R! /foo/.*
3. Reboot.
4. Wait several minutes; the system won't come up to the user login stage.
5. Reboot a second time.
Actual results:
Grub reports that it can't find /grub2/i386-pc/normal.mod and drops into rescue mode. The filesystem appears to be destroyed.
Expected results:
dot files and directories in /foo/ are (recursively) removed.
Additional info:
None.
The problem here is, that tmpfiles did exactly what you asked then to do.
For glob /foo/.* it will also match /foo/.. which is /.
But I agree that this behavior is kinda dangerous and should be changed.
I had forgotten about '..'. Thanks for enlightening me. The behavior is kinda dangerous, but entirely consistent. At the very least, this experience gave me the opportunity to put my dump/restore strategy to the test, during which I came across a bug while restoring a level 1 dump, but that's for another bug report.
Thank you for your responses.
(In reply to Jan Synacek from comment #6)
> Merged upstream.
My original patch was merged, but it does solve only a small part of the issue. Much better solution is being implemented in https://github.com/systemd/systemd/pull/5809/.
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:3245
Description of problem: A tmpfiles.d entry of the form R! /foo/.* appears to be interpreted by systemd-tmpfiles as something similar to R! / destroying the filesystem. Version-Release number of selected component (if applicable): 219-30.el7_3.7 How reproducible: Consistently reproducible. Steps to Reproduce: 1. Create the directory /foo. 2. In /etc/tmpfiles.d create the file foo.conf containing the one line R! /foo/.* 3. Reboot. 4. Wait several minutes; the system won't come up to the user login stage. 5. Reboot a second time. Actual results: Grub reports that it can't find /grub2/i386-pc/normal.mod and drops into rescue mode. The filesystem appears to be destroyed. Expected results: dot files and directories in /foo/ are (recursively) removed. Additional info: None.