summaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>2017-07-24 16:31:55 +0200
committerMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>2017-07-24 16:31:55 +0200
commit78ebc62604d77600b9865950610717d28c6027a2 (patch)
treef7027a1ee81eb180eab71cf6ef32bf08da117d50 /agent
parentg10: Make sure to emit NEED_PASSPHRASE on --export-secret-key. (diff)
downloadgnupg2-78ebc62604d77600b9865950610717d28c6027a2.tar.xz
gnupg2-78ebc62604d77600b9865950610717d28c6027a2.zip
w32: Change directory on daemon startup.
* agent/gpg-agent.c [HAVE_W32_SYSTEM]: Include <direct.h>. (main) [HAVE_W32_SYSTEM]: Change working directory to \. * dirmngr/dirmngr.c [HAVE_W32_SYSTEM]: Include <direct.h>. (main) [HAVE_W32_SYSTEM]: Change working directory to \. * scd/scdaemon.c [HAVE_W32_SYSTEM]: Include <direct.h>. (main) [HAVE_W32_SYSTEM]: Change working directory to \. Signed-off-by: Marcus Brinkmann <mb@g10code.com> GnuPG-bug-id: 2670
Diffstat (limited to 'agent')
-rw-r--r--agent/gpg-agent.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index efaebfd94..90e8a2657 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -39,6 +39,7 @@
# endif
# include <aclapi.h>
# include <sddl.h>
+# include <direct.h>
#else /*!HAVE_W32_SYSTEM*/
# include <sys/socket.h>
# include <sys/un.h>
@@ -1558,6 +1559,11 @@ main (int argc, char **argv )
(void)csh_style;
(void)nodetach;
initialize_modules ();
+ if (_chdir("\\"))
+ {
+ log_error ("chdir to / failed: %s\n", strerror (errno));
+ exit (1);
+ }
#else /*!HAVE_W32_SYSTEM*/