diff options
author | Thomas Haller <thaller@redhat.com> | 2020-06-23 09:39:48 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-06-26 10:21:40 +0200 |
commit | 843d01584a8a78c506cf5b34e95e38e5d019f4d5 (patch) | |
tree | ad96191bb4f765bec5389381cc080ef6bff82e34 /src/NetworkManagerUtils.c | |
parent | 999f5920d777664dfc2827fd678a64c69f5e0b41 (diff) | |
download | NetworkManager-th/kernel-cmdline-match.tar.gz |
libnm/match: extend syntax for match patterns with '|', '&', '!' and '\\'th/kernel-cmdline-match
For simple matches like match.interface-name, match.driver, and
match.path, arguably what we had was fine. There each element
(like "eth*") is a wildcard for a single name (like "eth1").
However, for match.kernel-command-line, the elements match individual
command line options, so we should have more flexibility of whether
a parameter is optional or mandatory. Extend the syntax (in a backward
compatible manner) for that.
- the elements can now be prefixed by either '|' or '&'. This makes
optional or mandatory elements, respectively. The entire match
evaluates to true if all mandatory elements match (if any) and
at least one of the optional elements (if any).
As before, if neither '|' nor '&' is specified, then the element
is optional (that means, "foo" is the same as "|foo").
- the exclamation mark is still used to invert the match. If used
alone (like "!foo") it is a shortcut for defining a mandatory match
("&!foo").
- the backslash can now be used to escape the special characters
above. Basically, the special characters ('|', '&', '!') are
stripped from the start of the element. If what is left afterwards
is a backslash, it also gets stripped and the remainder is the
pattern. For example, "\\&foo" has the pattern "&foo" where
'&' is no longer treated specially. This special handling of
the backslash is only done at the beginning of the element (after
the optional special characters). The remaining string is part
of the pattern, where backslashes might have their own meaning.
Diffstat (limited to 'src/NetworkManagerUtils.c')
0 files changed, 0 insertions, 0 deletions