[git] GnuPG - branch, master, updated. gnupg-2.1.12-63-gcf49104

by Werner Koch cvs at cvs.gnupg.org
Wed Jun 8 14:07:36 CEST 2016


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  cf4910419e09daf414f76ca2c8ab685c3d488ec1 (commit)
       via  aab8a0b05292b0d06e3001a0b289224cb7156dbd (commit)
       via  def512eb67c8a380f3b873cee0f156deef0b6dda (commit)
       via  173fa97102fec68670a46ae1b460231e2a183c81 (commit)
       via  0faf8951544f43790c412777a926c969540174bd (commit)
      from  36550dde998fa1d497098050ca2d4e1a952ed6b6 (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 cf4910419e09daf414f76ca2c8ab685c3d488ec1
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jun 8 14:04:47 2016 +0200

    gpgconf: New commands --create-socketdir and --remove-socketdir.
    
    * tools/gpgconf.c: Include unistd.h.
    (aCreateSocketDir, aRemoveSocketDir): New.
    (opts): Add --create-socketdir and --remove-socketdir.
    (main): Implement them.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/tools.texi b/doc/tools.texi
index 425790e..8fdaa96 100644
--- a/doc/tools.texi
+++ b/doc/tools.texi
@@ -319,6 +319,17 @@ gpg-agent and scdaemon.  Components which don't support reloading are
 ignored.  Note that as of now reload and kill have the same effect for
 scdaemon.
 
+ at item --create-socketdir
+ at opindex create-socketdir
+Create a directory for sockets below /run/user or /var/run/user.  This
+is command is only required if a non default home directory is used
+and the /run based sockets shall be used.  For the default home
+directory GnUPG creates a directory on the fly.
+
+ at item --remove-socketdir
+ at opindex remove-socketdir
+Remove a directory created with command @option{--create-socketdir}.
+
 @end table
 
 
diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index fb1032b..2b177e2 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #include "gpgconf.h"
 #include "i18n.h"
@@ -53,6 +54,8 @@ enum cmd_and_opt_values
     aListDirs,
     aLaunch,
     aKill,
+    aCreateSocketDir,
+    aRemoveSocketDir,
     aReload
   };
 
@@ -78,6 +81,8 @@ static ARGPARSE_OPTS opts[] =
     { aReload,        "reload", 256, N_("reload all or a given component")},
     { aLaunch,        "launch", 256, N_("launch a given component")},
     { aKill,          "kill", 256,   N_("kill a given component")},
+    { aCreateSocketDir, "create-socketdir", 256, "@"},
+    { aRemoveSocketDir, "remove-socketdir", 256, "@"},
 
     { 301, NULL, 0, N_("@\nOptions:\n ") },
 
@@ -191,6 +196,8 @@ main (int argc, char **argv)
         case aReload:
         case aLaunch:
         case aKill:
+        case aCreateSocketDir:
+        case aRemoveSocketDir:
 	  cmd = pargs.r_opt;
 	  break;
 
@@ -388,6 +395,66 @@ main (int argc, char **argv)
         xfree (tmp);
       }
       break;
