git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git abuses qt4-ssh-askpass

From
Jeff King <peff@peff.net>
Date
May 12, 2014, 20:46 UTC
Message-ID
<20140512204642.GC2329@sigill.intra.peff.net>
In-Reply-To
<CAMw+j7L1YkwjYZibOpuJDnC3FjaRZgBCKBMQcUyT9uRis3heFQ@mail.gmail.com>
On Sat, May 10, 2014 at 10:41:28AM +0200, Chris “Kwpolska” Warrick wrote:
Show 6 quoted lines
> when I’m using the HTTPS protocol to access repositories, a window
> from /usr/bin/qt4-ssh-askpass comes up.  It asks for my “SSH pass
> phrase”, twice.  Sadly, it’s wrong.  The actual things it wants is the
> username in the first case, and the password used to access the remote
> repository (eg. my GitHub password) in the second question.  This is a
> bug, and very misleading behavior.

If you have GIT_ASKPASS or SSH_ASKPASS set and git needs to prompt for a username or password, it will call that program rather than prompting on the terminal. It does pass a meaningful label to the askpass program, but it sounds like your askpass program does not actually display it.

E.g., try setting GIT_TRACE=1. I get:
  $ GIT_TRACE=1 SSH_ASKPASS=ssh-askpass-fullscreen git fetch
  trace: built-in: git 'fetch'
  trace: run_command: 'git-remote-https' 'origin' 'https://github.com/peff/test'
  trace: run_command: 'ssh-askpass-fullscreen' 'Username for '\''https://github.com'\'': '
  trace: run_command: 'ssh-askpass-fullscreen' 'Password for '\''https://peff@github.com'\'': '

and the askpass program shows me those prompts. You may want to file a bug report with qt4-ssh-askpass, as most other askpass programs (including the original ssh-askpass that comes with ssh) respects the prompt arguments.

That being said, we may be able to improve git, depending on what you actually wanted to happen. For example, I don't think there is a way to tell git "even though I have SSH_ASKPASS set, still prompt me on the terminal". It's been generally assumed that you would only set that variable if you preferred an external prompt to a terminal prompt.

You may also want to look into git's credential support (see "git help credential"), which can let you store the username and password in secure system-provided storage (however from the qt4 above, I guess you might be using KDE, and I do not know of a KDE Wallet helper; there is one for GNOME keyring).

-Peff
Previous: Felipe Contreras
Message 3 of 3 in “Git abuses qt4-ssh-askpass”
  1. Chris “Kwpolska” WarrickMay 10, 2014
  2. Felipe ContrerasMay 10, 2014
  3. Jeff KingMay 12, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.