Re: [BUGS] More SSL questions..

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <mha(at)sollentuna(dot)net>
Cc: <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [BUGS] More SSL questions..
Date: 2005-01-05 12:47:18
Message-ID: 3571.24.211.141.25.1104929238.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-01-05 15:12:18 Re: [pgsql-hackers-win32] More SSL questions..
Previous Message Bazsi 2005-01-05 11:38:57 BUG #1373: constraints, rules

Browse pgsql-hackers by date

  From Date Subject
Next Message Weiping 2005-01-05 13:18:40 Re: [HACKERS] Final call for translation updates
Previous Message Alin Vaida 2005-01-05 09:23:49 Re: [HACKERS] Final call for translation updates

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2005-01-05 15:12:18 Re: [pgsql-hackers-win32] More SSL questions..
Previous Message Magnus Hagander 2005-01-05 08:53:14 Re: [pgsql-hackers-win32] More SSL questions..