From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Julien Cristau <jcristau@debian.org>,
Matthieu Moy <Matthieu.Moy@imag.fr>,
git@vger.kernel.org
Subject: Re: [PATCH] config --get --path: check for unset $HOME
Date: Mon, 26 Jul 2010 17:48:57 +0000 [thread overview]
Message-ID: <AANLkTin6RxdVWW6qYVAyydtncGSxLK_Aoy2aWVIuoptQ@mail.gmail.com> (raw)
In-Reply-To: <20100726170837.GC4399@burratino>
On Mon, Jul 26, 2010 at 17:08, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Ęvar Arnfjörš Bjarmason wrote:
>
>> Should we maybe fall back on checking pw_dir in getpwuid() if $HOME isn't set?
>
> Maybe. Why? On Unix I suspect it is such a rare case as to not
> justify complicating the rules, but I do not know if it would help on
> other platforms.
I don't know if this is worth it, but in the Perl world this is a
fairly common idiom:
my $home = $ENV{HOME} || (getpwuid($<))[7];
Sometimes you're executing under some buggy wrapper that's scrubbing
your environment. I recall running into this issue e.g. on some odd
Solaris webserver, which was executing CGI scripts under my user, but
$HOME wasn't set.
prev parent reply other threads:[~2010-07-26 17:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100723003456.2976.899.reportbug@dr-wily.mit.edu>
[not found] ` <20100723012322.GA27113@burratino>
[not found] ` <20100725085939.GA5281@radis.liafa.jussieu.fr>
[not found] ` <20100726005111.GA29755@burratino>
[not found] ` <20100726140756.GH12476@radis.liafa.jussieu.fr>
2010-07-26 15:06 ` [PATCH] config --get --path: check for unset $HOME Jonathan Nieder
2010-07-26 15:33 ` Julien Cristau
2010-07-26 16:35 ` Ævar Arnfjörð Bjarmason
2010-07-26 17:08 ` Jonathan Nieder
2010-07-26 17:48 ` Ævar Arnfjörð Bjarmason [this message]
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=AANLkTin6RxdVWW6qYVAyydtncGSxLK_Aoy2aWVIuoptQ@mail.gmail.com \
--to=avarab@gmail.com \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
--cc=jcristau@debian.org \
--cc=jrnieder@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).