GnuPG 2.1 not reading from Windows registry

Alexander Strobel Alexander.Strobel at giepa.de
Fri Apr 7 14:52:57 CEST 2017


There seems to be a problem in GnuPG 2.1.x when reading from the Windows
registry.

The default_homedir() function in "homedir.c" uses the following code to
read from the registry:
tmp = read_w32_registry_string (NULL,
GNUPG_REGISTRY_DIR,
"HomeDir");

GNUPG_REGISTRY_DIR is defined with leading back slashes.
If you remove the leading back slashes passed to
read_w32_registry_string the correct value is returned.

There is a thread describes problems with leading back slashes:
https://groups.google.com/forum/#!topic/microsoft.public.vc.language/vy_faecyIkM

> For RegCreateKeyEx, the documentation says:
> The subkey name specified by lpSubKey must not begin with the backslash
> character ('\'). If it does, ERROR_BAD_PATHNAME is returned.
>
> Windows Me/98/95:  Beginning backslash characters in the subkey name
> specified by lpSubKey are ignored.
> I think, the same requirement applies to RegOpenKeyEx, even though
it's not
> mentioned.


Best regards
Alex Strobel
gpg4o.com



More information about the Gnupg-devel mailing list