[Gpg4win-devel] [gpg4win-Bugs][6528] --homedir string is not passed from gpg2 to new agent instances.

noreply at wald.intevation.org noreply at wald.intevation.org
Thu Apr 24 20:22:20 CEST 2014


Bugs item #6528, was opened at 2014-04-24 18:22 by Eric Toombs
You can respond by visiting: 
https://wald.intevation.org/tracker/?func=detail&atid=126&aid=6528&group_id=11

Status: Open
Priority: 3
Submitted By: Eric Toombs (ewtoombs)
Assigned to: Nobody (None)
Summary: --homedir string is not passed from gpg2 to new agent instances. 
Hardware: PC
Product: None
Operating System: Windows XP
Component: GnuPG
Version: 2.2.0
Severity: normal
Resolution: None
URL: 


Initial Comment:
This is what happens when gpg2 is called with an alternate homedir and no agent is running already. (Personal details from the default key chosen have been removed. md5sum.exe was chosen to be signed because it happened to be in the same directory as gpg2.)

C:\Program Files\GNU\GnuPG>gpg2 --homedir H:/.gnupg -s md5sum.exe

You need a passphrase to unlock the secret key for
user: "Name <email at address.com>"
4096-bit RSA key, ID FFFFFFFF, created 1970-01-01

gpg: can't connect to the agent: IPC connect call failed
gpg: problem with the agent: No agent running
gpg: no default secret key: Operation cancelled
gpg: signing failed: Operation cancelled

C:\Program Files\GNU\GnuPG>

If I manually start the GPG agent with the correct homedir like so:

C:\Program Files\GNU\GnuPG>gpg-agent.exe --daemon --homedir H:/.gnupg
set GPG_AGENT_INFO=H:/.gnupg/S.gpg-agent;2500;1
gpg-agent[2500]: gpg-agent (GnuPG) 2.0.22 started
gpg-agent[2500]: DBG: returning notify handle 00000754

Then do the same command, it works:

C:\Program Files\GNU\GnuPG>gpg2 --homedir H:/.gnupg -s md5sum.exe

You need a passphrase to unlock the secret key for
user: "Name <email at address.com>"
4096-bit RSA key, ID FFFFFFFF, created 1970-01-01

File `md5sum.exe.gpg' exists. Overwrite? (y/N) y

C:\Program Files\GNU\GnuPG>

Clearly, if the agent is not already running, gpg2 will not pass the --homedir option to the new instance of the agent it creates. As a temporary workaround, setting the homedir in the registry passes it to all gpg programs:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\GNU\GnuPG]
"HomeDir"="H:\\.gnupg"

This is not ideal, though, because --homedir is still broken. Either --homedir should be fixed, or it should be removed outright and replaced officially with the registry setting.

----------------------------------------------------------------------

You can respond by visiting: 
https://wald.intevation.org/tracker/?func=detail&atid=126&aid=6528&group_id=11


More information about the Gpg4win-devel mailing list