Page MenuHome GnuPG

Gpg4win does not kill all gpg-agents on update
Closed, ResolvedPublic

Description

While running gpg4win uninstaller there comes up a "gpg-connect-agent.exe"
command window for some seconds. Please prevent this window.

Tested with gpg4win 2.2.6

(Original reported from https://roundup.kolab.org/issue4465)


Edit: Changed the title to "Gpg4win does not kill all agents on update" because the Console windows are gone but the problem remains that gpg-agent is not fully / properly killed on update.

Revisions and Commits

Event Timeline

Werner: Is there a good reason that gpg-agent has to be called with
gpg-connect-agent?

I see several problems with that:

  • Multiple Agents in different homedirs. Not really a real world problem but

happens regularly for me in testing.

  • Wasting time if no agent is running as it starts an agent just to quit it.
  • Multiple users.

And if this fails we can't really handle the error anymore in Gpg4win as we just
call the gnupg-2.1 installer as a subprocess and won't see it if that installer
want's the user to restart.

Do you strongly object to just calling a TerminateProcess on all gpg-agent's we
can access in the uninstallation? This would remove that window and work more
robustly imo.

I've started doing this for GPA and Kleopatra in gpg4win (rev. 929ebdc5-929d94b)
Should I write a similar patch for the GnuPG-2.1 installer?

Ah nevermind, gpg-agent should probably do cleanups on shutdown to avoid leaking
secrets in memory. So TerminateProcess is no good for this. :-(

I wonder though, how is such a cleanup handled currently on Windows? E.g. If a
user logs out. I would expect some kind of Window Message support but I don't
see any. Only some dead / dummy code in w32main.c.

I still wonder how to handle killing gpg-agent on update on Windows.

@werner This is sometimes still an issue. E.g. if the agent is started with a different homedir. Is it ok to just use TerminateProcess on any gpg-agent?

Or should we trigger some cleanup somehow. And if so how is the cleanup handled in case a user logs out?

aheinecke renamed this task from Gpg4win uninstaller shows gpg-connect-agent cmd window to Gpg4win does not kill all gpg-agents on update.Dec 13 2017, 8:02 AM
aheinecke updated the task description. (Show Details)

Long enough time to object to just killing stuff. We are killers now. -> Resolved.