NetworkManager/clients/common
Thomas Haller 127ac25ef8 cli: fix setting "serial.parity" enum
The meta data type descriptor must set .get_gtype only for
GObject properties which are of type int or uint. That is, when
the enum type cannot be automatically detected.

However, NM_SETTING_SERIAL_PARITY is a g_param_spec_enum()
of type NM_TYPE_SETTING_SERIAL_PARITY, so setting the get_gtype()
hook is wrong and leads to a crash

   $ /bin/nmcli connection add type gsm autoconnect no con-name t ifname '*' apn xyz serial.parity 5

   (process:11086): libnmc-CRITICAL **: 15:04:35.180: file clients/common/nm-meta-setting-desc.c: line 1283 (_set_fcn_gobject_enum): should not be reached
   Segmentation fault (core dumped)

That is because the enum property setter does:

    »···if (   has_gtype
    »···    && NM_IN_SET (gtype_prop,
    »···                  G_TYPE_INT,
    »···                  G_TYPE_UINT)
    »···    && G_TYPE_IS_CLASSED (gtype)
    »···    && (gtype_class = g_type_class_ref (gtype))
    »···    && (   (is_flags = G_IS_FLAGS_CLASS (gtype_class))
    »···        || G_IS_ENUM_CLASS (gtype_class))) {
    »···»···/* valid */

meaning, it only allows "has_gtype" if the native "gtype_prop" is
G_TYPE_INT or G_TYPE_UINT.

Fixes: 9a68123827
2018-10-17 16:22:34 +02:00
..
tests build: meson: add prefix to test names 2018-04-12 09:21:10 +02:00
meson.build libnm, cli, ifcfg-rh: add NMSettingEthtool setting 2018-08-10 10:38:19 +02:00
nm-client-utils.c cli: drop NMCTriStateValue for NMTernary 2018-08-10 10:38:19 +02:00
nm-client-utils.h cli: drop NMCTriStateValue for NMTernary 2018-08-10 10:38:19 +02:00
nm-meta-setting-access.c libnm: use NMMetaSettingInfo for tracking setting priority 2018-08-10 10:38:19 +02:00
nm-meta-setting-access.h cli: remove unused argument from nm_meta_selection_create_parse_list() 2018-07-25 17:08:37 +02:00
nm-meta-setting-desc.c cli: fix setting "serial.parity" enum 2018-10-17 16:22:34 +02:00
nm-meta-setting-desc.h cli: fix handling uint64 connection property "serial.send-delay" 2018-10-17 16:22:34 +02:00
nm-polkit-listener.c docs: misc. typos 2018-09-15 09:08:03 +02:00
nm-polkit-listener.h docs: misc. typos 2018-09-15 09:08:03 +02:00
nm-secret-agent-simple.c cli: fix reading "vpn.secrets.*" from passwd-file 2018-09-14 15:17:53 +02:00
nm-secret-agent-simple.h cli: fix reading "vpn.secrets.*" from passwd-file 2018-09-14 15:17:53 +02:00
nm-vpn-helpers.c all: use the elvis operator wherever possible 2018-05-10 14:36:58 +02:00
nm-vpn-helpers.h clients: drop redundant #include "NetworkManager.h" 2018-01-08 12:38:54 +01:00
settings-docs.h.in core/setting-wpan: add page and channel properties 2018-10-07 15:46:02 +02:00
settings-docs.xsl cli: fix marking settings docs for translation 2017-04-23 23:45:02 +02:00