diff options
author | Werner Koch <[email protected]> | 2017-07-25 10:52:33 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-07-25 11:04:18 +0000 |
commit | 0ef50340ef68b2541d9a1aafa71f5400aef4dc7e (patch) | |
tree | c1820de11f6c1fce5ff79fa8c09a14966e1fc823 /agent | |
parent | common: New functions gnupg_daemon_rootdir and gnupg_chdir. (diff) | |
download | gnupg-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 'agent')
-rw-r--r-- | agent/gpg-agent.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index ef351749f..36c05bcf1 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -1708,13 +1708,6 @@ main (int argc, char **argv ) opt.running_detached = 1; } - if (gnupg_chdir (gnupg_daemon_rootdir ())) - { - log_error ("chdir to '%s' failed: %s\n", - gnupg_daemon_rootdir (), strerror (errno)); - exit (1); - } - { struct sigaction sa; @@ -1725,6 +1718,13 @@ main (int argc, char **argv ) } #endif /*!HAVE_W32_SYSTEM*/ + if (gnupg_chdir (gnupg_daemon_rootdir ())) + { + log_error ("chdir to '%s' failed: %s\n", + gnupg_daemon_rootdir (), strerror (errno)); + exit (1); + } + log_info ("%s %s started\n", strusage(11), strusage(13) ); handle_connections (fd, fd_extra, fd_browser, fd_ssh); assuan_sock_close (fd); |