tmpfiles: age 0 cleans everything

An entry with the age 0 was read as having no age, so nothing in its
directory was ever cleaned:

    d /var/spool/work - - - 0

    tmpfiles --clean t.conf

In tmpfiles.d(5) age 0 means everything in the directory is removed
on each clean.  parse_age() returned 0 for both.

It now returns -1 for no age and for one it cannot read, and with
age 0 the timestamps are not looked at.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-20 18:02:36 +01:00
1 parent 60cd11ab23
commit bc2f2ba4bb
3 files changed
+29 -12

No files matched your search

+3
View File
@@ -263,6 +263,9 @@ All relevant changes are documented in this file.
file or in the files after it. Such an entry is now skipped with a warning
- Fix `tmpfiles --clean` cleaning other file systems mounted below the
directory of an entry, it now stays on the file system of the directory
- Fix age `0` in a tmpfiles entry, it was read as no age. As in
tmpfiles.d(5), `tmpfiles --clean` now empties the directory of such an
entry
- Fix a lost reload for a service paused mid-reload by a condition in
flux. A second reload arriving meanwhile re-parsed the unchanged .conf
and cleared the pending mark, so the service resumed without ever being