Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-bugs by date

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

pgsql-hackers-win32 by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group