network: use VPN plugin paths as specified in the .name files
Since LIBDIR of gnome-control-center and the VPN plugins aren't necessarily the same, use the paths as specified by the VPN plugins and only reconstruct the path if it is not absolute or we fail to load the plugin. Patch from Debian package, by Michael Biebl <biebl@debian.org> https://bugzilla.gnome.org/show_bug.cgi?id=764509
This commit is contained in:
parent
278ab5fbb5
commit
675ac22c44
1 changed files with 17 additions and 12 deletions
|
@ -75,7 +75,7 @@ vpn_get_plugins (GError **error)
|
||||||
char *path = NULL, *service = NULL;
|
char *path = NULL, *service = NULL;
|
||||||
char *so_path = NULL, *so_name = NULL;
|
char *so_path = NULL, *so_name = NULL;
|
||||||
GKeyFile *keyfile = NULL;
|
GKeyFile *keyfile = NULL;
|
||||||
GModule *module;
|
GModule *module = NULL;
|
||||||
NMVpnPluginUiFactory factory = NULL;
|
NMVpnPluginUiFactory factory = NULL;
|
||||||
|
|
||||||
if (!g_str_has_suffix (f, ".name"))
|
if (!g_str_has_suffix (f, ".name"))
|
||||||
|
@ -95,6 +95,10 @@ vpn_get_plugins (GError **error)
|
||||||
if (!so_path)
|
if (!so_path)
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
|
if (g_path_is_absolute (so_path))
|
||||||
|
module = g_module_open (so_path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
|
||||||
|
|
||||||
|
if (!module) {
|
||||||
/* Remove any path and extension components, then reconstruct path
|
/* Remove any path and extension components, then reconstruct path
|
||||||
* to the SO in LIBDIR
|
* to the SO in LIBDIR
|
||||||
*/
|
*/
|
||||||
|
@ -109,6 +113,7 @@ vpn_get_plugins (GError **error)
|
||||||
"service '%s'.", service);
|
"service '%s'.", service);
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (g_module_symbol (module, "nm_vpn_plugin_ui_factory", (gpointer) &factory)) {
|
if (g_module_symbol (module, "nm_vpn_plugin_ui_factory", (gpointer) &factory)) {
|
||||||
NMVpnPluginUiInterface *plugin;
|
NMVpnPluginUiInterface *plugin;
|
||||||
|
|
Loading…
Add table
Reference in a new issue