GNOME Bugzilla – Bug 732479
sharing: do not fail if carrier_type isn't set
Last modified: 2014-08-06 09:23:59 UTC
On my computer gsd crashed because carrier_type was NULL, I am not sure of the root cause (maybe a slightly older network manager) but this is easily avoided using g_strcmp0 in place of g_strequal.
Created attachment 279605 [details] [review] sharing: do not fail if carrier_type isn't set
Review of attachment 279605 [details] [review]: We also pass ->carrier_type to g_variant_new_string() . Perhaps we need to sanitize the values we get from the NM api better here. It might also be better if we defaulted sharing_status to OFFLINE in this case. Bastien?
(In reply to comment #2) > Review of attachment 279605 [details] [review]: > > We also pass ->carrier_type to g_variant_new_string() . Perhaps we need to > sanitize the values we get from the NM api better here. > > It might also be better if we defaulted sharing_status to OFFLINE in this case. > Bastien? We should try and check whether the running NM supports those properties, and handle it as offline if the properties aren't available.
nm_client_get_version() maybe? That doesn't look easily parseable.
commit d192314efbf4f0de0935ad2d656d7438b6872526 Author: Bastien Nocera <hadess@hadess.net> Date: Wed Aug 6 11:18:52 2014 +0200 sharing: Fix crash when run against older NM When run against an older version of NetworkManager, nm_active_connection_get_connection_type() will return NULL as the library supports the function, but the property doesn't exist in the daemon. Consider the sharing to be offline if the version of NetworkManager is too old. https://bugzilla.gnome.org/show_bug.cgi?id=732479