Skip to contentSkip to conversation

Git libsecret No Unlock Dialog Issue

PATCH In review Yaroslav Sapozhnyk 4 participants 8 messages Nov 2, 2017 – Nov 6, 2017

lore
Share & tools
lore
#0 lore raw

When using Git on Fedora with locked password store credential-libsecret asks for username/password instead of displaying the unlock dialog.

If the store is unlocked credential helper gets the credentials from the store though.

Signature · 2 lines
Regards,
Yaroslav Sapozhnyk
#1 lore raw
Quoted 3 lines · Yaroslav Sapozhnyk

When using Git on Fedora with locked password store credential-libsecret asks for username/password instead of displaying the unlock dialog.

Git as packaged by Fedora or upstream Git (which version)?

Quoted 6 lines

If the store is unlocked credential helper gets the credentials from the store though.

--
Regards,
Yaroslav Sapozhnyk

#2 lore raw

Sorry, should have mentioned that. It's packaged by Fedora - 2.13.6.

Yaroslav

Quoted 14 lines · Stefan Beller
Quoted 3 lines · Yaroslav Sapozhnyk

When using Git on Fedora with locked password store credential-libsecret asks for username/password instead of displaying the unlock dialog.

Git as packaged by Fedora or upstream Git (which version)?

Quoted 6 lines

If the store is unlocked credential helper gets the credentials from the store though.

--
Regards,
Yaroslav Sapozhnyk

Signature · 2 lines
Regards,
Yaroslav Sapozhnyk
#3 lore raw
In reply to Stefan Beller
Quoted 7 lines · Stefan Beller
Quoted 3 lines · Yaroslav Sapozhnyk

When using Git on Fedora with locked password store credential-libsecret asks for username/password instead of displaying the unlock dialog.

Git as packaged by Fedora or upstream Git (which version)?

Looking at the code: current upstream git. Looking at the documentation for libsecret, this should fix it. I've not been able to test it though.

contrib/credential/libsecret/git-credential-libsecret.c +1 -1
index 4c56979d8a..b4750c9ee8 100644
@@ -104,7 +104,7 @@ static int keyring_get(struct credential *c)
        items = secret_service_search_sync(service,
                                           SECRET_SCHEMA_COMPAT_NETWORK,
                                           attributes,
-                                          SECRET_SEARCH_LOAD_SECRETS,
+                                          SECRET_SEARCH_LOAD_SECRETS | SECRET_SEARCH_UNLOCK,
                                           NULL,
                                           &error);
        g_hash_table_unref(attributes);
#4 lore raw

I've tested the code change locally and seems like it fixes the issue.

Yaroslav

Quoted 26 lines · Dennis Kaarsemaker
Quoted 7 lines · Stefan Beller
Quoted 3 lines · Yaroslav Sapozhnyk

When using Git on Fedora with locked password store credential-libsecret asks for username/password instead of displaying the unlock dialog.

Git as packaged by Fedora or upstream Git (which version)?

Looking at the code: current upstream git. Looking at the documentation for libsecret, this should fix it. I've not been able to test it though.

contrib/credential/libsecret/git-credential-libsecret.c +1 -1
index 4c56979d8a..b4750c9ee8 100644
@@ -104,7 +104,7 @@ static int keyring_get(struct credential *c)
        items = secret_service_search_sync(service,
                                           SECRET_SCHEMA_COMPAT_NETWORK,
                                           attributes,
-                                          SECRET_SEARCH_LOAD_SECRETS,
+                                          SECRET_SEARCH_LOAD_SECRETS | SECRET_SEARCH_UNLOCK,
                                           NULL,
                                           &error);
        g_hash_table_unref(attributes);
Signature · 2 lines
Regards,
Yaroslav Sapozhnyk
#5 lore raw

What version should include this fix? Cannot find a pr for it.

Thanks for providing the fix!

Regards,
Yaroslav

Quoted 38 lines · Yaroslav Sapozhnyk

I've tested the code change locally and seems like it fixes the issue.

Yaroslav

Quoted 18 lines · Dennis Kaarsemaker
Quoted 7 lines · Stefan Beller
Quoted 3 lines · Yaroslav Sapozhnyk

When using Git on Fedora with locked password store credential-libsecret asks for username/password instead of displaying the unlock dialog.

Git as packaged by Fedora or upstream Git (which version)?

Looking at the code: current upstream git. Looking at the documentation for libsecret, this should fix it. I've not been able to test it though.

contrib/credential/libsecret/git-credential-libsecret.c +0 -0
index 4c56979d8a..b4750c9ee8 100644

contrib/credential/libsecret/git-credential-libsecret.c static int keyring_get(struct credential *c) · line 110

Quoted 8 lines
contrib/credential/libsecret/git-credential-libsecret.c +1 -1
@@ -104,7 +104,7 @@ static int keyring_get(struct credential *c)
        items = secret_service_search_sync(service,
                                           SECRET_SCHEMA_COMPAT_NETWORK,
                                           attributes,
-                                          SECRET_SEARCH_LOAD_SECRETS,
+                                          SECRET_SEARCH_LOAD_SECRETS | SECRET_SEARCH_UNLOCK,
                                           NULL,
                                           &error);
        g_hash_table_unref(attributes);

--
Regards,
Yaroslav Sapozhnyk

Signature · 2 lines
Regards,
Yaroslav Sapozhnyk
#6 lore raw

PATCH 1/1 credential-libsecret: unlock locked secrets

In reply to Yaroslav Sapozhnyk

Credentials exposed by the secret service DBUS interface may be locked. Setting the SECRET_SEARCH_UNLOCK flag will make the secret service unlock these secrets, possibly prompting the user for credentials to do so. Without this flag, the secret is simply not loaded.

---
 contrib/credential/libsecret/git-credential-libsecret.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/credential/libsecret/git-credential-libsecret.c +1 -1
index 4c56979d8a..b4750c9ee8 100644
@@ -104,7 +104,7 @@ static int keyring_get(struct credential *c)
 	items = secret_service_search_sync(service,
 					   SECRET_SCHEMA_COMPAT_NETWORK,
 					   attributes,
-					   SECRET_SEARCH_LOAD_SECRETS,
+					   SECRET_SEARCH_LOAD_SECRETS | SECRET_SEARCH_UNLOCK,
 					   NULL,
 					   &error);
 	g_hash_table_unref(attributes);
Signature · 1 line
2.15.0-rc2-464-gb5de734
#7 lore raw

Re: [PATCH] credential-libsecret: unlock locked secrets

Quoted 24 lines · Dennis Kaarsemaker

Credentials exposed by the secret service DBUS interface may be locked. Setting the SECRET_SEARCH_UNLOCK flag will make the secret service unlock these secrets, possibly prompting the user for credentials to do so. Without this flag, the secret is simply not loaded.

---
 contrib/credential/libsecret/git-credential-libsecret.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/credential/libsecret/git-credential-libsecret.c +1 -2
index 4c56979d8a..b4750c9ee8 100644
@@ -104,7 +104,7 @@ static int keyring_get(struct credential *c)
        items = secret_service_search_sync(service,
                                           SECRET_SCHEMA_COMPAT_NETWORK,
                                           attributes,
-                                          SECRET_SEARCH_LOAD_SECRETS,
+                                          SECRET_SEARCH_LOAD_SECRETS | SECRET_SEARCH_UNLOCK,
                                           NULL,
                                           &error);
        g_hash_table_unref(attributes);
--
Quoted 2 lines

2.15.0-rc2-464-gb5de734

Looks okay. (It seems that's what all other programs do, too...)

Signature · 1 line
Mantas Mikulėnas <[email protected]>