common: Remove homedir arg from start_new_{dirmngr,gpg_agent}.
authorWerner Koch <wk@gnupg.org>
Tue, 7 Jun 2016 11:09:00 +0000 (13:09 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 7 Jun 2016 11:09:00 +0000 (13:09 +0200)
* common/asshelp.c (start_new_gpg_agent): Remove arg 'homedir' in
favor of gnupg_homedir ().  Change all callers.
(start_new_dirmngr): Ditto.
* common/get-passphrase.c (gnupg_prepare_get_passphrase): Remove arg
'homedir'.

Signed-off-by: Werner Koch <wk@gnupg.org>
agent/protect-tool.c
common/asshelp.c
common/asshelp.h
common/get-passphrase.c
common/get-passphrase.h
dirmngr/dirmngr-client.c
g10/call-agent.c
g10/call-dirmngr.c
sm/call-agent.c
sm/call-dirmngr.c
tools/gpg-connect-agent.c

index fdb7913..c2bf87d 100644 (file)
@@ -630,7 +630,6 @@ main (int argc, char **argv )
   /* Set the information which can't be taken from envvars.  */
   gnupg_prepare_get_passphrase (GPG_ERR_SOURCE_DEFAULT,
                                 opt.verbose,
-                                gnupg_homedir (),
                                 opt_agent_program,
                                 NULL, NULL, NULL);
 
index f2b4402..f89d1d5 100644 (file)
@@ -351,7 +351,6 @@ unlock_spawning (lock_spawn_t *lock, const char *name)
 gpg_error_t
 start_new_gpg_agent (assuan_context_t *r_ctx,
                      gpg_err_source_t errsource,
-                     const char *homedir,
                      const char *agent_program,
                      const char *opt_lc_ctype,
                      const char *opt_lc_messages,
@@ -375,7 +374,7 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
       return err;
     }
 
-  sockname = make_absfilename (homedir, GPG_AGENT_SOCK_NAME, NULL);
+  sockname = make_absfilename (gnupg_homedir (), GPG_AGENT_SOCK_NAME, NULL);
   err = assuan_socket_connect (ctx, sockname, 0, 0);
   if (err && autostart)
     {
@@ -418,7 +417,7 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
       /* We better pass an absolute home directory to the agent just
          in case gpg-agent does not convert the passed name to an
          absolute one (which it should do).  */
-      abs_homedir = make_absfilename_try (homedir, NULL);
+      abs_homedir = make_absfilename_try (gnupg_homedir (), NULL);
       if (!abs_homedir)
         {
           gpg_error_t tmperr = gpg_err_make (errsource,
@@ -455,7 +454,7 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
       argv[i++] = "--daemon";
       argv[i++] = NULL;
 
-      if (!(err = lock_spawning (&lock, homedir, "agent", verbose))
+      if (!(err = lock_spawning (&lock, gnupg_homedir (), "agent", verbose))
           && assuan_socket_connect (ctx, sockname, 0, 0))
         {
           err = gnupg_spawn_process_detached (program? program : agent_program,
@@ -538,7 +537,6 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
 gpg_error_t
 start_new_dirmngr (assuan_context_t *r_ctx,
                    gpg_err_source_t errsource,
-                   const char *homedir,
                    const char *dirmngr_program,
                    int autostart,
                    int verbose, int debug,
@@ -605,7 +603,7 @@ start_new_dirmngr (assuan_context_t *r_ctx,
         status_cb (status_cb_arg, STATUS_PROGRESS,
                    "starting_dirmngr ? 0 0", NULL);
 
-      abs_homedir = make_absfilename (homedir, NULL);
+      abs_homedir = make_absfilename (gnupg_homedir (), NULL);
       if (!abs_homedir)
         {
           gpg_error_t tmperr = gpg_err_make (errsource,
@@ -641,7 +639,7 @@ start_new_dirmngr (assuan_context_t *r_ctx,
          TRY_SYSTEM_DAEMON should never be true because
          dirmngr_user_socket_name() won't return NULL.  */
 
-      if (!(err = lock_spawning (&lock, homedir, "dirmngr", verbose))
+      if (!(err = lock_spawning (&lock, gnupg_homedir (), "dirmngr", verbose))
           && assuan_socket_connect (ctx, sockname, 0, 0))
         {
           err = gnupg_spawn_process_detached (dirmngr_program, argv, NULL);
@@ -678,7 +676,6 @@ start_new_dirmngr (assuan_context_t *r_ctx,
       xfree (abs_homedir);
     }
 #else
-  (void)homedir;
   (void)dirmngr_program;
   (void)verbose;
   (void)status_cb;
index 20414bd..4eb1d92 100644 (file)
@@ -54,7 +54,6 @@ send_pinentry_environment (assuan_context_t ctx,
 gpg_error_t
 start_new_gpg_agent (assuan_context_t *r_ctx,
                      gpg_err_source_t errsource,
-                     const char *homedir,
                      const char *agent_program,
                      const char *opt_lc_ctype,
                      const char *opt_lc_messages,
@@ -68,7 +67,6 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
 gpg_error_t
 start_new_dirmngr (assuan_context_t *r_ctx,
                    gpg_err_source_t errsource,
-                   const char *homedir,
                    const char *dirmngr_program,
                    int autostart, int verbose, int debug,
                    gpg_error_t (*status_cb)(ctrl_t, int, ...),
index f1517fb..8f3137b 100644 (file)
@@ -47,7 +47,6 @@ static struct
 {
   gpg_err_source_t errsource;
   int verbosity;
-  const char *homedir;
   const char *agent_program;
   const char *lc_ctype;
   const char *lc_messages;
@@ -62,7 +61,6 @@ static struct
 void
 gnupg_prepare_get_passphrase (gpg_err_source_t errsource,
                               int verbosity,
-                              const char *homedir,
                               const char *agent_program,
                               const char *opt_lc_ctype,
                               const char *opt_lc_messages,
@@ -70,7 +68,6 @@ gnupg_prepare_get_passphrase (gpg_err_source_t errsource,
 {
   agentargs.errsource          = errsource;
   agentargs.verbosity          = verbosity;
-  agentargs.homedir            = homedir;
   agentargs.agent_program      = agent_program;
   agentargs.lc_ctype           = opt_lc_ctype;
   agentargs.lc_messages        = opt_lc_messages;
@@ -93,7 +90,6 @@ start_agent (void)
 
   err = start_new_gpg_agent (&agent_ctx,
                              agentargs.errsource,
-                             agentargs.homedir,
                              agentargs.agent_program,
                              agentargs.lc_ctype,
                              agentargs.lc_messages,
index a69262f..7e5cac0 100644 (file)
@@ -34,7 +34,6 @@
 
 void gnupg_prepare_get_passphrase (gpg_err_source_t errsource,
                                    int verbosity,
-                                   const char *homedir,
                                    const char *agent_program,
                                    const char *opt_lc_ctype,
                                    const char *opt_lc_messages,
index c6a33d7..9b004cc 100644 (file)
@@ -298,7 +298,6 @@ main (int argc, char **argv )
 
   err = start_new_dirmngr (&ctx,
                            GPG_ERR_SOURCE_DEFAULT,
-                           default_homedir (),
                            opt.dirmngr_program
                              ? opt.dirmngr_program
                              : gnupg_module_name (GNUPG_MODULE_NAME_DIRMNGR),
index ad4e67c..46dfd57 100644 (file)
@@ -303,7 +303,6 @@ start_agent (ctrl_t ctrl, int for_card)
     {
       rc = start_new_gpg_agent (&agent_ctx,
                                 GPG_ERR_SOURCE_DEFAULT,
-                                gnupg_homedir (),
                                 opt.agent_program,
                                 opt.lc_ctype, opt.lc_messages,
                                 opt.session_env,
index f9a0e19..75a7f46 100644 (file)
@@ -177,7 +177,6 @@ create_context (ctrl_t ctrl, assuan_context_t *r_ctx)
   *r_ctx = NULL;
   err = start_new_dirmngr (&ctx,
                            GPG_ERR_SOURCE_DEFAULT,
-                           gnupg_homedir (),
                            opt.dirmngr_program,
                            opt.autostart, opt.verbose, DBG_IPC,
                            NULL /*gpg_status2*/, ctrl);
index 09ae359..c7facbb 100644 (file)
@@ -133,7 +133,6 @@ start_agent (ctrl_t ctrl)
     {
       rc = start_new_gpg_agent (&agent_ctx,
                                 GPG_ERR_SOURCE_DEFAULT,
-                                gnupg_homedir (),
                                 opt.agent_program,
                                 opt.lc_ctype, opt.lc_messages,
                                 opt.session_env,
index a3b9ca8..7e26c3a 100644 (file)
@@ -248,7 +248,7 @@ start_dirmngr_ext (ctrl_t ctrl, assuan_context_t *ctx_r)
      to take care of the implicit option sending caching. */
 
   err = start_new_dirmngr (&ctx, GPG_ERR_SOURCE_DEFAULT,
-                           gnupg_homedir (), opt.dirmngr_program,
+                           opt.dirmngr_program,
                            opt.autostart, opt.verbose, DBG_IPC,
                            gpgsm_status2, ctrl);
   if (!opt.autostart && gpg_err_code (err) == GPG_ERR_NO_DIRMNGR)
index eb8b51f..0eb43fb 100644 (file)
@@ -2208,7 +2208,6 @@ start_agent (void)
   if (opt.use_dirmngr)
     err = start_new_dirmngr (&ctx,
                              GPG_ERR_SOURCE_DEFAULT,
-                             gnupg_homedir (),
                              opt.dirmngr_program,
                              opt.autostart,
                              !opt.quiet, 0,
@@ -2216,7 +2215,6 @@ start_agent (void)
   else
     err = start_new_gpg_agent (&ctx,
                                GPG_ERR_SOURCE_DEFAULT,
-                               gnupg_homedir (),
                                opt.agent_program,
                                NULL, NULL,
                                session_env,