diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index 49ce8375a4..4adbf6bb0a 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -145,14 +145,17 @@ A+ /path-or-glob/to/append/acls/recursively - - - - POSIX Configuration File Format - The configuration format is one line per path containing - type, path, mode, ownership, age, and argument fields: + The configuration format is one line per path, containing type, path, mode, ownership, age, and + argument fields. The lines are separated by newlines, the fields by whitespace: - #Type Path Mode User Group Age Argument + #Type Path Mode User Group Age Argument… d /run/user 0755 root root 10d - L /tmp/foobar - - - - /dev/null - Fields may be enclosed within quotes and contain C-style escapes. + Fields may contain C-style escapes. With the exception of the seventh field (the "argument") all + fields may be enclosed in quotes. Note that any whitespace found in the line after the beginning of the + argument field will be considered part of the argument field. To begin the argument field with a + whitespace character, use C-style escapes (e.g. \x20). Type diff --git a/src/basic/extract-word.c b/src/basic/extract-word.c index 76b3fe12e3..4104dac9a7 100644 --- a/src/basic/extract-word.c +++ b/src/basic/extract-word.c @@ -20,11 +20,10 @@ int extract_first_word(const char **p, char **ret, const char *separators, ExtractFlags flags) { _cleanup_free_ char *s = NULL; size_t allocated = 0, sz = 0; - char c; - int r; - char quote = 0; /* 0 or ' or " */ bool backslash = false; /* whether we've just seen a backslash */ + char c; + int r; assert(p); assert(ret); @@ -71,7 +70,7 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra if (c == 0) { if ((flags & EXTRACT_CUNESCAPE_RELAX) && - (!quote || flags & EXTRACT_RELAX)) { + (quote == 0 || flags & EXTRACT_RELAX)) { /* If we find an unquoted trailing backslash and we're in * EXTRACT_CUNESCAPE_RELAX mode, keep it verbatim in the * output. @@ -116,7 +115,7 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra backslash = false; - } else if (quote) { /* inside either single or double quotes */ + } else if (quote != 0) { /* inside either single or double quotes */ for (;; (*p)++, c = **p) { if (c == 0) { if (flags & EXTRACT_RELAX) diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 4ebdaddb5b..955cf00ce4 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -60,6 +60,7 @@ #include "string-table.h" #include "string-util.h" #include "strv.h" +#include "terminal-util.h" #include "umask-util.h" #include "user-util.h" @@ -2995,8 +2996,8 @@ static int help(void) { if (r < 0) return log_oom(); - printf("%s [OPTIONS...] [CONFIGURATION FILE...]\n\n" - "Creates, deletes and cleans up volatile and temporary files and directories.\n\n" + printf("%s [OPTIONS...] [CONFIGURATION FILE...]\n" + "\n%sCreates, deletes and cleans up volatile and temporary files and directories.%s\n\n" " -h --help Show this help\n" " --user Execute user configuration\n" " --version Show package version\n" @@ -3014,6 +3015,7 @@ static int help(void) { " --no-pager Do not pipe output into a pager\n" "\nSee the %s for details.\n" , program_invocation_short_name + , ansi_highlight(), ansi_normal() , link ); diff --git a/test/units/testsuite-22.10.sh b/test/units/testsuite-22.10.sh new file mode 100755 index 0000000000..5ec297fbf8 --- /dev/null +++ b/test/units/testsuite-22.10.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -e +set -x +set -o pipefail + +systemd-tmpfiles --create - <