Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add fallback for get login.keyring path #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion secret_service/secret_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ func (s *SecretService) GetCollection(name string) dbus.BusObject {
func (s *SecretService) GetLoginCollection() dbus.BusObject {
path := dbus.ObjectPath(collectionBasePath + "login")
if err := s.CheckCollectionPath(path); err != nil {
path = dbus.ObjectPath(loginCollectionAlias)
var loginAlias dbus.ObjectPath
err := s.object.Call(serviceInterface+".ReadAlias", 0, "login").Store(&loginAlias)
if err != nil || loginAlias == "/" {
path = dbus.ObjectPath(loginCollectionAlias)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the PR is about adding a fallback I would assume that the current behavior stays the same and the new thing is the fallback. Here we have it the other way around.

Maybe it's good, I don't know the details and give the impact for >1000 projects that use this library, I would like to have a reason why we change the order.

} else {
path = loginAlias
}
}
return s.Object(serviceName, path)
}
Expand Down