NetworkManager/clients/common
Thomas Haller 3ced486f41
libnm/match: extend syntax for match patterns with '|', '&', '!' and '\\'
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 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.

This change is mostly backward compatible, except for existing matches
that started with one of the special characters '|', '&', '!', and '\\'.

(cherry picked from commit 824ad6275d)
2020-06-26 13:33:41 +02:00
..
tests cli/tests: add unit test for nmc_utils_parse_passwd_file() 2020-05-13 10:28:05 +02:00
meson.build docs: move "nm-settings-docs-{dbus,nmcli}.xml" from "libnm/" to "man/" 2020-06-11 10:53:50 +02:00
nm-client-utils.c cli: show differnt text for state of externally connected devices 2020-06-10 19:45:47 +02:00
nm-client-utils.h cli: show differnt text for state of externally connected devices 2020-06-10 19:45:47 +02:00
nm-meta-setting-access.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-meta-setting-access.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-meta-setting-desc.c all: add "path" property to the match setting 2020-06-12 16:04:06 +02:00
nm-meta-setting-desc.h cli: show external connection in different color 2020-06-10 19:45:46 +02:00
nm-polkit-listener.c cli/polkit: add missing variable initialization in retrieve_session_id_cb() 2020-05-07 10:01:52 +02:00
nm-polkit-listener.h cli/polkit: rename NM_POLKIT_LISTENER_SIGNAL_REQUEST signal to "request-sync" 2020-04-10 10:44:52 +02:00
nm-secret-agent-simple.c clients/trivial: rename VpnPasswordName struct to have NM prefix 2020-04-29 16:18:31 +02:00
nm-secret-agent-simple.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-vpn-helpers.c cli: support dns-search for import of WireGuard profiles 2020-05-19 18:05:55 +02:00
nm-vpn-helpers.h clients/trivial: rename VpnPasswordName struct to have NM prefix 2020-04-29 16:18:31 +02:00
qrcodegen.c cli: add "nmcli d wifi show" 2019-10-18 17:38:57 +02:00
qrcodegen.h cli: add "nmcli d wifi show" 2019-10-18 17:38:57 +02:00
settings-docs.h.in libnm/match: extend syntax for match patterns with '|', '&', '!' and '\\' 2020-06-26 13:33:41 +02:00
settings-docs.xsl cli: fix marking settings docs for translation 2017-04-23 23:45:02 +02:00