From 3ce4dce7918a2f1e83f7ad5167675000e13e543c Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Wed, 29 Sep 2021 12:48:40 +0200 Subject: [PATCH] fixes #12 Fix shared DBusConnection between KDEWalletKeychainAccess and SecretServiceKeychainAccess which leads to infinite loop in SecretServiceKeychainAccess --- .../linux/keychain/KDEWalletKeychainAccess.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/cryptomator/linux/keychain/KDEWalletKeychainAccess.java b/src/main/java/org/cryptomator/linux/keychain/KDEWalletKeychainAccess.java index 58721da..47307c0 100644 --- a/src/main/java/org/cryptomator/linux/keychain/KDEWalletKeychainAccess.java +++ b/src/main/java/org/cryptomator/linux/keychain/KDEWalletKeychainAccess.java @@ -76,20 +76,20 @@ public ConnectedWallet(DBusConnection connection) { static Optional connect() { try { - return Optional.of(new ConnectedWallet(getConnection())); + return Optional.of(new ConnectedWallet(getNewConnection())); } catch (DBusException e) { LOG.warn("Connecting to D-Bus failed.", e); return Optional.empty(); } } - private static DBusConnection getConnection() throws DBusException { + private static DBusConnection getNewConnection() throws DBusException { try { - return DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION); + return DBusConnection.newConnection(DBusConnection.DBusBusType.SESSION); } catch (DBusConnectionException ce) { LOG.warn("SESSION DBus not found, falling back to SYSTEM DBus"); try { - return DBusConnection.getConnection(DBusConnection.DBusBusType.SYSTEM); + return DBusConnection.newConnection(DBusConnection.DBusBusType.SYSTEM); } catch (DBusException e) { throw e; }