+
+    case aCreateSocketDir:
+      {
+        char *socketdir;
+        unsigned int flags;
+
+        /* Make sure that the top /run/user/UID/gnupg dir has been
+         * created.  */
+        gnupg_socketdir ();
+
+        /* Check the /var/run dir.  */
+        socketdir = _gnupg_socketdir_internal (1, &flags);
+        if ((flags & 64) && !opt.dry_run)
+          {
+            /* No sub dir - create it. */
+            if (gnupg_mkdir (socketdir, "-rwx"))
+              gc_error (1, errno, "error creating '%s'", socketdir);
+            /* Try again.  */
+            socketdir = _gnupg_socketdir_internal (1, &flags);
+          }
+
+        /* Give some info.  */
+        if ( (flags & ~32) || opt.verbose || opt.dry_run)
+          {
+            log_info ("socketdir is '%s'\n", socketdir);
+            if ((flags &   1)) log_info ("\tgeneral error\n");
+            if ((flags &   2)) log_info ("\tno /run/user dir\n");
+            if ((flags &   4)) log_info ("\tbad permissions\n");
+            if ((flags &   8)) log_info ("\tbad permissions (subdir)\n");
+            if ((flags &  16)) log_info ("\tmkdir failed\n");
+            if ((flags &  32)) log_info ("\tnon-default homedir\n");
+            if ((flags &  64)) log_info ("\tno such subdir\n");
+            if ((flags & 128)) log_info ("\tusing homedir as fallback\n");
+          }
+
+        if ((flags & ~32) && !opt.dry_run)
+          gc_error (1, 0, "error creating socket directory");
+
+        xfree (socketdir);
+      }
+      break;
+
+    case aRemoveSocketDir:
+      {
+        char *socketdir;
+        unsigned int flags;
+
+        /* Check the /var/run dir.  */
+        socketdir = _gnupg_socketdir_internal (1, &flags);
+        if ((flags & 128))
+          log_info ("ignoring request to remove non /run/user socket dir\n");
+        else if (opt.dry_run)
+          ;
+        else if (rmdir (socketdir))
+          gc_error (1, errno, "error removing '%s'", socketdir);
+
+        xfree (socketdir);
+      }
+      break;
+
     }
 
   if (outfp != es_stdout)

commit aab8a0b05292b0d06e3001a0b289224cb7156dbd
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jun 8 10:12:32 2016 +0200

    Implement /run/user/UID/gnupg based sockets.
    
    * common/homedir.c: Include sys/stat.h and zb32.h.
    (w32_portable_app, w32_bin_is_bin): Change type from int to byte.
    (non_default_homedir): New.
    (is_gnupg_default_homedir): New.
    (default_homedir): Set non_default_homedir.
    (gnupg_set_homedir): Set non_default_homedir and make
    the_gnupg_homedir and absolute directory name.
    (gnupg_homedir): Return an absolute directory name.
    (_gnupg_socketdir_internal): New.
    (gnupg_socketdir): Implement /run/user/ based sockets.
    * tools/gpg-connect-agent.c (get_var_ext): Replace now obsolete
    make_filename by xstrdup.
    * tools/gpgconf.c (main): Sue gnupg_homedir for the "homedir:" output.
    --
    
    If a [/var]/run/user/$(id -u)/ directory exists, a gnupg subdir is
    created as needed and the permissions of the directories are checked.
    If that all matches that directory name is returned instead of the
    homedir.
    
    To cope with non standard homedirs (via GNUPGHOME or --homedir) the
    SHA-1 hash of the homedir is computed, left truncated to 120 bits,
    zBase-32 encoded, prefixed with "d.", and appended to
    "[/var]/run/user/$(id -u)/gnupg/".  If that directory exists and has
    proper permissions it is returned as socket dir - if not the homedir
    is used.  Due to cleanup issues, this directory will not be
    auto-created but needs to be created by the user in advance.
    
    The required permissions are: directory owned by the user, group and
    others bits not set.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 3e23a19..d140ba5 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1020,9 +1020,6 @@ main (int argc, char **argv )
 
   finalize_rereadable_options ();
 
