NetworkManager/clients
Thomas Haller 828a3135aa 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
(cherry picked from commit 127ac25ef8)
(cherry picked from commit 7c78398d3e)
2018-11-30 16:56:13 +01:00
..
cli cli: avoid crash on device disconnect 2018-11-30 14:31:03 +01:00
common cli: fix setting "serial.parity" enum 2018-11-30 16:56:13 +01:00
tests clients/tests: utilize nm_utils_get_timestamp_msec() 2018-06-15 16:23:30 +02:00
tui cli: fix reading "vpn.secrets.*" from passwd-file 2018-09-14 15:18:29 +02:00
meson.build build/meson: use variables for ldflags and linker-script 2018-01-11 12:46:01 +01:00
nm-online.c all: require glib 2.40 2018-01-18 11:45:36 +01:00