Anders Kaseorg <andersk@mit.edu> writes:
> On 1/9/22 10:59, Tom Lane wrote:
>> Given the POSIX requirements, it's basically impossible to believe
>> that there are interesting cases where $HOME isn't set. Thus, it
>> seems to me that keeping the getpwuid calls will just mean carrying
>> untestable dead code, so we should simplify matters by ripping
>> those out and *only* consulting $HOME.
> While POSIX requires that the login program put you in a conforming
> environment, nothing stops the user from building a non-conforming
> environment, such as with ‘env -i’. One could argue that such a user
> deserves whatever broken behavior they might get. But to me it seems
> prudent to continue working there if it worked before.
The only case that the v1 patch helps such a user for is if they
unset HOME or set it precisely to ''. If they set it to anything
else, it's still broken from their perspective. So I do not find
that that argument holds water.
Moreover, ISTM that the only plausible use-case for unsetting HOME
is to prevent programs from finding stuff in your home directory.
What would be the point otherwise? So it's pretty hard to envision
a case where somebody is actually using, and happy with, the
behavior you argue we ought to keep.
>> The v1 patch also neglects the matter of documentation.
> The reason I didn’t change the documentation is that this is already
> what “~” is supposed to mean according to POSIX and common
> implementations.
The point here is precisely that we're changing what *we* think ~
means. I don't think we can just leave the docs unchanged.
regards, tom lane