tmpfiles: skip any entry with an unknown user

What an unknown user in an entry did depended on the type.  A d entry
was skipped, but this one made a file owned by root:

    f /run/frr/state 0640 frr frr

The user was looked up in each type on its own, and only d checked
the result.

Look it up once for the entry, and skip the entry when the user is
not known.  An unknown group leaves the group of the path as it is,
for a new path that is the group of root, as before.  Both are only
reported with --debug, Finit's own files have entries for services
that may not be installed.

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 f5e7946489
commit a726aff30b
4 files changed
+36 -27

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 tmpfiles entries with an unknown user: `d` skipped the entry, but `f`
created the file owned by root and `e` set the group anyway. All of them
now skip the entry. An unknown group still only leaves the group as it is
- 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
-3
View File
@@ -29,9 +29,6 @@ user to call it from cron.
mode
* User and group `:name`, only when creating: looked up as the name
`:name`, which fails. For `d` the directory is then not created
* An unknown group becomes root, an unknown user makes `d` skip the
entry while `e` and `f` go on. Warn and leave the owner alone in
all of them
3. Mode and owner not applied