diff options
author | Thomas Haller <thaller@redhat.com> | 2018-12-11 12:35:40 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-12-11 13:58:24 +0100 |
commit | a7ef23b326f1163adbe3b573ce78d71bfb186c1f (patch) | |
tree | d4f36a48bdf6db842dbe7b55344e11b4a8e0d6be /man/NetworkManager.conf.xml | |
parent | d48904c9a90bed99eb3d7cb84fc2da016e15190b (diff) | |
download | NetworkManager-a7ef23b326f1163adbe3b573ce78d71bfb186c1f.tar.gz |
core: fix match spec behavior for a list of all "except:"
If the spec specifies only negative matches (and none of them matches),
then the result shall be positive.
Meaning:
[connection*] match-device=except:dhcp-plugin:dhclient
[connection*] match-device=except:interface-name:eth0
[.config] enabled=except:nm-version:1.14
should be the same as:
[connection*] match-device=*,except:dhcp-plugin:dhclient
[connection*] match-device=*,except:interface-name:eth0
[.config] enabled=*,except:nm-version:1.14
and match by default. Previously, such specs would never yield a
positive match, which seems wrong.
Note that "except:" already has a special meaning. It is not merely
"not:". That is because we don't support "and:" nor grouping, but all
matches are combined by an implicit "or:". With such a meaning, having
a "not:" would be unclear to define. Instead it is defined that any
"except:" match always wins and makes the entire condition to explicitly
not match. As such, it makes sense to treat a match that only consists
of "except:" matches special.
This is a change in behavior, but the alternative meaning makes
little sense.
Diffstat (limited to 'man/NetworkManager.conf.xml')
-rw-r--r-- | man/NetworkManager.conf.xml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml index 65ebe013ad..e22aa20ad1 100644 --- a/man/NetworkManager.conf.xml +++ b/man/NetworkManager.conf.xml @@ -1217,6 +1217,8 @@ enable=env:TAG1 be used to negate the match. Note that if one except-predicate matches, the entire configuration will be disabled. In other words, a except predicate always wins over other predicates. + If the setting only consists of "except:" matches and none of the + negative conditions are satisfied, the configuration is still enabled. <programlisting> # enable the configuration either when the environment variable # is present or the version is at least 1.2.0. @@ -1411,7 +1413,11 @@ enable=nm-version-min:1.3,nm-version-min:1.2.6,nm-version-min:1.0.16 <term>except:SPEC</term> <listitem><para>Negative match of a device. <literal>SPEC</literal> must be explicitly qualified with a prefix such as <literal>interface-name:</literal>. A negative match has higher priority then the positive - matches above.</para></listitem> + matches above.</para> + <para>If there is a list consisting only of negative matches, the behavior is the same as if there + is also match-all. That means, if none of all the negative matches is satisfied, the overall result is + still a positive match. That means, <literal>"except:interface-name:eth0"</literal> is the same as + <literal>"*,except:interface-name:eth0"</literal>.</para></listitem> </varlistentry> <varlistentry> <term>SPEC[,;]SPEC</term> |