Re: [PATCH] Prefer getenv("HOME") to find the UNIX home directory

Поиск
Список
Период
Сортировка
От Anders Kaseorg
Тема Re: [PATCH] Prefer getenv("HOME") to find the UNIX home directory
Дата
Msg-id d75e02b2-59a8-17d8-9eb2-c22e5ced7ebd@mit.edu
обсуждение исходный текст
Ответ на Re: [PATCH] Prefer getenv("HOME") to find the UNIX home directory  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 1/9/22 13:04, Tom Lane wrote:
> 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.

Obviously a user who intentionally breaks their environment should 
expect problems.  But what I’m saying is that a user could have written 
a script that unsets HOME by *accident* while intending to clear *other* 
things out of the environment.  They might have developed it by starting 
with an empty environment and adding back the minimal set of variables 
they needed to get something to work.  Since most programs (including 
most libcs and shells) do in fact fall back to getpwuid when HOME is 
unset, they may not have noticed an unset HOME as a problem.  Unsetting 
HOME does not, in practice, prevent most programs from finding stuff in 
your home directory.

Anders



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] Prefer getenv("HOME") to find the UNIX home directory
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: [PATCH] Prefer getenv("HOME") to find the UNIX home directory