GnuPG and Windows Registry variables

Ryan Malayter rmalayter@bai.org
Fri Sep 6 08:47:05 2002


For some reason, Win32 ports of GnuPG 1.1.91 doesn't appear to handle
the REG_EXPAND_SZ registry data type correctly.

For example, I want to change the HKLM\Software\GNU\GnuPG\HomeDir
setting from a static string data type to a REG_EXPAND_SZ type, with
value "C:/Documents and Settings/%USERNAME%/Application Data/GnuPG".
This should, in theory, allow multiple users to have individualized
options for GnuPG on the same machine. The %USERNAME% is supposed to be
replaced by the current user when the value is read from the registry,
returning a customized user's Windows 2000 profile path for each user.

I thought Windows would handle this variable replacement itself, because
it works transparently for several other programs I use frequently.
However, when I change HomeDir to REG_EXPAND_SZ with the value mentioned
above, I get these errors from GnuPG:

gpg: keyblock resource `C:/Documents and Settings/%USERNAME%/Application
Data/GnuPG\secring.gpg': file open error
gpg: keyblock resource `C:/Documents and Settings/%USERNAME%/Application
Data/GnuPG\pubring.gpg': file open error

Obviously, %USERNAME% isn't getting replaced as it theoretically should.
I'd really like to deploy GnuPG/WinPT to our user workstations, but many
are multi-user machines, and I cannot expose the same key rings to both
users. This issue is my only remaining stumbling block; I've got
everything else working well enough.=20

Perhaps GnuPG is reading the registry in some way that doesn't
automatically expand the variable? Does anybody have a clue about how I
might fix this issue?=20

Thank you,

Ryan Malayter
Sr. Network & Database Administrator
Bank Administration Institute
Chicago, Illinois, USA
PGP Key: http://www.malayter.com/pgp-public.txt
:::::::::::::::::::::::::::::::
Politics is supposed to be the second-oldest profession. I have come to
realize that it bears a very close resemblance to the first.=20
     -Ronald Reagan