After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732479 - sharing: do not fail if carrier_type isn't set
sharing: do not fail if carrier_type isn't set
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: sharing
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2014-06-30 14:11 UTC by Frederic Peters
Modified: 2014-08-06 09:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sharing: do not fail if carrier_type isn't set (1.68 KB, patch)
2014-06-30 14:11 UTC, Frederic Peters
none Details | Review

Description Frederic Peters 2014-06-30 14:11:19 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.
Comment 1 Frederic Peters 2014-06-30 14:11:21 UTC
Created attachment 279605 [details] [review]
sharing: do not fail if carrier_type isn't set
Comment 2 Rui Matos 2014-07-01 09:34:19 UTC
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?
Comment 3 Bastien Nocera 2014-07-01 13:29:56 UTC
(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.
Comment 4 Bastien Nocera 2014-07-01 13:30:54 UTC
nm_client_get_version() maybe? That doesn't look easily parseable.
Comment 5 Bastien Nocera 2014-08-06 09:23:44 UTC
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