[patch] Fix g10/exec.c (make_tempdir) [_WIN32] not properly handling GetTempPath

David Shaw dshaw at jabberwocky.com
Sat May 27 03:44:03 CEST 2006


On Thu, May 25, 2006 at 11:23:17PM +0100, Israel G. Lugo wrote:

> > This is the problem.  I don't agree with your solution.  I don't think
> > you need multiple passes.
> Very well, I can agree to that, and it does make good sense as if we
> start worrying about external manipulation then we have much worse
> things to worry about than that. Please see the revised patch I am
> offering in this email.

The patch looks better now, but something about this still bothers me.
I still think there is something wrong.  Microsoft's own site insists
that this is incorrect.  Read:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp

Regular paths (as opposed to Unicode) are limited to 260 bytes -
MAX_PATH.  Even with this patch, if the user managed to specify a
temporary directory longer than 260 bytes, we still wouldn't be able
to write a file into it.

GnuPG doesn't use the Unicode functions in Win32.  It would be
decidedly non-trivial to change over all file handling to use wchar_t
everywhere, especially as it would render a lot of code non-portable.

David



More information about the Gnupg-devel mailing list