git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Scott Chacon <schacon@gmail.com>
Cc: git list <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] Prompt for a username when an HTTP request 401s
Date: Fri, 19 Mar 2010 12:09:23 -0700	[thread overview]
Message-ID: <20100319190923.GA16758@spearce.org> (raw)
In-Reply-To: <d411cc4a1003191208m38b7baf2mbb8f1ea288f90819@mail.gmail.com>

Scott Chacon <schacon@gmail.com> wrote:
> On Fri, Mar 19, 2010 at 7:32 AM, Shawn O. Pearce <spearce@spearce.org> wrote:
> > Scott Chacon <schacon@gmail.com> wrote:
> >> @@ -815,7 +815,18 @@ static int http_request(const char *url, void
> >> *result, int target, int options)
> >> ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ret = HTTP_OK;
> >> ?? ?? ?? ?? ?? ?? ?? else if (missing_target(&results))
> >> ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ret = HTTP_MISSING_TARGET;
> >> - ?? ?? ?? ?? ?? ?? else
> >> + ?? ?? ?? ?? ?? ?? else if (results.http_code == 401) {
> >> + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? if (user_name) {
> >> + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ret = HTTP_NOAUTH;
> >> + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? } else {
> >> + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? // it is neccesary to use getpass here because
> >> + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? // there appears to be no other clean way to
> >> + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? // read/write stdout/stdin
> >> + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? user_name = xstrdup(getpass("Username: "));
> >
> > No, getpass is needed here because its very likely stdin/stdout are
> > pipes to our parent process. ??So we instead need to use /dev/tty,
> > but that is non-portable. ??Using getpass() can at least be stubbed
> > on other platforms with a different implementation if/when necessary.
> 
> Should I roll a new patch for this?

Yea, you probably should since I think the comment could be improved.

-- 
Shawn.

  reply	other threads:[~2010-03-19 19:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19  3:41 [PATCH] Prompt for a username when an HTTP request 401s Scott Chacon
2010-03-19  9:13 ` Tay Ray Chuan
2010-03-19  9:34   ` Daniel Stenberg
2010-03-19 14:16     ` Shawn O. Pearce
2010-03-19 14:32 ` Shawn O. Pearce
2010-03-19 19:08   ` Scott Chacon
2010-03-19 19:09     ` Shawn O. Pearce [this message]
2010-03-19 19:27   ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2010-04-01 22:14 Scott Chacon
2010-04-02  6:39 ` Junio C Hamano
2010-04-02 15:43   ` Scott Chacon
2010-04-02 16:11     ` Junio C Hamano
2010-04-01 20:29 Scott Chacon
2010-04-01 21:30 ` Junio C Hamano
2010-04-01 22:06   ` Scott Chacon
2010-03-19 19:17 Scott Chacon
2010-03-18 18:57 Scott Chacon
2010-03-18 19:03 ` Shawn O. Pearce
2010-03-18 23:53   ` René Scharfe

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=20100319190923.GA16758@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=schacon@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).