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 15:06, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
>                size_t username_len = first_slash - username;
>                if (username_len == 0) {
>                        const char *home = getenv("HOME");
> +                       if (!home)
> +                               goto return_null;
>                        strbuf_add(&user_path, home, strlen(home));
>                } else {
>                        struct passwd *pw = getpw_str(username, username_len);

Should we maybe fall back on checking pw_dir in getpwuid() if $HOME isn't set?
��.n��������+%������w��{.n��������n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[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]