tmpfiles: add the ~ modifier, an argument in Base64

In tmpfiles.d(5) a ~ after the type of an f, F, or w entry means the
argument is Base64, for content that cannot be written on a line:

    f~ /root/.ssh/authorized_keys 0600 root root - c3NoLWVkMjU1MTkg...

tmpfiles ignores the ~ and writes the argument as it is.

Decode the argument.  As in systemd it is not looked at for specifiers
or escapes, and an entry with an argument that is not Base64 is
skipped.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-21 17:14:02 +01:00
1 parent ed96814fdc
commit 09dcf91877
4 files changed
+77 -10

No files matched your search

+2
View File
@@ -32,6 +32,8 @@ All relevant changes are documented in this file.
points to exists, the same as Finit's own `l` entry
- tmpfiles: the path of an entry can now be quoted and have backslash
escapes, for a path with a space in it: `d "/srv/my files"`
- tmpfiles: add the `~` modifier for `f`, `F`, and `w` entries, as in
`f~`, where the argument is Base64, for a file with binary content
- tmpfiles: add `--prefix=PATH`, to only run the entries for paths below
it. `--prefix` and `--exclude-prefix` match whole path components,
`--exclude-prefix=/dev` no longer skips `/devices`
+4 -4
View File
@@ -13,10 +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) 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
* Modifier `=` (remove what is of another type). `-` (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
2. Command line