Re: [pgsql-hackers-win32] [BUGS] More SSL questions.. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [pgsql-hackers-win32] [BUGS] More SSL questions..
Date
Msg-id 27860.1104937938@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
"Magnus Hagander" <mha@sollentuna.net> writes:
> Tom also wrote:
>> Now that I look at it, there are several places that are depending on
>> getenv("HOME") or getenv("USERPROFILE") (on Windows) as the meaning of
>> "home directory".  In particular ~/.pgpass is sought there, and psql
>> also uses get_home_path in a lot of places.

>> Seems like we should be consistent about this --- either we trust
>> $HOME or we don't.

> Don't trust $HOME on win32. There is no such thing.It's set by Cygwin,
> and it's set by the MingW shell, but it's not set by Windows. HOMEDRIVE,
> HOMEPATH and HOMESHARE are set, but not HOME.

> You can trust USERPROFILE in NT based OSes. Not sure about 9x. Using the
> API above is a much nicer way of doing it.

We are using $USERPROFILE, not $HOME, on Windows, but I think Magnus is
right: we shouldn't be doing that at all.  If I don't hear any
objections soon, I'm going to replace get_home_path() with code that
uses getpwuid (on Unix) or SHGetSpecialFolderPath (on Windows).

            regards, tom lane

pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: rule system oddity
Next
From: Robert Treat
Date:
Subject: Re: Where are the docs