tmpfiles: read quotes and escapes in the fields before the argument

There is no way to write an entry for a path with a space in it, the
fields are split at every space.  In tmpfiles.d(5) a field can be
quoted, and have C-style escapes:

    d "/srv/my files"
    d /srv/my\sfiles

Split the fields with a function that resolves both.  The argument is
still the rest of the line as it is, quotes and all, like in systemd.
An entry with a quote left open is skipped.

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

No files matched your search

-1
View File
@@ -17,7 +17,6 @@ files or common packages already rely on, last what few will miss.
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
2. Command line