aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/dirmngr.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-07-25 10:52:33 +0000
committerWerner Koch <[email protected]>2017-07-25 11:04:18 +0000
commit0ef50340ef68b2541d9a1aafa71f5400aef4dc7e (patch)
treec1820de11f6c1fce5ff79fa8c09a14966e1fc823 /dirmngr/dirmngr.c
parentcommon: New functions gnupg_daemon_rootdir and gnupg_chdir. (diff)
downloadgnupg-0ef50340ef68b2541d9a1aafa71f5400aef4dc7e.tar.gz
gnupg-0ef50340ef68b2541d9a1aafa71f5400aef4dc7e.zip
w32: Also change the directory on daemon startup.
* agent/gpg-agent.c (main): Always to the chdir. * dirmngr/dirmngr.c (main): Ditto. * scd/scdaemon.c (main): Ditto. -- Note that only dirmngr did not call the chdir with --no-detach. thus we kept it this way. Tested gpg-agent by checking the properties shown by procexp. Gnupg-bug-id: 2670 Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/dirmngr.c')
-rw-r--r--dirmngr/dirmngr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index 436c8080b..5f3a4cd18 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -1351,15 +1351,18 @@ main (int argc, char **argv)
log_set_prefix (NULL, oldflags | GPGRT_LOG_RUN_DETACHED);
opt.running_detached = 1;
+ }
+#endif
+
+ if (!nodetach )
+ {
if (gnupg_chdir (gnupg_daemon_rootdir ()))
{
log_error ("chdir to '%s' failed: %s\n",
gnupg_daemon_rootdir (), strerror (errno));
dirmngr_exit (1);
}
-
}
-#endif
thread_init ();
cert_cache_init (hkp_cacert_filenames);