[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 <akurtako@redhat.com>
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 04a0045..b2c5cbb 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 @@
 	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 27f51c7..06fc04b 100755
--- a/bundles/org.eclipse.equinox.security.linux.x86_64/libkeystorelinuxnative.so
+++ b/bundles/org.eclipse.equinox.security.linux.x86_64/libkeystorelinuxnative.so
Binary files differ