diff options
Diffstat (limited to 'agent')
-rw-r--r-- | agent/ChangeLog | 9 | ||||
-rw-r--r-- | agent/gpg-agent.c | 14 |
2 files changed, 19 insertions, 4 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog index 176f4fa41..830b4c2c1 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,12 @@ +2010-05-03 Werner Koch <[email protected]> + + * gpg-agent.c (check_own_socket_thread): Do not release SOCKNAME + too early. + +2010-04-30 Werner Koch <[email protected]> + + * gpg-agent.c (main): Add command --use-standard-socket-p. + 2010-04-26 Werner Koch <[email protected]> * gpg-agent.c (create_server_socket) [W32]: Also check for EEXIST. diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index e30adb45b..89027b541 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -62,6 +62,7 @@ enum cmd_and_opt_values oNoVerbose = 500, aGPGConfList, aGPGConfTest, + aUseStandardSocketP, oOptions, oDebug, oDebugAll, @@ -98,6 +99,7 @@ enum cmd_and_opt_values oEnablePassphraseHistory, oUseStandardSocket, oNoUseStandardSocket, + oStandardSocketP, oFakedSystemTime, oIgnoreCacheForSigning, @@ -116,6 +118,7 @@ static ARGPARSE_OPTS opts[] = { { aGPGConfList, "gpgconf-list", 256, "@" }, { aGPGConfTest, "gpgconf-test", 256, "@" }, + { aUseStandardSocketP, "use-standard-socket-p", 256, "@" }, { 301, NULL, 0, N_("@Options:\n ") }, @@ -748,6 +751,7 @@ main (int argc, char **argv ) { case aGPGConfList: gpgconf_list = 1; break; case aGPGConfTest: gpgconf_list = 2; break; + case aUseStandardSocketP: gpgconf_list = 3; break; case oBatch: opt.batch=1; break; case oDebugWait: debug_wait = pargs.r.ret_int; break; @@ -858,9 +862,11 @@ main (int argc, char **argv ) log_debug ("... okay\n"); } - if (gpgconf_list == 2) + if (gpgconf_list == 3) + agent_exit (!use_standard_socket); + else if (gpgconf_list == 2) agent_exit (0); - if (gpgconf_list) + else if (gpgconf_list) { char *filename; char *filename_esc; @@ -2097,7 +2103,6 @@ check_own_socket_thread (void *arg) check_own_socket_running++; rc = assuan_new (&ctx); - xfree (sockname); if (rc) { log_error ("can't allocate assuan context: %s\n", gpg_strerror (rc)); @@ -2133,6 +2138,7 @@ check_own_socket_thread (void *arg) xfree (buffer); leave: + xfree (sockname); if (ctx) assuan_release (ctx); if (rc) @@ -2153,7 +2159,7 @@ check_own_socket_thread (void *arg) /* Check whether we are still listening on our own socket. In case another gpg-agent process started after us has taken ownership of - our socket, we woul linger around without any real taks. Thus we + our socket, we woulf linger around without any real task. Thus we better check once in a while whether we are really needed. */ static void check_own_socket (void) |