git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Taylor Braun-Jones <taylor@braun-jones.org>,
	Duy Nguyen <pclouds@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: git-clone fails when current user is not in /etc/passwd
Date: Thu, 10 Dec 2015 15:40:35 -0500	[thread overview]
Message-ID: <20151210204034.GA29055@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqtwnqgjpm.fsf@gitster.mtv.corp.google.com>

On Thu, Dec 10, 2015 at 11:57:41AM -0800, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > But before we even hit the strict-check, we call xgetpwuid_self(), which
> > unconditionally dies on failure. I think that function needs to be
> > taught a "gently" form which we use for non-strict ident lookups.
> > Unfortunately it's a little non-trivial because the strictness will need
> > to get passed all the way down to ident_default_name() (and we need to
> > make sure that a non-strict check followed by a strict one does not
> > fail; i.e., that the first does not pollute the contents of
> > git_default_name).
> 
> All true.  The adding of "(none)" in add_domainname() I used as an
> excuse to make the function stop barfing is a symptom coming from
> the above.  That one should die when asked to do a strict thing
> (there is a corresponding kludge to do strstr "(none)" to cover it
> up, which is even uglier X-<).

Yes, I have always hated that. It seems like we should just be able to
carry a "strict" flag (both from xgetpwuid() and from the "(none)" hack)
along with ident_default_*, and barf at the right time if it is not set.

-Peff

  reply	other threads:[~2015-12-10 20:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-02 20:10 git-clone fails when current user is not in /etc/passwd Taylor Braun-Jones
2015-12-09 15:23 ` Taylor Braun-Jones
2015-12-09 16:08 ` Duy Nguyen
2015-12-09 18:24   ` Duy Nguyen
2015-12-09 22:35     ` Taylor Braun-Jones
2015-12-10 18:33       ` Taylor Braun-Jones
2015-12-10 18:34       ` Jeff King
2015-12-10 19:57         ` Junio C Hamano
2015-12-10 20:40           ` Jeff King [this message]
2015-12-10 21:32             ` [PATCH 0/3] " Jeff King
2015-12-10 21:33               ` [PATCH 1/3] ident: make xgetpwuid_self() a static local helper Jeff King
2015-12-10 23:39                 ` Junio C Hamano
2015-12-10 21:35               ` [PATCH 2/3] ident: keep a flag for bogus default_email Jeff King
2015-12-10 22:54                 ` Jeff King
2015-12-10 21:41               ` [PATCH 3/3] ident: loosen getpwuid error in non-strict mode Jeff King
2015-12-14 15:07                 ` Jeff King
2015-12-10 23:44               ` [PATCH 0/3] git-clone fails when current user is not in /etc/passwd Junio C Hamano
2015-12-11  2:20               ` Taylor Braun-Jones
2015-12-10 18:43     ` Junio C Hamano
2015-12-10 18:52       ` Taylor Braun-Jones

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=20151210204034.GA29055@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=taylor@braun-jones.org \
    /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).