pidgin/pidgin

gnomekeyring: fix module loading

2016-02-29, Jakub Adam
77b014857737
gnomekeyring: fix module loading

On GNU/Linux, g_module_open("libgnome-keyring", 0) searches for
libgnome-keyring.so, but most distributions install libraries with
versioned suffixes, like libgnome-keyring.so.0 or libgnome-keyring.so.1,
and thus the call (and whole plugin load) fails. For that reason, if
we can't find the library without suffix, try searching also for .so.0
or .so.1.
--- a/libpurple/plugins/keyrings/gnomekeyring.c Tue Feb 16 18:41:41 2016 -0600
+++ b/libpurple/plugins/keyrings/gnomekeyring.c Mon Feb 29 09:47:30 2016 +0100
@@ -418,6 +418,12 @@
*/
gkr_module = g_module_open("libgnome-keyring", 0);
if (gkr_module == NULL) {
+ gkr_module = g_module_open("libgnome-keyring.so.0", 0);
+ if (gkr_module == NULL) {
+ gkr_module = g_module_open("libgnome-keyring.so.1", 0);
+ }
+ }
+ if (gkr_module == NULL) {
purple_debug_info("keyring-gnome", "GNOME Keyring module not "
"found\n");
return FALSE;