-  /* Turn the homedir into an absolute one. */
-  gnupg_set_homedir (make_absfilename (gnupg_homedir (), NULL));
-
   /* Print a warning if an argument looks like an option.  */
   if (!opt.quiet && !(pargs.flags & ARGPARSE_FLAG_STOP_SEEN))
     {
diff --git a/common/homedir.c b/common/homedir.c
index 8992bc6..58f100f 100644
--- a/common/homedir.c
+++ b/common/homedir.c
@@ -53,16 +53,23 @@
 #endif
 #endif /*HAVE_W32_SYSTEM*/
 
+#ifdef HAVE_STAT
+#include <sys/stat.h> /* for stat() */
+#endif
+
 
 
 #include "util.h"
 #include "sysutils.h"
-
+#include "zb32.h"
 
 /* The GnuPG homedir.  This is only accessed by the functions
  * gnupg_homedir and gnupg_set_homedir.  Malloced.  */
 static char *the_gnupg_homedir;
 
+/* Flag indicating that home directory is not the default one.  */
+static byte non_default_homedir;
+
 
 #ifdef HAVE_W32_SYSTEM
 /* A flag used to indicate that a control file for gpgconf has been
@@ -76,13 +83,13 @@ static char *the_gnupg_homedir;
 
    This flag is not used on Unix systems.
  */
-static int w32_portable_app;
+static byte w32_portable_app;
 #endif /*HAVE_W32_SYSTEM*/
 
 #ifdef HAVE_W32_SYSTEM
 /* This flag is true if this process' binary has been installed under
    bin and not in the root directory as often used before GnuPG 2.1. */
-static int w32_bin_is_bin;
+static byte w32_bin_is_bin;
 #endif /*HAVE_W32_SYSTEM*/
 
 
@@ -150,6 +157,20 @@ w32_shgetfolderpath (HWND a, int b, HANDLE c, DWORD d, LPSTR e)
 #endif /*HAVE_W32_SYSTEM*/
 
 
+/* Check whether DIR is the default homedir.  */
+static int
+is_gnupg_default_homedir (const char *dir)
+{
+  int result;
+  char *a = make_absfilename (dir, NULL);
+  char *b = make_absfilename (GNUPG_DEFAULT_HOMEDIR, NULL);
+  result = !compare_filenames (a, b);
+  xfree (b);
+  xfree (a);
+  return result;
+}
+
+
 /* Get the standard home directory.  In general this function should
    not be used as it does not consider a registry value (under W32) or
    the GNUPGHOME environment variable.  It is better to use
@@ -248,6 +269,8 @@ default_homedir (void)
 #endif /*HAVE_W32_SYSTEM*/
   if (!dir || !*dir)
     dir = GNUPG_DEFAULT_HOMEDIR;
+  else if (!is_gnupg_default_homedir (dir))
+    non_default_homedir = 1;
 
   return dir;
 }
@@ -382,27 +405,217 @@ gnupg_set_homedir (const char *newdir)
 {
   if (!newdir || !*newdir)
     newdir = default_homedir ();
+  else if (!is_gnupg_default_homedir (newdir))
+    non_default_homedir = 1;
   xfree (the_gnupg_homedir);
-  the_gnupg_homedir = xstrdup (newdir);
+  the_gnupg_homedir = make_absfilename (newdir, NULL);;
 }
 
 
 /* Return the homedir.  The returned string is valid until another
- * gnupg-set-homedir call.  Note that this may be a relative string.
- * This function replaced the former global opt.homedir.  */
+ * gnupg-set-homedir call.  This is always an absolute directory name.
+ * The function replaces the former global var opt.homedir.  */
 const char *
 gnupg_homedir (void)
 {
   /* If a homedir has not been set, set it to the default.  */
   if (!the_gnupg_homedir)
-    the_gnupg_homedir = xstrdup (default_homedir ());
+    the_gnupg_homedir = make_absfilename (default_homedir (), NULL);
   return the_gnupg_homedir;
 }
 
 
