tmpfiles: write all of the argument to every match of a w entry

A w entry with a glob wrote its whole argument to the first path
only.  The rest got it up to the first backslash:

    w /sys/class/net/eth*/queues/rx-0/rps_cpus - - - - f\n

write_arg() put a NUL in the argument at each escape as it went, so
the second call saw a shorter string.

Leave the argument as it is.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-20 19:10:02 +01:00
1 parent 3ff5c33217
commit af10d09762
4 files changed
+13 -4

No files matched your search

+1 -1
View File
@@ -252,7 +252,7 @@ static void write_arg(FILE *fp, char *arg)
while (*arg && (p = strchr(arg, '\\'))) {
fwrite(arg, sizeof(char), p - arg, fp);
*p++ = 0;
p++;
switch (*p) {
case '\\':
fputc('\\', fp);