diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-11-30 16:39:55 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-12-05 21:29:00 +0100 |
commit | f28d311d13f2d87bb71078ad70b58d608e008166 (patch) | |
tree | 5045adfc9dfd9d48477d59466ce48840d3fc3f36 | |
parent | 96ab3a8a5cf515272480db78126dc554b9d26e77 (diff) | |
download | NetworkManager-f28d311d13f2d87bb71078ad70b58d608e008166.tar.gz |
clients: accept service without org.freedesktop.NetworkManager prefix
in nm_vpn_get_plugin_by_service()
-rw-r--r-- | clients/common/nm-vpn-helpers.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clients/common/nm-vpn-helpers.c b/clients/common/nm-vpn-helpers.c index 6cc3eb86bf..276df2b95c 100644 --- a/clients/common/nm-vpn-helpers.c +++ b/clients/common/nm-vpn-helpers.c @@ -41,6 +41,7 @@ nm_vpn_get_plugin_by_service (const char *service, GError **error) { NMVpnEditorPlugin *plugin = NULL; NMVpnPluginInfo *plugin_info; + char *type = NULL; g_return_val_if_fail (service != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); @@ -48,6 +49,9 @@ nm_vpn_get_plugin_by_service (const char *service, GError **error) if (G_UNLIKELY (!plugins_loaded)) nm_vpn_get_plugins (); + if (!g_str_has_prefix (service, NM_DBUS_INTERFACE)) + service = type = g_strdup_printf ("%s.%s", NM_DBUS_INTERFACE, service); + plugin_info = nm_vpn_plugin_info_list_find_by_service (plugins, service); if (plugin_info) { plugin = nm_vpn_plugin_info_get_editor_plugin (plugin_info); @@ -56,6 +60,7 @@ nm_vpn_get_plugin_by_service (const char *service, GError **error) } else g_set_error_literal (error, NM_VPN_PLUGIN_ERROR, NM_VPN_PLUGIN_ERROR_FAILED, _("could not get VPN plugin info")); + g_free (type); return plugin; } |