git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Iain Paton <ipaton0@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git no longer prompting for password
Date: Fri, 24 Aug 2012 17:25:01 -0400	[thread overview]
Message-ID: <20120824212501.GA16285@sigill.intra.peff.net> (raw)
In-Reply-To: <5037E1D0.6030900@gmail.com>

On Fri, Aug 24, 2012 at 09:19:28PM +0100, Iain Paton wrote:

> A recent update to git 1.7.12 from 1.7.3.5 seems to have changed
> something - trying to push to a smart http backend no longer prompts
> for a password and hence fails the server auth.
> [...]
> Backtracking through the versions I've skipped and this doesn't seem
> to be a new problem, client side up to 1.7.7.7 works, 1.7.8 onwards
> don't. Server side version doesn't seem to make a difference.

There was some work in v1.7.8 to avoid prompting for a password when it
is not necessary; I suspect this is a fallout of that.

You could try bisecting the bug. My guess is that you will end up at
commit 986bbc0 (http: don't always prompt for password, 2011-11-04).

> user@fubar01:~/test# git --version
> git version 1.7.7.7
> user@fubar01:~/test# git push http://ipaton@10.0.0.1/git/test.git master
> Password: 

As per the discussion in 986bbc0, this is actually prompting you before
git makes any request. Whereas here:

> user@fubar01:~/test# git --version
> git version 1.7.8
> user@fubar01:~/test# git push http://ipaton@10.0.0.1/git/test.git master --verbose

We should get an HTTP 401 from the server, then prompt, then retry.
What's weird is that it sort of works:

> Pushing to http://ipaton@10.0.0.1/git/test.git
> Counting objects: 6, done.
> Delta compression using up to 8 threads.
> Compressing objects: 100% (3/3), done.
> Writing objects: 100% (5/5), 491 bytes, done.
> Total 5 (delta 0), reused 0 (delta 0)
> error: RPC failed; result=22, HTTP code = 401
> fatal: The remote end hung up unexpectedly
> fatal: The remote end hung up unexpectedly

It's like the initial http requests do not get a 401, and the push
proceeds, and then some later request causes a 401 when we do not expect
it. Which is doubly odd, since we should also be able to handle that
case (the first 401 we get should cause us to ask for a password).

Can you show us the result of running with GIT_CURL_VERBOSE=1? I'd
really like to see which requests are being made with and without
authentication.

> Looking at changelogs for 1.7.8 and I'm not really seeing anything
> that says I need to do something different.

No, you shouldn't need to do anything different. I'd suspect the
weirdness you are seeing is from a credential helper trying to supply a
blank password, except that you would have to have configured one
manually for it to run (I assume you are not on a shared machine where
somebody might have tweaked /etc/gitconfig or anything like that).

-Peff

  reply	other threads:[~2012-08-24 21:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24 20:19 git no longer prompting for password Iain Paton
2012-08-24 21:25 ` Jeff King [this message]
     [not found]   ` <5038E781.1090008@gmail.com>
2012-08-25 20:39     ` Jeff King
2012-08-26  9:57       ` Iain Paton
2012-08-26 10:13         ` Jeff King
2012-08-26 14:18           ` Iain Paton
2012-08-27 13:21           ` [PATCH 0/8] fix password prompting for "half-auth" servers Jeff King
2012-08-27 13:23             ` [PATCH 1/8] t5550: put auth-required repo in auth/dumb Jeff King
2012-08-27 13:24             ` [PATCH 2/8] t5550: factor out http auth setup Jeff King
2012-08-27 13:24             ` [PATCH 3/8] t/lib-httpd: only route auth/dumb to dumb repos Jeff King
2012-08-27 13:25             ` [PATCH 4/8] t/lib-httpd: recognize */smart/* repos as smart-http Jeff King
2012-08-27 13:25             ` [PATCH 5/8] t: test basic smart-http authentication Jeff King
2012-08-27 13:25             ` [PATCH 6/8] t: test http access to "half-auth" repositories Jeff King
2012-08-27 13:26             ` [PATCH 7/8] http: factor out http error code handling Jeff King
2012-08-28 18:06               ` Junio C Hamano
2012-08-27 13:27             ` [PATCH 8/8] http: prompt for credentials on failed POST Jeff King
2012-08-27 17:48               ` Junio C Hamano
2012-08-27 21:49                 ` Jeff King
2012-08-27 23:29                   ` Junio C Hamano
2012-08-27 17:14             ` [PATCH 0/8] fix password prompting for "half-auth" servers Junio C Hamano
2012-08-27  8:28         ` git no longer prompting for password Iain Paton
2012-08-27 13:33           ` BJ Hargrave

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120824212501.GA16285@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=ipaton0@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).