tmpfiles: skip an entry that takes its argument from a credential

A ^ after the type says the argument is the name of a credential to
read the real argument from.  Files from systemd have them:

    f^ /etc/hosts - - - - network.hosts

The ^ was not read, so on a system without /etc/hosts this made one
holding the text "network.hosts".

Finit has no credentials.  Skip the entry, which is what systemd does
when the credential is not set.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-20 19:10:04 +01:00
1 parent ddb4f18fa9
commit 81ce7a2833
4 files changed
+18 -3

No files matched your search

+7 -3
View File
@@ -13,9 +13,10 @@ files or common packages already rely on, last what few will miss.
* `C+`, which is read as `C`
* `z` and `Z` only set the SELinux label when `restorecon` is installed
* Modifiers `=` (remove what is of another type), `~` (base64
argument), and `^` (credential as argument). `-` (do not fail) has
nothing to do, tmpfiles never exits with an error for an entry
* Modifiers `=` (remove what is of another type) and `~` (base64
argument). `-` (do not fail) has nothing to do, tmpfiles never exits
with an error for an entry, and an entry with `^` (credential as
argument) is skipped, Finit has no credentials
* Quoted paths, a path with a space in it cannot be written
@@ -38,4 +39,7 @@ Missing options: `--root`, `--replace`, `--purge`, `--graceful`, and
by that age, the age is not read
* The `%T` and `%V` specifiers are always `/tmp` and `/var/tmp`, they
do not look at `$TMPDIR`
* A `w` entry truncates the file, systemd writes over the start of
what is there. It only matters for a regular file, not in `/proc`
or `/sys`
* `mksubsys()` in `src/util.c` is unused