tmpfiles: skip the space before the argument of an entry

An entry written in aligned columns got the space after the age field
as part of its argument:

    L  /tmp/null  -  -  -  -    /dev/null

This made a link to "   /dev/null".  Only the first separator after
the age was dropped.  A lone "-" for no argument was also taken as is,
so an f entry with it made a file holding a dash.

Skip all the space before the argument, and read "-" as no argument.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-20 12:00:50 +01:00
1 parent f95db7e6df
commit 3bc7c83731
4 files changed
+42

No files matched your search

+5
View File
@@ -430,6 +430,11 @@ static void tmpfiles(char *line)
age = strtok(NULL, "\t ");
arg = strtok(NULL, "\n");
if (arg) {
arg += strspn(arg, "\t ");
if (!arg[0] || !strcmp(arg, "-"))
arg = NULL;
}
strc = stat(path, &st);