summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-06-07 13:09:00 +0200
committerWerner Koch <wk@gnupg.org>2016-06-07 13:09:00 +0200
commitfb88f37c40dc156fa0b5bfba4ac85f1e553fd7e9 (patch)
treef5e93187b6c33831bf34e7fd682787e78fdcda14
parentReplace use of opt.homedir by accessor functions. (diff)
downloadgnupg2-fb88f37c40dc156fa0b5bfba4ac85f1e553fd7e9.tar.xz
gnupg2-fb88f37c40dc156fa0b5bfba4ac85f1e553fd7e9.zip
common: Remove homedir arg from start_new_{dirmngr,gpg_agent}.
* 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>
-rw-r--r--agent/protect-tool.c1
-rw-r--r--common/asshelp.c13
-rw-r--r--common/asshelp.h2
-rw-r--r--common/get-passphrase.c4
-rw-r--r--common/get-passphrase.h1
-rw-r--r--dirmngr/dirmngr-client.c1
-rw-r--r--g10/call-agent.c1
-rw-r--r--g10/call-dirmngr.c1
-rw-r--r--sm/call-agent.c1
-rw-r--r--sm/call-dirmngr.c2
-rw-r--r--tools/gpg-connect-agent.c2
11 files changed, 6 insertions, 23 deletions
diff --git a/agent/protect-tool.c b/agent/protect-tool.c
index fdb791373..c2bf87d4a 100644
--- a/agent/protect-tool.c
+++ b/agent/protect-tool.c
@@ -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);
diff --git a/common/asshelp.c b/common/asshelp.c
index f2b4402e1..f89d1d554 100644
--- a/common/asshelp.c
+++ b/common/asshelp.c
@@ -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;
diff --git a/common/asshelp.h b/common/asshelp.h
index 20414bd35..4eb1d9267 100644
--- a/common/asshelp.h
+++ b/common/asshelp.h
@@ -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, ...),
diff --git a/common/get-passphrase.c b/common/get-passphrase.c
index f1517fbfa..8f3137b85 100644
--- a/common/get-passphrase.c
+++ b/common/get-passphrase.c
@@ -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,
diff --git a/common/get-passphrase.h b/common/get-passphrase.h
index a69262f8f..7e5cac087 100644
--- a/common/get-passphrase.h
+++ b/common/get-passphrase.h
@@ -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,
diff --git a/dirmngr/dirmngr-client.c b/dirmngr/dirmngr-client.c
index c6a33d728..9b004cc19 100644
--- a/dirmngr/dirmngr-client.c
+++ b/dirmngr/dirmngr-client.c
@@ -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),
diff --git a/g10/call-agent.c b/g10/call-agent.c
index ad4e67c02..46dfd5779 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -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,
diff --git a/g10/call-dirmngr.c b/g10/call-dirmngr.c
index f9a0e19ff..75a7f4650 100644
--- a/g10/call-dirmngr.c
+++ b/g10/call-dirmngr.c
@@ -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);
diff --git a/sm/call-agent.c b/sm/call-agent.c
index 09ae3594e..c7facbb0d 100644
--- a/sm/call-agent.c
+++ b/sm/call-agent.c
@@ -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,
diff --git a/sm/call-dirmngr.c b/sm/call-dirmngr.c
index a3b9ca86e..7e26c3ada 100644
--- a/sm/call-dirmngr.c
+++ b/sm/call-dirmngr.c
@@ -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)
diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index eb8b51f6b..0eb43fbdd 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -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,