NetworkManager/libnm-core
Thomas Haller 814784aa46 libnm: fix regression serializing empty "cloned-mac-address"
For "cloned-mac-address", the empty string "" is an invalid
value that is rejected by verify().

Commit 8eed671 changed how the property is serialized to D-Bus.
Before, it was serialized using _nm_utils_hwaddr_to_dbus().
For invalid or empty addresses, this would not serialize the
value on D-Bus (or before commit 76aa6f8e0, it would create
a bogus value with no array elements).

With commit 8eed671, the cloned-mac-address gets also serialized
as "assigned-mac-address" via _nm_utils_hwaddr_cloned_data_synth(),
which would pass on invalid strings that the server would then reject.

That breaks for example nmtui. Try editing a connection with
"cloned-mac-address" set to NULL. Note, as long as you don't edit
the cloned MAC address in nmtui, you can save the modification.
Once you start modifying the entry, you can no longer set an empty
MAC address as the server now receives the invalid empty string.
Thus, the "OK" button fails with
   Unable to save connection:
   802-3-ethernet.cloned-mac-address:
   is not a valid MAC address
It also means, nmtui cannot modify the "cloned-mac-address" field to
become empty.

Fix that problem at various places by coercing "" to NULL.

Fixes: 8eed67122c

https://bugzilla.redhat.com/show_bug.cgi?id=1372799
2016-09-06 16:11:23 +02:00
..
tests team: normalize invalid configuration during load 2016-08-30 18:20:28 +02:00
crypto.c libnm-core: empty key is not a pkcs12 file 2016-04-20 10:48:59 +02:00
crypto.h all: cleanup includes in header files 2016-08-17 19:09:50 +02:00
crypto_gnutls.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
crypto_nss.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
Makefile.am libnm/vpn: add nm_vpn_plugin_info_get_auth_dialog() 2016-04-22 14:17:02 +02:00
Makefile.libnm-core shared: move shared files to subdirectory "shared/nm-utils/" 2016-06-16 10:45:53 +02:00
nm-connection-private.h libnm-core: make nm_setting_verify() take an NMConnection 2014-10-28 17:17:17 -04:00
nm-connection.c Revert "libnm-core/team: normalize invalid config to NULL" 2016-08-30 18:20:28 +02:00
nm-connection.h libnm-core: add NMSettingVxlan 2015-12-09 16:36:46 +01:00
nm-core-internal.h team: normalize invalid configuration during load 2016-08-30 18:20:28 +02:00
nm-core-types-internal.h libnm: internally expose NMVlanQosMapping struct in "nm-core-internal.h" 2015-11-02 13:57:02 +01:00
nm-core-types.h libnm-core: add NMSettingVxlan 2015-12-09 16:36:46 +01:00
nm-dbus-interface.h device: add statistics interface 2016-08-17 15:50:20 +02:00
nm-dbus-utils.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-errors.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-errors.h manager: add Reload() D-Bus command 2016-06-01 19:06:34 +02:00
nm-keyfile-internal.h all: cleanup includes in header files 2016-08-17 19:09:50 +02:00
nm-keyfile-reader.c team: normalize invalid configuration during load 2016-08-30 18:20:28 +02:00
nm-keyfile-utils.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-keyfile-utils.h libnm/keyfile/trivial: rename VPN_SECRETS_GROUP define to NM_KEYFILE_GROUP_VPN_SECRETS 2016-02-14 11:14:35 +01:00
nm-keyfile-writer.c all: use nm_strcmp_p() for sorting strings 2016-06-15 10:32:32 +02:00
nm-property-compare.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-property-compare.h all: cleanup includes in header files 2016-08-17 19:09:50 +02:00
nm-setting-8021x.c libnm-core: replace local helper with nm_stdup_not_empty() 2016-09-06 16:07:02 +02:00
nm-setting-8021x.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-adsl.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-adsl.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-bluetooth.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-bluetooth.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-bond.c bond: fix default value for 'ad_actor_system' option 2016-07-06 15:20:53 +02:00
nm-setting-bond.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-bridge-port.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-bridge-port.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-bridge.c man,libnm-core: fix typos 2016-03-30 12:03:36 +02:00
nm-setting-bridge.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-cdma.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-cdma.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-connection.c device: extend MAC address handling including randomization for ethernet and wifi 2016-06-30 08:29:56 +02:00
nm-setting-connection.h libnm: add NMSettingConnection:stable-id property 2016-06-30 08:29:54 +02:00
nm-setting-dcb.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-dcb.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-generic.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-generic.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-gsm.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-gsm.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-infiniband.c man,libnm-core: fix typos 2016-03-30 12:03:36 +02:00
nm-setting-infiniband.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-ip-config.c libnm: fix comparing NMSettingIPConfig for address and route properties 2016-06-30 08:29:54 +02:00
nm-setting-ip-config.h libnm-core: add dns-priority to NMSettingIPConfig 2016-05-12 17:13:50 +02:00
nm-setting-ip-tunnel.c libnm-core: fix memory leak in nm-setting-ip-tunnel.c 2016-03-09 23:16:23 +01:00
nm-setting-ip-tunnel.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-ip4-config.c libnm-core: ip-config: normalize may-fail for disabled IP methods 2016-07-06 09:52:35 +02:00
nm-setting-ip4-config.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-ip6-config.c libnm-core: ip-config: normalize may-fail for disabled IP methods 2016-07-06 09:52:35 +02:00
nm-setting-ip6-config.h all: fix typos in documentation and translated strings 2016-08-26 19:00:12 +02:00
nm-setting-macvlan.c libnm-core: remove trailing quote from message in nm-setting-macvlan.c 2016-03-30 00:33:20 +02:00
nm-setting-macvlan.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-olpc-mesh.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-olpc-mesh.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-ppp.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-ppp.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-pppoe.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-pppoe.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-private.h all: cleanup includes in header files 2016-08-17 19:09:50 +02:00
nm-setting-serial.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-serial.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-team-port.c libnm: restore verify() comments in team/team-port settings 2016-08-30 18:20:28 +02:00
nm-setting-team-port.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-team.c libnm: restore verify() comments in team/team-port settings 2016-08-30 18:20:28 +02:00
nm-setting-team.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-tun.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-tun.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-vlan.c libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus() 2016-03-26 12:10:54 +01:00
nm-setting-vlan.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-vpn.c setting-vpn: whatever is in vpn.secrets always is a secrets 2016-07-19 16:14:51 +02:00
nm-setting-vpn.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-vxlan.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-vxlan.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-wimax.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-setting-wimax.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-wired.c doc: clearify deprecated "cloned-mac-address" field in documentation 2016-08-30 14:32:10 +02:00
nm-setting-wired.h all: make MAC address randomization algorithm configurable 2016-06-30 08:32:50 +02:00
nm-setting-wireless-security.c all: replace _nm_utils_string_in_list() with g_strv_contains() 2016-06-17 12:25:33 +02:00
nm-setting-wireless-security.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-setting-wireless.c doc: clearify deprecated "cloned-mac-address" field in documentation 2016-08-30 14:32:10 +02:00
nm-setting-wireless.h all: make MAC address randomization algorithm configurable 2016-06-30 08:32:50 +02:00
nm-setting.c all: replace nm_unauto() by g_steal_pointer() 2016-05-12 14:28:44 +02:00
nm-setting.h libnm: add nm_setting_verify_secrets() and nm_connection_verify_secrets() 2015-11-20 10:35:10 +01:00
nm-simple-connection.c libnm-core: add _nm_simple_connection_new_from_dbus() function 2016-03-26 12:10:54 +01:00
nm-simple-connection.h docs: libnm: add doc comment to types 2016-05-05 17:01:57 +02:00
nm-utils-private.h team: normalize invalid configuration during load 2016-08-30 18:20:28 +02:00
nm-utils.c libnm: fix regression serializing empty "cloned-mac-address" 2016-09-06 16:11:23 +02:00
nm-utils.h libnm-core: add nm_utils_enum_get_values() 2015-12-01 17:39:40 +01:00
nm-version.h release: bump version to 1.5.0 (development) 2016-08-17 16:20:42 +02:00
nm-vpn-dbus-interface.h vpn: support option to preserve previous routing information on VPN config update 2016-07-04 10:31:05 +02:00
nm-vpn-editor-plugin.c libnm-core: fix invalid return annotation for nm_vpn_editor_plugin_set_plugin_info() 2016-08-10 22:30:50 +02:00
nm-vpn-editor-plugin.h libnm/vpn: add nm_vpn_editor_plugin_load_vt() 2016-06-15 15:01:12 +02:00
nm-vpn-plugin-info.c libnm-core: add missing element-type annotation 2016-08-10 22:24:10 +02:00
nm-vpn-plugin-info.h libnm/vpn: pass NMVpnPluginInfo to the NMVpnEditorPlugin instance 2016-06-15 10:32:32 +02:00