Re: [PATCH] config --get --path: check for unset $HOME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 26, 2010 at 17:08, Jonathan Nieder <jrnieder@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]