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

From Andrew Dunstan
Subject Re: [BUGS] More SSL questions..
Date
Msg-id 3571.24.211.141.25.1104929238.squirrel@www.dunslane.net
Whole thread Raw
Responses Re: [BUGS] More SSL questions..
List pgsql-hackers-win32
Magnus Hagander said:

> So, a quick implementation (not tested, but shouldn't be too hard) of
> your functino would be:
> static bool pqGetHomeDirectory(char *buf, int bufsize)
> {
>     char tmppath[MAX_PATH+16]; /* Add 16 chars for "/.postgresql/"
> */
>     ZeroMemory(tmppath,sizeof(tmppath));
>     if (!SHGetSpecialFolderPath(NULL, tmppath, CSIDL_APPDATA,
> FALSE)) {
>         return FALSE;
>     strcat(tmppath,"/.postgresql/");
>     if (strlen(tmppath) > bufsize)
>         return FALSE; /* Better than returning a chopped-off
> path */
>     strcpy(buf, tmppath);
>     return TRUE;
> }
>
> You're going to have to add #include <shlobj.h> to the file as well.
>


Excellent. I would suggest that we allow an environment variable PGHOME to
override this on all platforms, falling back to the above on Windows and
HOME elsewhere.

cheers

andrew



pgsql-hackers-win32 by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: shmmem error on initdb
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] More SSL questions..