NetworkManager/src
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
..
devices core: move matching of kernel command line to separate function 2020-06-26 13:33:41 +02:00
dhcp systemd: merge branch systemd into master 2020-06-13 17:08:22 +02:00
dns dns: fix handling of trust-ad option 2020-04-21 10:50:12 +02:00
dnsmasq license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
initrd initrd: set ipv6.method=auto when the autoconfiguration field is 'none' 2020-06-24 14:54:50 +02:00
ndisc Revert "IPv6 SLAAC: Clamp received PIO and RIO Lifetime Values" 2020-06-15 08:00:54 +02:00
platform platform: add nm_platform_link_get_path() 2020-06-12 16:04:06 +02:00
ppp license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
settings settings: fix assertion when updating default wired connection 2020-06-22 09:55:04 +02:00
supplicant supplicant: fix memory leak 2020-06-18 17:53:19 +02:00
systemd systemd: merge branch systemd into master 2020-06-13 17:08:22 +02:00
tests libnm/match: extend syntax for match patterns with '|', '&', '!' and '\\' 2020-06-26 13:33:41 +02:00
vpn vpn: cleanup loop in nm_vpn_connection_ip6_config_get() 2020-04-28 09:41:37 +02:00
main-utils.c all: use nm_clear_g_free() instead of g_clear_pointer() 2020-03-23 11:05:34 +01:00
main-utils.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
main.c config: print config warnings during NetworkManager --print-config 2019-12-11 11:52:05 +01:00
meson.build meson: merge branch 'inigomartinez/meson-license' 2020-03-28 12:45:19 +01:00
NetworkManagerUtils.c tc: add support for tbf qdisc 2020-06-08 15:31:42 +02:00
NetworkManagerUtils.h move tc parsing out of nm-device.c 2020-06-08 15:31:41 +02:00
nm-act-request.c shared: move nm-dbus-auth-subject to shared/nm-libnm-core-intern 2019-12-24 10:13:51 +01:00
nm-act-request.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-active-connection.c core: add "external" flag for active connections of external devices 2020-06-10 19:45:46 +02:00
nm-active-connection.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-audit-manager.c shared: nm-auth-subject: add unix-session type 2019-12-24 10:13:51 +01:00
nm-audit-manager.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-auth-manager.c auth-manager: watch PolicyKit name owner to emit changed signal when name owner appears 2020-04-21 12:19:43 +02:00
nm-auth-manager.h shared: move nm-dbus-auth-subject to shared/nm-libnm-core-intern 2019-12-24 10:13:51 +01:00
nm-auth-utils.c auth: track NMAuthChain data in array instead of CList 2020-04-28 18:35:59 +02:00
nm-auth-utils.h auth: natively support GCancellable in NMAuthChain 2020-04-28 18:35:59 +02:00
nm-checkpoint-manager.c all: use nm_dbus_path_not_empty() 2019-11-07 11:34:36 +01:00
nm-checkpoint-manager.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-checkpoint.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
nm-checkpoint.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-config-data.c config: use NM_STR_HAS_PREFIX_WITH_MORE() instead of duplicate implementation 2020-05-07 14:08:33 +02:00
nm-config-data.h config: add nm_config_data_get_warnings() to get additional warnings about wrong configuration 2019-12-11 11:52:05 +01:00
nm-config.c shared: support stripping whitespace from nm_utils_buf_utf8safe_unescape() 2020-05-13 10:28:04 +02:00
nm-config.h config: avoid lgtm.com warning about int bitfield for NMConfigDeviceStateData.nm_owned 2020-05-07 13:58:09 +02:00
nm-connectivity.c shared: drop _STATIC variant of macros that define functions 2020-02-13 17:17:07 +01:00
nm-connectivity.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-core-utils.c libnm/match: extend syntax for match patterns with '|', '&', '!' and '\\' 2020-06-26 13:33:41 +02:00
nm-core-utils.h core: move matching of kernel command line to separate function 2020-06-26 13:33:41 +02:00
nm-dbus-manager.c bus-manager/dhcp: don't log pointer values directly 2020-04-30 11:44:07 +02:00
nm-dbus-manager.h shared: move nm-dbus-auth-subject to shared/nm-libnm-core-intern 2019-12-24 10:13:51 +01:00
nm-dbus-object.c all: use nm_clear_g_free() instead of g_clear_pointer() 2020-03-23 11:05:34 +01:00
nm-dbus-object.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dbus-utils.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dbus-utils.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dcb.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dcb.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-config.c core: add common base class NMDhcpConfig for NMDhcp[46]Config and merge them 2020-02-21 15:59:44 +01:00
nm-dhcp-config.h core: add common base class NMDhcpConfig for NMDhcp[46]Config and merge them 2020-02-21 15:59:44 +01:00
nm-dispatcher.c device: merge nm_device_get_dhcp[46]_config() to nm_device_get_dhcp_config() 2020-02-21 15:59:44 +01:00
nm-dispatcher.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-firewall-manager.c all: add nm_utils_error_is_cancelled() and nm_utils_error_is_cancelled_or_disposing() 2020-02-10 19:11:50 +01:00
nm-firewall-manager.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-hostname-manager.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-hostname-manager.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-iface-helper.c dhcp: add support for MUD URL (RFC 8520) 2020-04-24 10:07:38 +02:00
nm-ip4-config.c wireguard: don't let explicit gateway override WireGuard's peer route 2020-04-22 11:36:51 +02:00
nm-ip4-config.h wireguard: don't let explicit gateway override WireGuard's peer route 2020-04-22 11:36:51 +02:00
nm-ip6-config.c wireguard: don't let explicit gateway override WireGuard's peer route 2020-04-22 11:36:51 +02:00
nm-ip6-config.h core: add NMIPConfigFlags for NMIPConfig flags 2020-04-22 10:52:59 +02:00
nm-keep-alive.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-keep-alive.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-logging.c all: use nm_clear_g_free() instead of g_clear_pointer() 2020-03-23 11:05:34 +01:00
nm-logging.h core: move _LOG*() macros to "shared/nm-glib-aux/nm-logging-fwd.h" 2019-11-22 15:32:52 +01:00
nm-manager.c Revert "manager: change autoconnect-slaves logic for already active slaves" 2020-06-15 09:51:25 +02:00
nm-manager.h device: implement "auth-request" as async operation nm_manager_device_auth_request() 2020-04-28 18:35:59 +02:00
nm-netns.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-netns.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-pacrunner-manager.c all: drop explicit casts from _GET_PRIVATE() macro calls 2020-02-14 11:04:46 +01:00
nm-pacrunner-manager.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-policy.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
nm-policy.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-proxy-config.c all: use nm_clear_g_free() instead of g_clear_pointer() 2020-03-23 11:05:34 +01:00
nm-proxy-config.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-rfkill-manager.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-rfkill-manager.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-session-monitor.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
nm-session-monitor.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-sleep-monitor.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-sleep-monitor.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-test-utils-core.h libnm/keyfile: build keyfile code as separate GPL licensed internal library 2020-01-07 13:17:47 +01:00
nm-types.h device: implement "auth-request" as async operation nm_manager_device_auth_request() 2020-04-28 18:35:59 +02:00
org.freedesktop.NetworkManager.conf dbus: pretty format "org.freedesktop.NetworkManager.conf" 2020-04-15 19:17:00 +02:00