+/* Return whether the home dir is the default one.  */
+int
+gnupg_default_homedir_p (void)
+{
+  return !non_default_homedir;
+}
+
+
+/* Helper for gnupg-socketdir.  This is a global function, so that
+ * gpgconf can use it for its --create-socketdir command.  If
+ * SKIP_CHECKS is set permission checks etc. are not done.  The
+ * function always returns a malloced directory name and stores these
+ * bit flags at R_INFO:
+ *
+ *   1 := Internal error, stat failed, out of core, etc.
+ *   2 := No /run/user directory.
+ *   4 := Directory not owned by the user, not a directory
+ *        or wrong permissions.
+ *   8 := Same as 4 but for the subdir.
+ *  16 := mkdir failed
+ *  32 := Non default homedir; checking subdir.
+ *  64 := Subdir does not exist.
+ * 128 := Using homedir as fallback.
+ */
+char *
+_gnupg_socketdir_internal (int skip_checks, unsigned *r_info)
+{
+#if defined(HAVE_W32_SYSTEM) || !defined(HAVE_STAT)
+
+  (void)skip_checks;
+  *r_info = 0;
+  name = xstrdup (gnupg_homedir ());
+
+#else /* Unix and stat(2) available. */
+
+  static const char * const bases[] = { "/run", "/var/run", NULL};
+  int i;
+  struct stat sb;
+  char prefix[13 + 1 + 20 + 6 + 1];
+  const char *s;
+  char *name = NULL;
+
+  *r_info = 0;
+
+  /* First make sure that non_default_homedir can be set.  */
+  gnupg_homedir ();
+
+  /* It has been suggested to first check XDG_RUNTIME_DIR envvar.
+   * However, the specs state that the lifetime of the directory MUST
+   * be bound to the user being logged in.  Now GnuPG may also be run
+   * as a background process with no (desktop) user logged in.  Thus
+   * we better don't do that.  */
+
+  /* Check whether we have a /run/user dir.  */
+  for (i=0; bases[i]; i++)
+    {
+      snprintf (prefix, sizeof prefix, "%s/user/%u",
+                bases[i], (unsigned int)getuid ());
+      if (!stat (prefix, &sb) && S_ISDIR(sb.st_mode))
+        break;
+    }
+  if (!bases[i])
+    {
+      *r_info |= 2; /* No /run/user directory.  */
+      goto leave;
+    }
+
+  if (sb.st_uid != getuid ())
+    {
+      *r_info |= 4; /* Not owned by the user.  */
+      if (!skip_checks)
+        goto leave;
+    }
+
+  if (strlen (prefix) + 7 >= sizeof prefix)
+    {
+      *r_info |= 1; /* Ooops: Buffer too short to append "/gnupg".  */
+      goto leave;
+    }
+  strcat (prefix, "/gnupg");
+
+  /* Check whether the gnupg sub directory has proper permissions.  */
+  if (stat (prefix, &sb))
+    {
+      if (errno != ENOENT)
+        {
+          *r_info |= 1; /* stat failed.  */
+          goto leave;
+        }
+
+      /* Try to create the directory and check again.  */
+      if (gnupg_mkdir (prefix, "-rwx"))
+        {
+          *r_info |= 16; /* mkdir failed.  */
+          goto leave;
+        }
+      if (stat (prefix, &sb))
+        {
+          *r_info |= 1; /* stat failed.  */
+          goto leave;
+        }
+    }
+  /* Check that it is a directory, owned by the user, and only the
+   * user has permissions to use it.  */
+  if (!S_ISDIR(sb.st_mode)
+      || sb.st_uid != getuid ()
+      || (sb.st_mode & (S_IRWXG|S_IRWXO)))
+    {
+      *r_info |= 4; /* Bad permissions or not a directory. */
+      if (!skip_checks)
+        goto leave;
+    }
+
+  /* If a non default homedir is used, we check whether an
+   * corresponding sub directory below the socket dir is available
+   * and use that.  We has the non default homedir to keep the new
+   * subdir short enough.  */
+  if (non_default_homedir)
+    {
+      char sha1buf[20];
+      char *suffix;
+
+      *r_info |= 32; /* Testing subdir.  */
+      s = gnupg_homedir ();
+      gcry_md_hash_buffer (GCRY_MD_SHA1, sha1buf, s, strlen (s));
+      suffix = zb32_encode (sha1buf, 8*15);
+      if (!suffix)
+        {
+          *r_info |= 1; /* Out of core etc. */
+          goto leave;
+        }
+      name = strconcat (prefix, "/d.", suffix, NULL);
+      xfree (suffix);
+      if (!name)
+        {
+          *r_info |= 1; /* Out of core etc. */
+          goto leave;
+        }
+
+      /* Stat that directory and check constraints.  Note that we
+       * do not auto create such a directory because we would not
+       * have a way to remove it.  Thus the directory needs to be
+       * pre-created.  The command
+       *    gpgconf --create-socketdir
+       * can be used tocreate that directory.  */
+      if (stat (name, &sb))
+        {
+          if (errno != ENOENT)
+            *r_info |= 1; /* stat failed. */
+          else
+            *r_info |= 64; /* Subdir does not exist.  */
+          if (!skip_checks)
+            {
+              xfree (name);
+              name = NULL;
+              goto leave;
+            }
+        }
+      else if (!S_ISDIR(sb.st_mode)
+               || sb.st_uid != getuid ()
+               || (sb.st_mode & (S_IRWXG|S_IRWXO)))
+        {
+          *r_info |= 8; /* Bad permissions or subdir is not a directory.  */
+          if (!skip_checks)
+            {
+              xfree (name);
+              name = NULL;
+              goto leave;
+            }
+        }
+    }
+  else
+    name = xstrdup (prefix);
+
+ leave:
+  /* If nothing works fall back to the homedir.  */
+  if (!name)
+    {
+      *r_info |= 128; /* Fallback.  */
+      name = xstrdup (gnupg_homedir ());
+    }
+
+#endif /* Unix */
+
+  return name;
+}
+
+
 /*
  * Return the name of the socket dir.  That is the directory used for
- * the IPC local sockets.  This is an absolute filename.
+ * the IPC local sockets.  This is an absolute directory name.
  */
 const char *
 gnupg_socketdir (void)
