tmpfiles: skip an entry with a relative path

An entry with a path like tmp/file was run on the directory tmpfiles
happened to be started in.  tmpfiles.d(5) only has absolute paths, and
systemd skips such a line.  Do the same, with a warning.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-21 19:23:48 +01:00
1 parent ce5a08e866
commit 4bec72fcf2
4 files changed
+12 -4

No files matched your search

+3 -1
View File
@@ -95,13 +95,15 @@ f '/tmp/arg/single quote' - - - - single
f /tmp/arg/mid"dle sp"ace - - - - middle
f /tmp/arg/esc\x41\sped - - - - "kept as is"
f "/tmp/arg/open - - - - quote
f tmp/arg/relative - - - - path
CONF
run "/libexec/finit/tmpfiles --create $CONF"
run "cd /; /libexec/finit/tmpfiles --create $CONF"
assert "Double quotes" "$(texec cat "$DIR/with space")" = "double"
assert "Single quotes" "$(texec cat "$DIR/single quote")" = "single"
assert "Quotes in path" "$(texec cat "$DIR/middle space")" = "middle"
assert "Escapes in path" "$(texec cat "$DIR/escA ped")" = '"kept as is"'
assert "Skipped with a quote left open" "$(texec sh -c "ls $DIR | grep -c open")" = "0"
assert "Skipped when not absolute" "$(texec sh -c "ls $DIR | grep -c relative")" = "0"
sep
say 'With ~ the argument is Base64'