From 00df93cc413014222e6e309c141fd6de20f77a0b Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Tue, 2 May 2017 16:18:42 +0300 Subject: [bug 515880] Fix Equinox keystore fragment for Linux 64bit Verify that the dbus session bus is active before trying to do call any libsecret function. Change-Id: Ib27f5c80d8ee3a7e83e10a5cf2057d45bc604078 Signed-off-by: Alexander Kurtakov --- .../keystorelinuxnative/keystoreLinuxNative.c | 11 ++++++++++- .../libkeystorelinuxnative.so | Bin 13160 -> 13000 bytes 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.c b/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.c index 04a0045d..b2c5cbb2 100644 --- a/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.c +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.c @@ -35,7 +35,16 @@ static void unlock_secret_service(JNIEnv *env) GList *l, *ul; gchar* lbl; gint nu; - + //check that there is session dbus bus + GDBusConnection* dbusconnection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error); + if (error != NULL) { + (*env)->ExceptionClear(env); + char buffer [60]; + sprintf(buffer, "Unable to get secret service: %s", error->message); + (*env)->ThrowNew(env, (* env)->FindClass(env, "java/lang/SecurityException"), buffer); + g_error_free (error); + return; + } SecretService* secretservice = secret_service_get_sync(SECRET_SERVICE_LOAD_COLLECTIONS, NULL, &error); if (error != NULL) { (*env)->ExceptionClear(env); diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/libkeystorelinuxnative.so b/bundles/org.eclipse.equinox.security.linux.x86_64/libkeystorelinuxnative.so index 27f51c70..06fc04ba 100755 Binary files a/bundles/org.eclipse.equinox.security.linux.x86_64/libkeystorelinuxnative.so and b/bundles/org.eclipse.equinox.security.linux.x86_64/libkeystorelinuxnative.so differ -- cgit v1.2.1