@@ -411,18 +624,8 @@ gnupg_socketdir (void)
 
   if (!name)
     {
-      /* Check XDG variable.  */
-
-      /* XDG is not set: Check whether we have a /run directory.  */
-
-      /* If there is no run directpry we assume a /var/run directory.  */
-
-      /* Check that the user directory exists or create it if
-       * required,  */
-
-      /* If nothing works fall back to the homedir.  */
-      if (!name)
-        name = make_absfilename (gnupg_homedir (), NULL);
+      unsigned int dummy;
+      name = _gnupg_socketdir_internal (0, &dummy);
     }
 
   return name;
diff --git a/common/util.h b/common/util.h
index 0621047..c84847a 100644
--- a/common/util.h
+++ b/common/util.h
@@ -222,6 +222,7 @@ const char *standard_homedir (void);
 const char *default_homedir (void);
 void gnupg_set_homedir (const char *newdir);
 const char *gnupg_homedir (void);
+int gnupg_default_homedir_p (void);
 const char *gnupg_socketdir (void);
 const char *gnupg_sysconfdir (void);
 const char *gnupg_bindir (void);
@@ -233,6 +234,8 @@ const char *gnupg_cachedir (void);
 const char *dirmngr_sys_socket_name (void);
 const char *dirmngr_user_socket_name (void);
 
+char *_gnupg_socketdir_internal (int skip_checks, unsigned *r_info);
+
 /* All module names.  We also include gpg and gpgsm for the sake for
    gpgconf. */
 #define GNUPG_MODULE_NAME_AGENT        1
diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index 0eb43fb..1cd554f 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -555,7 +555,7 @@ get_var_ext (const char *name)
             log_error ("getcwd failed: %s\n", strerror (errno));
         }
       else if (!strcmp (s, "homedir"))
-        result = make_filename (gnupg_homedir (), NULL);
+        result = xstrdup (gnupg_homedir ());
       else if (!strcmp (s, "sysconfdir"))
         result = xstrdup (gnupg_sysconfdir ());
       else if (!strcmp (s, "bindir"))
diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index 63cc654..fb1032b 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -383,8 +383,7 @@ main (int argc, char **argv)
         xfree (tmp);
       }
       {
-        /* We need to use make_filename to expand a possible "~/".  */
-        char *tmp = make_filename (default_homedir (), NULL);
+        char *tmp = xstrdup (gnupg_homedir ());
         es_fprintf (outfp, "homedir:%s\n", gc_percent_escape (tmp));
         xfree (tmp);
       }

