GNOME Bugzilla – Bug 585535
seahorse-agent should copy skeleton gpg.conf instead of creating empty one
Last modified: 2020-06-06 08:52:19 UTC
Please describe the problem: Reported on Launchpad: https://bugs.edge.launchpad.net/bugs/345727 "When gpg is first run, it's supposed to copy /usr/share/gnupg/options.skel into ~/.gnupg/gpg.conf however seahorse-agent is part of the default ubuntu-desktop session. Seahorse-agent writes an empty file there on its first run. This means "use-agent" isn't in there. If the user then installs kubuntu-desktop, seahorse-agent will still run instead of gpg-agent. Net effect, if the following sequence of events occurs: 1. User installs Ubuntu 2. User logs into a GNOME session in Ubuntu 3. User installs kubuntu-desktop 4. User logs into KDE and uses KMail The result is: seahorse-agent (which is not compatible with KMail) runs instead of gpg-agent (which is compatible) KMail hangs when told to sign an email, finally throwing an error saying it couldn't get the passphrase This is fixed by having use-agent in ~/.gnupg/gpg.conf...in other words, by having the skeleton file there instead of an empty file. If this is the case, seahorse-agent still runs in GNOME but gpg-agent runs in KDE, allowing KMail to function properly." Attached patch from Mackenzie Morgan fixes that. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Created attachment 136406 [details] [review] patch fixing the issue
Andreas, Do you know if the file location is Ubuntu specific or not? The file should get changed, but we need to know if it's in the same place on other distros. The patch should keep the assert checking of err and probably doesn't need to read in the contents first since if the file exists the find_config function would have already returned and g_file_set_contents would over write it anyway.
If we use gpgconf[1], that can take care of setting the defaults automatically, and Seahorse doesn't have to worry where the skeleton file comes from. [1] http://www.gnupg.org/documentation/manuals/gnupg/gpgconf.html In Debian at least, gpgconf is in the gnupg2 package.
I think we just need to add some extra checks before genning our defualt config. Something like 1. Check for gpgconf 2. Check for gpgconf.skel 3. Create seahorse default
seahorse-plugins is not under active development anymore: https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/257 It had its last code changes many years ago: https://gitlab.gnome.org/GNOME/seahorse-plugins/-/commits/master Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this ticket (or rather transfer the project to GNOME Gitlab, as GNOME Bugzilla is deprecated) if anyone takes the responsibility for active development again.