Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)
Date: 2010-12-19 13:06:09
Message-ID: 4D0E0341.2020907@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19/12/2010 8:05 PM, Magnus Hagander wrote:

> Actually, looking through it again just before commit, I can't help
> but think the whole code about loading the DLL from different places
> is unnecessary. The windows DLL search order *always* has the
> directory of the EXE first, followed by either system dirs or CWD
> depending on version.
>
> Any reason not to just call LoadLibrary once?

Good point. The program directory was added to the DLL search path with
Windows XP. On any Windows version that Pg targets you can trust Windows
to load a DLL from the app dir before system32. We don't really care
about win2k/nt4 or 9x, where this is necessary.

It's not a security concern for the reasons already outlined in the
comments in the patch - in brief, because Pg keeps the cwd inside the
datadir, and if someone can write malicious files in there you have big
problems already. If it was a security concern our fallback would be an
attempt to load %WINDIR%\system32\dbghelp.dll by full path, rather than
using an unqualified name to search the path.

So: I agree. We should just let Windows find dbghelp.dll on the normal
search path; building an explicit path isn't necessary.

--
Craig Ringer

Tech-related writing at http://soapyfrogs.blogspot.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2010-12-19 13:10:58 Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)
Previous Message Craig Ringer 2010-12-19 12:57:00 Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)