commit def512eb67c8a380f3b873cee0f156deef0b6dda
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jun 8 09:54:09 2016 +0200

    gpgconf: Add option --homedir
    
    * tools/gpgconf.c (opts): Add --homedir.
    (main): Set homedir.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index e5a6c22..63cc654 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -87,6 +87,7 @@ static ARGPARSE_OPTS opts[] =
     { oDryRun, "dry-run",   0, N_("do not make any changes") },
     { oRuntime, "runtime",  0, N_("activate changes at runtime, if possible") },
     /* hidden options */
+    { oHomedir, "homedir", 2, "@" },
     { oNoVerbose, "no-verbose",  0, "@"},
     {0}
   };
@@ -176,6 +177,7 @@ main (int argc, char **argv)
 	  break;
         case oVerbose:   opt.verbose++; break;
         case oNoVerbose: opt.verbose = 0; break;
+        case oHomedir:   gnupg_set_homedir (pargs.r.ret_str); break;
 
 	case aListDirs:
         case aListComponents:

commit 173fa97102fec68670a46ae1b460231e2a183c81
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jun 8 09:17:49 2016 +0200

    Do not use no-libgcrypt dummy for tools
    
    * tools/Makefile.am (gpgconf_SOURCES): Remove no-libgcrypt.c.
    (gpgconf_LDADD): Add LIBGCRYPT_LIBS.
    (gpg_connect_agent_LDADD): Ditto.
    (gpgtar_LDADD): Ditto.
    * dirmngr/Makefile.am (dirmngr_client_LDADD): Ditto.
    (t_common_ldadd): Ditto.  Remove no-libgcrypt.o.
    --
    
    We need this change so that a future code in common/ can use Libgcrypt
    functions; in particular hashing.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/dirmngr/Makefile.am b/dirmngr/Makefile.am
index cbc0090..aaa9050 100644
--- a/dirmngr/Makefile.am
+++ b/dirmngr/Makefile.am
@@ -99,18 +99,17 @@ dirmngr_ldap_LDADD = $(libcommon) no-libgcrypt.o \
 endif
 
 dirmngr_client_SOURCES = dirmngr-client.c
-dirmngr_client_LDADD = $(libcommon) no-libgcrypt.o \
-	                $(LIBASSUAN_LIBS) \
-	               $(GPG_ERROR_LIBS) $(NETLIBS) $(LIBINTL) $(LIBICONV)
+dirmngr_client_LDADD = $(libcommon) \
+                       $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
+                       $(LIBGCRYPT_LIBS) $(NETLIBS) $(LIBINTL) $(LIBICONV)
 dirmngr_client_LDFLAGS = $(extra_bin_ldflags)
 
-
 no-libgcrypt.c : $(top_srcdir)/tools/no-libgcrypt.c
 	cat $(top_srcdir)/tools/no-libgcrypt.c > no-libgcrypt.c
 
 
 t_common_src = t-support.h
-t_common_ldadd = $(libcommon) no-libgcrypt.o $(LIBASSUAN_LIBS) \
+t_common_ldadd = $(libcommon) $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \
                  $(GPG_ERROR_LIBS) $(NETLIBS) \
                  $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) \
                  $(DNSLIBS) $(LIBINTL) $(LIBICONV)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 39c0f9c..f9424fa 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -91,12 +91,12 @@ gpgsplit_LDADD = $(common_libs) \
 	         $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
 		 $(ZLIBS) $(LIBINTL) $(NETLIBS) $(LIBICONV)
 
-gpgconf_SOURCES = gpgconf.c gpgconf.h gpgconf-comp.c no-libgcrypt.c
+gpgconf_SOURCES = gpgconf.c gpgconf.h gpgconf-comp.c
 
 # common sucks in gpg-error, will they, nil they (some compilers
 # do not eliminate the supposed-to-be-unused-inline-functions).
 gpgconf_LDADD = $(maybe_commonpth_libs) $(opt_libassuan_libs) \
