git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git libsecret No Unlock Dialog Issue
@ 2017-11-02 16:00 Yaroslav Sapozhnyk
  2017-11-02 18:35 ` Stefan Beller
  0 siblings, 1 reply; 8+ messages in thread
From: Yaroslav Sapozhnyk @ 2017-11-02 16:00 UTC (permalink / raw)
  To: git

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.

-- 
Regards,
Yaroslav Sapozhnyk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Git libsecret No Unlock Dialog Issue
  2017-11-02 16:00 Git libsecret No Unlock Dialog Issue Yaroslav Sapozhnyk
@ 2017-11-02 18:35 ` Stefan Beller
  2017-11-02 18:50   ` Yaroslav Sapozhnyk
  2017-11-02 18:55   ` Dennis Kaarsemaker
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Beller @ 2017-11-02 18:35 UTC (permalink / raw)
  To: Yaroslav Sapozhnyk; +Cc: git

On Thu, Nov 2, 2017 at 9:00 AM, Yaroslav Sapozhnyk
<yaroslav.sapozhnik@gmail.com> wrote:
> 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)?

> If the store is unlocked credential helper gets the credentials from
> the store though.
>
> --
> Regards,
> Yaroslav Sapozhnyk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Git libsecret No Unlock Dialog Issue
  2017-11-02 18:35 ` Stefan Beller
@ 2017-11-02 18:50   ` Yaroslav Sapozhnyk
  2017-11-02 18:55   ` Dennis Kaarsemaker
  1 sibling, 0 replies; 8+ messages in thread
From: Yaroslav Sapozhnyk @ 2017-11-02 18:50 UTC (permalink / raw)
  To: Stefan Beller; +Cc: git

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

Yaroslav

On Thu, Nov 2, 2017 at 2:35 PM, Stefan Beller <sbeller@google.com> wrote:
> On Thu, Nov 2, 2017 at 9:00 AM, Yaroslav Sapozhnyk
> <yaroslav.sapozhnik@gmail.com> wrote:
>> 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)?
>
>> If the store is unlocked credential helper gets the credentials from
>> the store though.
>>
>> --
>> Regards,
>> Yaroslav Sapozhnyk



-- 
Regards,
Yaroslav Sapozhnyk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Git libsecret No Unlock Dialog Issue
  2017-11-02 18:35 ` Stefan Beller
  2017-11-02 18:50   ` Yaroslav Sapozhnyk
@ 2017-11-02 18:55   ` Dennis Kaarsemaker
  2017-11-02 19:48     ` Yaroslav Sapozhnyk
  1 sibling, 1 reply; 8+ messages in thread
From: Dennis Kaarsemaker @ 2017-11-02 18:55 UTC (permalink / raw)
  To: Stefan Beller, Yaroslav Sapozhnyk; +Cc: git

On Thu, 2017-11-02 at 11:35 -0700, Stefan Beller wrote:
> On Thu, Nov 2, 2017 at 9:00 AM, Yaroslav Sapozhnyk
> <yaroslav.sapozhnik@gmail.com> wrote:
> > 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.

diff --git a/contrib/credential/libsecret/git-credential-libsecret.c b/contrib/credential/libsecret/git-credential-libsecret.c
index 4c56979d8a..b4750c9ee8 100644
--- a/contrib/credential/libsecret/git-credential-libsecret.c
+++ b/contrib/credential/libsecret/git-credential-libsecret.c
@@ -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);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Git libsecret No Unlock Dialog Issue
  2017-11-02 18:55   ` Dennis Kaarsemaker
@ 2017-11-02 19:48     ` Yaroslav Sapozhnyk
  2017-11-03 18:01       ` Yaroslav Sapozhnyk
  2017-11-03 20:44       ` [PATCH] credential-libsecret: unlock locked secrets Dennis Kaarsemaker
  0 siblings, 2 replies; 8+ messages in thread
From: Yaroslav Sapozhnyk @ 2017-11-02 19:48 UTC (permalink / raw)
  To: Dennis Kaarsemaker; +Cc: Stefan Beller, git

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

Yaroslav

On Thu, Nov 2, 2017 at 2:55 PM, Dennis Kaarsemaker
<dennis@kaarsemaker.net> wrote:
> On Thu, 2017-11-02 at 11:35 -0700, Stefan Beller wrote:
>> On Thu, Nov 2, 2017 at 9:00 AM, Yaroslav Sapozhnyk
>> <yaroslav.sapozhnik@gmail.com> wrote:
>> > 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.
>
> diff --git a/contrib/credential/libsecret/git-credential-libsecret.c b/contrib/credential/libsecret/git-credential-libsecret.c
> index 4c56979d8a..b4750c9ee8 100644
> --- a/contrib/credential/libsecret/git-credential-libsecret.c
> +++ b/contrib/credential/libsecret/git-credential-libsecret.c
> @@ -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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Git libsecret No Unlock Dialog Issue
  2017-11-02 19:48     ` Yaroslav Sapozhnyk
