]> git.ipfire.org Git - thirdparty/systemd.git/commit - man/tmpfiles.d.xml
tmpfiles: use dir_cleanup() for R and D
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 7 Dec 2023 12:01:27 +0000 (13:01 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 9 Feb 2024 16:57:42 +0000 (17:57 +0100)
commitb1935cc9430dfb6a28ed9b9881c641194d1fd587
treedb4839668714e480367006e418ed832d3cafb107
parent7eeda1da90c79ba420a6d82c1d9589b23048d79f
tmpfiles: use dir_cleanup() for R and D

... i.e. apply nested config (exclusions and such) when executing R and D.

This fixes a long-standing RFE. The existing logic seems to have been an
accident of implementation. After all, if somebody specifies a config with
'R /foo; x /tmp/bar', then probably the goal is to remove stuff from under /foo,
but keep /tmp/bar. If they just wanted to nuke everything, then would not specify
the second item.

This also makes R and D use O_NOATIME, i.e. the access times of the directories
that are accessed will not be changed by the cleanup.

Obviously, we'll have to add this to NEWS and such.
Looking at the whole tmpfiles.d config in Fedora, this change has no effect.

The test cases are adjusted as appropriate. I also added another test case for
'R'/'D' with a file, just to test this code path more.

Replaces #20641.
Fixes #1633.
TODO
man/tmpfiles.d.xml
src/tmpfiles/tmpfiles.c
test/units/testsuite-22.11.sh