-                $(LIBINTL) $(GPG_ERROR_LIBS) $(NETLIBS) \
+                $(LIBINTL) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) $(NETLIBS) \
 	        $(LIBICONV) $(W32SOCKLIBS)
 gpgconf_LDFLAGS = $(extra_bin_ldflags)
 
@@ -111,10 +111,11 @@ symcryptrun_LDADD = $(LIBUTIL_LIBS) $(common_libs) $(pwquery_libs) \
 watchgnupg_SOURCES = watchgnupg.c
 watchgnupg_LDADD = $(NETLIBS)
 
-gpg_connect_agent_SOURCES = gpg-connect-agent.c no-libgcrypt.c
-# FIXME: remove PTH_LIBS (why do we need them at all?)
+gpg_connect_agent_SOURCES = gpg-connect-agent.c
+# FIXME: remove NPTH_LIBS (why do we need them at all?)
 gpg_connect_agent_LDADD = ../common/libgpgrl.a $(common_libs) \
-	                  $(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) \
+	                  $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \
+                          $(NPTH_LIBS) $(GPG_ERROR_LIBS) \
                           $(LIBREADLINE) $(LIBINTL) $(NETLIBS) $(LIBICONV) \
                           $(resource_objs)
 
@@ -130,10 +131,9 @@ gpgtar_SOURCES = \
 	gpgtar.c gpgtar.h \
 	gpgtar-create.c \
 	gpgtar-extract.c \
-	gpgtar-list.c \
-	no-libgcrypt.c
+	gpgtar-list.c
 gpgtar_CFLAGS = $(GPG_ERROR_CFLAGS)
-gpgtar_LDADD = $(libcommon) $(GPG_ERROR_LIBS) \
+gpgtar_LDADD = $(libcommon) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
                $(LIBINTL) $(NETLIBS) $(LIBICONV) $(W32SOCKLIBS)
 
 

commit 0faf8951544f43790c412777a926c969540174bd
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jun 8 09:04:29 2016 +0200

    Do not try to remove the enclosing directory of sockets.
    
    * agent/gpg-agent.c (remove_socket): Do not remove the enclosing
    directory.
    * scd/scdaemon.c (cleanup): Ditto.
    
    --
    
    The socket directory is now below /run or at ~/.gnupg.  Thus we should
    not try to remove the directory of the socket.  The auto-removal was
    introduced at a time we used a temporary directory for the sockets.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index e5b352c..3e23a19 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1,6 +1,6 @@
 /* gpg-agent.c  -  The GnuPG Agent
  * Copyright (C) 2000-2007, 2009-2010 Free Software Foundation, Inc.
- * Copyright (C) 2000-2014 Werner Koch
+ * Copyright (C) 2000-2016 Werner Koch
  *
  * This file is part of GnuPG.
  *
@@ -561,13 +561,6 @@ remove_socket (char *name, char *redir_name)
         name = redir_name;
 
       gnupg_remove (name);
-      p = strrchr (name, '/');
-      if (p)
-	{
-	  *p = 0;
-	  rmdir (name);
-	  *p = '/';
-	}
       *name = 0;
     }
 }
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 215e63f..c468a84 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -376,13 +376,6 @@ cleanup (void)
       name = redir_socket_name? redir_socket_name : socket_name;
 
       gnupg_remove (name);
-      p = strrchr (name, '/');
-      if (p)
-        {
-          *p = 0;
-          rmdir (name);
-          *p = '/';
-        }
       *socket_name = 0;
     }
 }

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

Summary of changes:
 agent/gpg-agent.c         |  12 +--
 common/homedir.c          | 243 ++++++++++++++++++++++++++++++++++++++++++----
 common/util.h             |   3 +
 dirmngr/Makefile.am       |   9 +-
 doc/tools.texi            |  11 +++
 scd/scdaemon.c            |   7 --
 tools/Makefile.am         |  16 +--
 tools/gpg-connect-agent.c |   2 +-
 tools/gpgconf.c           |  72 +++++++++++++-
 9 files changed, 321 insertions(+), 54 deletions(-)


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




More information about the Gnupg-commits mailing list