Page MenuHome GnuPG

GnuPG w32: Expand environment variables when reading registry paths
Closed, ResolvedPublic


It is possible to set the homedir through windows registry. But we do not expand environment strings there.

This makes it difficult to set a default for all users as you can only enter absolute paths.
I have a potential customer that wants to move the gnupg homedir into an encrypted subdirectory of the users profile and would need something like "%userprofile%\encrypted_subdir\gnupg" as the GNUPGHOME.

We already do this here:$125
I think the original code from that is from you @werner I only c++ified it a bit to avoid returning a malloced string.

Event Timeline

aheinecke triaged this task as Normal priority.May 6 2021, 12:02 PM
aheinecke created this task.
aheinecke raised the priority of this task from Normal to High.Jun 2 2021, 10:44 AM

Hi Werner, I need this for a potentional customer. And generally I need this in config, too. because in support we have to send customers configuration files which they do not need to edit and variables are important because of file system permissions. But most immedialtely I need this for homedir registry.

Well, we have always expanded envvars in registry values. You need to create the value as an REG_EXPAND_SZ type, though.

aheinecke changed the task status from Open to Testing.Jun 4 2021, 9:39 AM
aheinecke claimed this task.

Apologies,.. I used ctags on read_w32_registry_string and that jumped me to build-aux/speedo/w32/g4wihelp.c which has a read_w32_registry_string that does not expand....
Now I found the w32-reg.c in common which looks completely fine.

I do a test and then close it.

Works. My initial tests also failed because on Windows 64 the registry value has to be placed in the WOW6432NODE


ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jul 24 2023, 2:12 PM