Skip to content

Commit 3ce4dce

Browse files
committed
fixes #12
Fix shared DBusConnection between KDEWalletKeychainAccess and SecretServiceKeychainAccess which leads to infinite loop in SecretServiceKeychainAccess
1 parent 0e13a3f commit 3ce4dce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/org/cryptomator/linux/keychain/KDEWalletKeychainAccess.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,20 @@ public ConnectedWallet(DBusConnection connection) {
7676

7777
static Optional<ConnectedWallet> connect() {
7878
try {
79-
return Optional.of(new ConnectedWallet(getConnection()));
79+
return Optional.of(new ConnectedWallet(getNewConnection()));
8080
} catch (DBusException e) {
8181
LOG.warn("Connecting to D-Bus failed.", e);
8282
return Optional.empty();
8383
}
8484
}
8585

86-
private static DBusConnection getConnection() throws DBusException {
86+
private static DBusConnection getNewConnection() throws DBusException {
8787
try {
88-
return DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION);
88+
return DBusConnection.newConnection(DBusConnection.DBusBusType.SESSION);
8989
} catch (DBusConnectionException ce) {
9090
LOG.warn("SESSION DBus not found, falling back to SYSTEM DBus");
9191
try {
92-
return DBusConnection.getConnection(DBusConnection.DBusBusType.SYSTEM);
92+
return DBusConnection.newConnection(DBusConnection.DBusBusType.SYSTEM);
9393
} catch (DBusException e) {
9494
throw e;
9595
}

0 commit comments

Comments
 (0)