aboutsummaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
Diffstat (limited to 'scd')
-rw-r--r--scd/command.c6
-rw-r--r--scd/scdaemon.c14
-rw-r--r--scd/scdaemon.h1
3 files changed, 9 insertions, 12 deletions
diff --git a/scd/command.c b/scd/command.c
index 72ff1326a..a4a2ba056 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -2281,7 +2281,7 @@ update_reader_status_file (int set_card_removed_flag)
depends on how client sessions will associate the reader
status with their session. */
snprintf (templ, sizeof templ, "reader_%d.status", vr->slot);
- fname = make_filename (opt.homedir, templ, NULL );
+ fname = make_filename (gnupg_homedir (), templ, NULL );
fp = fopen (fname, "w");
if (fp)
{
@@ -2300,7 +2300,7 @@ update_reader_status_file (int set_card_removed_flag)
char *homestr, *envstr;
gpg_error_t err;
- homestr = make_filename (opt.homedir, NULL);
+ homestr = make_filename (gnupg_homedir (), NULL);
if (gpgrt_asprintf (&envstr, "GNUPGHOME=%s", homestr) < 0)
log_error ("out of core while building environment\n");
else
@@ -2323,7 +2323,7 @@ update_reader_status_file (int set_card_removed_flag)
(status & 2)? "PRESENT": "NOCARD");
args[8] = NULL;
- fname = make_filename (opt.homedir, "scd-event", NULL);
+ fname = make_filename (gnupg_homedir (), "scd-event", NULL);
err = gnupg_spawn_process_detached (fname, args, envs);
if (err && gpg_err_code (err) != GPG_ERR_ENOENT)
log_error ("failed to run event handler '%s': %s\n",
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index e8218ca9c..576dbf976 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -463,8 +463,6 @@ main (int argc, char **argv )
if (shell && strlen (shell) >= 3 && !strcmp (shell+strlen (shell)-3, "csh") )
csh_style = 1;
- opt.homedir = default_homedir ();
-
/* Check whether we have a config file on the commandline */
orig_argc = argc;
orig_argv = argv;
@@ -484,7 +482,7 @@ main (int argc, char **argv )
else if (pargs.r_opt == oNoOptions)
default_config = 0; /* --no-options */
else if (pargs.r_opt == oHomedir)
- opt.homedir = pargs.r.ret_str;
+ gnupg_set_homedir (pargs.r.ret_str);
}
/* initialize the secure memory. */
@@ -497,7 +495,7 @@ main (int argc, char **argv )
if (default_config)
- configname = make_filename (opt.homedir, SCDAEMON_NAME EXTSEP_S "conf",
+ configname = make_filename (gnupg_homedir (), SCDAEMON_NAME EXTSEP_S "conf",
NULL );
@@ -582,7 +580,7 @@ main (int argc, char **argv )
case oNoGreeting: nogreeting = 1; break;
case oNoVerbose: opt.verbose = 0; break;
case oNoOptions: break; /* no-options */
- case oHomedir: opt.homedir = pargs.r.ret_str; break;
+ case oHomedir: gnupg_set_homedir (pargs.r.ret_str); break;
case oNoDetach: nodetach = 1; break;
case oLogFile: logfile = pargs.r.ret_str; break;
case oCsh: csh_style = 1; break;
@@ -674,8 +672,8 @@ main (int argc, char **argv )
if (config_filename)
filename = xstrdup (config_filename);
else
- filename = make_filename (opt.homedir, SCDAEMON_NAME EXTSEP_S "conf",
- NULL);
+ filename = make_filename (gnupg_homedir (),
+ SCDAEMON_NAME EXTSEP_S "conf", NULL);
filename_esc = percent_escape (filename, NULL);
es_printf ("%s-%s.conf:%lu:\"%s\n",
@@ -1044,7 +1042,7 @@ create_socket_name (char *standard_name)
{
char *name;
- name = make_filename (opt.homedir, standard_name, NULL);
+ name = make_filename (gnupg_homedir (), standard_name, NULL);
if (strchr (name, PATHSEP_C))
{
log_error (("'%s' are not allowed in the socket name\n"), PATHSEP_S);
diff --git a/scd/scdaemon.h b/scd/scdaemon.h
index 1a95ba7f6..448cb8487 100644
--- a/scd/scdaemon.h
+++ b/scd/scdaemon.h
@@ -51,7 +51,6 @@ struct
int quiet; /* Be as quiet as possible. */
int dry_run; /* Don't change any persistent data. */
int batch; /* Batch mode. */
- const char *homedir; /* Configuration directory name. */
const char *ctapi_driver; /* Library to access the ctAPI. */
const char *pcsc_driver; /* Library to access the PC/SC system. */
const char *reader_port; /* NULL or reder port to use. */