NetworkManager/clients/cli
Thomas Haller 53aa340476 nmcli: fix wrongly adding a generic setting when constructing connection
nmc_read_connection_properties() iterates over the input arguments, and
completes the connection.

Initially, the type is not yet known, in that case, we should not wrongly
assume that this is a generic connection. Later, when the type is specified,
con_settings() will return the correct settings.

Previously, this would wrongly add a [generic] section:

  $ nmcli connection add type ethernet ifname eth1 con-name ethie autoconnect no ipv4.method auto ethernet.cloned-mac-address random

With the fix, it still works to specify the type later:

  $ nmcli connection add ifname eth1 con-name ethie autoconnect no ipv4.method auto type ethernet

but it doesn't work, to specify the type after type-specific options:

  $ nmcli connection add ifname eth1 con-name ethie autoconnect no ipv4.method auto ethernet.cloned-mac-address random type ethernet
  Error: invalid or not allowed setting 'ethernet': 'ethernet' not among [connection, ipv4, ipv6, proxy].

The patch doesn't change the latter limitation.

Fixes: c5324ed285
2017-10-26 19:07:24 +02:00
..
agent.c cli: move NmcMetaGenericInfo to "utils.h" 2017-04-05 16:53:06 +02:00
agent.h cli: add 'nmcli agent' command (bgo #739568) 2014-11-07 11:58:25 +01:00
common.c core,clients: use our own string hashing function nm_str_hash() 2017-10-18 13:05:00 +02:00
common.h build: move nm-client-utils.c to libnmc-base.a 2017-10-16 17:25:35 +02:00
connections.c nmcli: fix wrongly adding a generic setting when constructing connection 2017-10-26 19:07:24 +02:00
connections.h cli: move and rename TermColor and TermFormat 2017-04-05 16:53:06 +02:00
devices.c cli: wifi: connect with PSK when the AP supports WPA-PSK and WPA-EAP 2017-09-20 09:23:54 +02:00
devices.h cli: move and rename TermColor and TermFormat 2017-04-05 16:53:06 +02:00
general.c cli: show new enable-disable-connectivity-check permission 2017-08-17 23:09:07 +02:00
general.h cli: output a short summary of devices when called without arguments 2016-07-19 14:29:05 +02:00
nmcli-completion cli: make nmcli do its own command completion 2017-02-13 16:32:15 +01:00
nmcli.c core,clients: use our own string hashing function nm_str_hash() 2017-10-18 13:05:00 +02:00
nmcli.h cli: spawn a pager when running on a terminal 2017-05-15 17:23:51 +02:00
polkit-agent.c cli: move NmcMetaGenericInfo to "utils.h" 2017-04-05 16:53:06 +02:00
polkit-agent.h cli: add 'nmcli agent' command (bgo #739568) 2014-11-07 11:58:25 +01:00
settings.c cli: don't mark field names for translation 2017-04-23 23:45:02 +02:00
settings.h cli: move setting creation to meta data 2017-04-12 14:12:20 +02:00
utils.c cli: disable pager in editor mode 2017-06-07 11:37:23 +02:00
utils.h cli: refactor printing IP6 device info 2017-09-26 19:36:51 +02:00