Skip to contentSkip to conversation

GIT/SSH_ASKPASS used for username input in https:// URLs

DISCUSSION Andreas Krey 2 participants 2 messages May 6, 2019 – May 7, 2019

lore
Share & tools
lore
#0 lore raw

Hi everyone,

there is an interesting wart around prompt.c - PROMPT_ECHO isn't used in invoking an external helper program.

Thus, if I clone something on https (which requires auth for that), and have SSH_ASKPASS set, I will get two GUI *password* prompts, even though the first one will indicate in the title that it *is* asking for the username.

But basically, given the trivial protocol of SSH_ASKPASS, there doesn't seem to be any way to properly fix this without support from any desktop environment that sets SSH_ASKPASS. :-(

The best I can currently tell my users is to use the
[credentials "https:/..."]
configuration to fix the username.

But if we can't fix this, maybe we can at least point this out in the docs?

- Andreas

Signature · 3 lines
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800
#1 lore raw
Quoted 11 lines · Andreas Krey

there is an interesting wart around prompt.c - PROMPT_ECHO isn't used in invoking an external helper program.

Thus, if I clone something on https (which requires auth for that), and have SSH_ASKPASS set, I will get two GUI *password* prompts, even though the first one will indicate in the title that it *is* asking for the username.

But basically, given the trivial protocol of SSH_ASKPASS, there doesn't seem to be any way to properly fix this without support from any desktop environment that sets SSH_ASKPASS. :-(

Yep. If you haven't seen it, there's more discussion in this recent thread:

https://public-inbox.org/git/[email protected]/

Quoted 3 lines

The best I can currently tell my users is to use the
[credentials "https:/..."]
configuration to fix the username.

Yes, that works. Or a credential helper could prompt with a better interface (but AFAIK, the only one written that does so is the Windows one).

Quoted 2 lines

But if we can't fix this, maybe we can at least point this out in the docs?

Sounds like a good suggestion. Where would you look for it? In the description of GIT_ASKPASS / core.askpass?

-Peff