Skip to content

Commit 9f227d0

Browse files
committed
Set default alias when missing
1 parent 5163d8b commit 9f227d0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public SecretServiceKeychainAccess() {
3030
session.getService().addCollectionChangedHandler(collection -> LOG.debug("Collection {} changed", collection.getPath()));
3131
session.getService().addCollectionCreatedHandler(collection -> LOG.debug("Collection {} created", collection.getPath()));
3232
session.getService().addCollectionDeletedHandler(collection -> LOG.debug("Collection {} deleted", collection.getPath()));
33+
var getAlias = session.getService().readAlias("default");
34+
if (getAlias.isSuccess() && "/".equals(getAlias.value().getPath())) {
35+
// default alias is not set; set it to the login keyring
36+
session.getService().setAlias("default", new DBusPath(Static.DBusPath.LOGIN_COLLECTION));
37+
}
3338
collection.addItemChangedHandler(item -> LOG.debug("Item {} changed", item.getPath()));
3439
collection.addItemCreatedHandler(item -> LOG.debug("Item {} created", item.getPath()));
3540
collection.addItemDeletedHandler(item -> LOG.debug("Item {} deleted", item.getPath()));

0 commit comments

Comments
 (0)