[git] GnuPG - branch, master, updated. gnupg-2.1.21-140-g78ebc62

by Marcus Brinkmann cvs at cvs.gnupg.org
Mon Jul 24 16:39:35 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  78ebc62604d77600b9865950610717d28c6027a2 (commit)
      from  d8e46f10698da0bee4cd58d95f1f9832bdda0c5f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 78ebc62604d77600b9865950610717d28c6027a2
Author: Marcus Brinkmann <marcus.brinkmann at ruhr-uni-bochum.de>
Date:   Mon Jul 24 16:31:55 2017 +0200

    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 at g10code.com>
    GnuPG-bug-id: 2670

diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index efaebfd..90e8a26 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*/
 
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index 6eabca9..b19b418 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -30,9 +30,11 @@
 #include <assert.h>
 #include <time.h>
 #include <fcntl.h>
-#ifndef HAVE_W32_SYSTEM
-#include <sys/socket.h>
-#include <sys/un.h>
+#ifdef HAVE_W32_SYSTEM
+# include <direct.h>
+#else
+# include <sys/socket.h>
+# include <sys/un.h>
 #endif
 #include <sys/stat.h>
 #include <unistd.h>
@@ -1268,6 +1270,11 @@ main (int argc, char **argv)
 #ifdef HAVE_W32_SYSTEM
       (void)csh_style;
       (void)nodetach;
+      if (_chdir("\\"))
+        {
+          log_error ("chdir to / failed: %s\n", strerror (errno));
+          exit (1);
+        }
 
       pid = getpid ();
       es_printf ("set %s=%s;%lu;1\n",
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 26e89dd..bbb0433 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -29,9 +29,11 @@
 #include <assert.h>
 #include <time.h>
 #include <fcntl.h>
-#ifndef HAVE_W32_SYSTEM
-#include <sys/socket.h>
-#include <sys/un.h>
+#ifdef HAVE_W32_SYSTEM
+# include <direct.h>
+#else
+# include <sys/socket.h>
+# include <sys/un.h>
 #endif /*HAVE_W32_SYSTEM*/
 #include <unistd.h>
 #include <signal.h>
@@ -811,6 +813,11 @@ main (int argc, char **argv )
 #ifdef HAVE_W32_SYSTEM
       (void)csh_style;
       (void)nodetach;
+      if (_chdir("\\"))
+        {
+          log_error ("chdir to / failed: %s\n", strerror (errno));
+          exit (1);
+        }
 #else
       pid = fork ();
       if (pid == (pid_t)-1)

-----------------------------------------------------------------------

Summary of changes:
 agent/gpg-agent.c |  6 ++++++
 dirmngr/dirmngr.c | 13 ++++++++++---
 scd/scdaemon.c    | 13 ++++++++++---
 3 files changed, 26 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list