GNOME Bugzilla – Bug 454469
Crashes when ssh key is added and gnupg-agent is running
Last modified: 2007-07-07 13:59:59 UTC
When gnupg-agent is enabled and seahorse is used for managing ssh keys, it crashes as soon as a key is added because the seahorse-agent cache is not initialised. Steps to reproduce: 1. Make sure gnupg-agent is installed and running (check that GPG_AGENT_INFO is in your environment) 2. Run ssh-add to add an ssh key to your agent (seahorse). seahorse-agent dies almost exactly when I have just run ssh-add. This is Debian bug #407800: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=407800 I will attach a patch. Here is an analysis of the bug. Program received signal SIGABRT, Aborted.
+ Trace 146265
Thread NaN (LWP 7812)
Here's what happens. main [0] seahorse_agent_prefork [1] seahorse_agent_init [2] seahorse_agent_cache_init [3] gtk_main { ... } g_timeout_add (update_status) [4] update_status seahorse_agent_status_update seahorse_agent_cache_count g_assert [5] [0] Program starts. [1] seahorse_agent_prefork() detects another GPG agent already running and returns early, leaving seahorse_agent_enabled (global) set to FALSE. [2] seahorse_agent_init() returns immediately because seahorse_agent_enabled was FALSE. [3] seahorse_agent_cache_init() is /not/ called, leaving the global g_cache variable as NULL. [4] A key is added by the user with ssh-add, it gets picked up by seahorse and the update_status timer is installed. [5] The update_status timer is called and asserts because g_cache is NULL.
Created attachment 91333 [details] [review] A fix. This patch fixes the problem by ensuring the g_cache is initialised even when seahorse is not being used as a GPG agent.
I think this is the same as bug #399479 and bug #419019.
Created attachment 91361 [details] [review] Fixes the bug Thanks for looking into the bug. I had to add some stuff to your patch to keep things from breaking when using seahorse-agent as both a gpg and ssh agent and this patch includes them. 2007-07-07 Adam Schreiber <sadam@clemson.edu> * agent/seahorse-agent-cache.c: * agent/seahorse-agent-ssh.c: When only using the ssh portion of seahorse-agent, still init the cache. Patch from Ted Percival. Fixes bug #454469