Quirk of the boost spirit char() fn, hyphens
are treated as range delimiters unless they're
the last character in the set.
Fixes: #15465
Signed-off-by: John Spray <john.spray@redhat.com>
quoted_path %=
lexeme[lit("\"") >> *(char_ - '"') >> '"'] |
lexeme[lit("'") >> *(char_ - '\'') >> '\''];
- unquoted_path %= +char_("a-zA-Z0-9_.-/");
+ unquoted_path %= +char_("a-zA-Z0-9_./-");
// match := [path=<path>] [uid=<uid> [gids=<gid>[,<gid>...]]
path %= (spaces >> lit("path") >> lit('=') >> (quoted_path | unquoted_path));
"allow rw uid=1 gids=1",
"allow * path=\"/foo\"",
"allow * path=/foo",
+ "allow * path=/foo-bar_baz",
"allow * path=\"/foo bar/baz\"",
"allow * uid=1",
"allow * path=\"/foo\" uid=1",