@ 2017-11-03 18:01       ` Yaroslav Sapozhnyk
  2017-11-03 20:44       ` [PATCH] credential-libsecret: unlock locked secrets Dennis Kaarsemaker
  1 sibling, 0 replies; 8+ messages in thread
From: Yaroslav Sapozhnyk @ 2017-11-03 18:01 UTC (permalink / raw)
  To: Dennis Kaarsemaker; +Cc: Stefan Beller, git

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

Thanks for providing the fix!

Regards,
Yaroslav

On Thu, Nov 2, 2017 at 3:48 PM, Yaroslav Sapozhnyk
<yaroslav.sapozhnik@gmail.com> wrote:
> I've tested the code change locally and seems like it fixes the issue.
>
> Yaroslav
>
> On Thu, Nov 2, 2017 at 2:55 PM, Dennis Kaarsemaker
> <dennis@kaarsemaker.net> wrote:
>> On Thu, 2017-11-02 at 11:35 -0700, Stefan Beller wrote:
>>> On Thu, Nov 2, 2017 at 9:00 AM, Yaroslav Sapozhnyk
>>> <yaroslav.sapozhnik@gmail.com> wrote:
>>> > 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.
>>
>> diff --git a/contrib/credential/libsecret/git-credential-libsecret.c b/contrib/credential/libsecret/git-credential-libsecret.c
>> index 4c56979d8a..b4750c9ee8 100644
>> --- a/contrib/credential/libsecret/git-credential-libsecret.c
>> +++ b/contrib/credential/libsecret/git-credential-libsecret.c
>> @@ -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



-- 
Regards,
Yaroslav Sapozhnyk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] credential-libsecret: unlock locked secrets
  2017-11-02 19:48     ` Yaroslav Sapozhnyk
  2017-11-03 18:01       ` Yaroslav Sapozhnyk
@ 2017-11-03 20:44       ` Dennis Kaarsemaker
  2017-11-06  9:53         ` Mantas Mikulėnas
  1 sibling, 1 reply; 8+ messages in thread
From: Dennis Kaarsemaker @ 2017-11-03 20:44 UTC (permalink / raw)
  To: git; +Cc: grawity, 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.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
---
 contrib/credential/libsecret/git-credential-libsecret.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/credential/libsecret/git-credential-libsecret.c b/contrib/credential/libsecret/git-credential-libsecret.c
index 4c56979d8a..b4750c9ee8 100644
--- a/contrib/credential/libsecret/git-credential-libsecret.c
+++ b/contrib/credential/libsecret/git-credential-libsecret.c
@@ -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);
-- 
2.15.0-rc2-464-gb5de734


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] credential-libsecret: unlock locked secrets
  2017-11-03 20:44       ` [PATCH] credential-libsecret: unlock locked secrets Dennis Kaarsemaker
@ 2017-11-06  9:53         ` Mantas Mikulėnas
  0 siblings, 0 replies; 8+ messages in thread
From: Mantas Mikulėnas @ 2017-11-06  9:53 UTC (permalink / raw)
  To: Dennis Kaarsemaker; +Cc: git

On Fri, Nov 3, 2017 at 10:44 PM, Dennis Kaarsemaker
<dennis@kaarsemaker.net> wrote:
> 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.
>
> Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
> ---
>  contrib/credential/libsecret/git-credential-libsecret.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/credential/libsecret/git-credential-libsecret.c b/contrib/credential/libsecret/git-credential-libsecret.c
> index 4c56979d8a..b4750c9ee8 100644
> --- a/contrib/credential/libsecret/git-credential-libsecret.c
> +++ b/contrib/credential/libsecret/git-credential-libsecret.c
> @@ -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);
> --
> 2.15.0-rc2-464-gb5de734
>

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

-- 
Mantas Mikulėnas <grawity@gmail.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-11-06  9:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-02 16:00 Git libsecret No Unlock Dialog Issue Yaroslav Sapozhnyk
2017-11-02 18:35 ` Stefan Beller
2017-11-02 18:50   ` Yaroslav Sapozhnyk
2017-11-02 18:55   ` Dennis Kaarsemaker
2017-11-02 19:48     ` Yaroslav Sapozhnyk
2017-11-03 18:01       ` Yaroslav Sapozhnyk
2017-11-03 20:44       ` [PATCH] credential-libsecret: unlock locked secrets Dennis Kaarsemaker
2017-11-06  9:53         ` Mantas Mikulėnas

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).