GNOME Bugzilla – Bug 750659
NMConfig doesn't strip keyfile strings
Last modified: 2015-07-07 14:06:59 UTC
nm-config.c should g_strstrip() values it reads from the config files. Probably should just create a nm_config_keyfile_get_string() that does: return g_strstrip (g_key_file_get_value ()); and then use that in most places, but definitely in init_sync().
On branch th/nm-config-intern-bgo750558 there is patch "config: fix usage of g_key_file_get_value() vs. g_key_file_get_string()" That might be relevant for seeing wrong values. Also, I just added a patch: "config: ensure nm_config_get_plugins() to return stripped values" to th/nm-config-intern-bgo750558. In this case, nm_config_get_plugins() _will_ return stripped values. Because it understands that for "plugins" it makes no sense to have white-space. But IMO it is wrong to do it on the native values as returned by nm_config_data_get_value(). NMConfig doesn't know the meaning of these values, it should not pre-mangle them.
bug 750558 was fixed and th/nm-config-intern-bgo750558 got merged upstream (in two parts). master: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=65753dbc133f77ccd5531288aab9a9e80da3b786 http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=05db3ee08a30edc503e2b9033993ee3d2cbf019f the first part fixes this bug and was backported to nm-1-0: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=cf15f2a4a82f085d67f54f49ab9355d0d40c0969 It does not unconditionally strip values, but it - strips values for properties where it makes sense (for "connectivity.url" but not for "connectivity.response"). - several fixes of how to parse the value. E.g. http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=df1cd73 - fix whitespace handling for device-specs - config: add NMConfigGetValueFlags argument to nm_config_data_get_value() http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=1b66696 IMO this fixes the bug and I'm closing this one. Let's open a new bug if there are still issues.