[git] GnuPG - branch, master, updated. gnupg-2.1.17-6-g6204f81

by Werner Koch cvs at cvs.gnupg.org
Tue Dec 20 18:43:06 CET 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  6204f8104fea42d706a68e77e2dc0bca4704bddc (commit)
      from  36c14139285982def6ad942d4b2d8bef7ed4ea76 (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 6204f8104fea42d706a68e77e2dc0bca4704bddc
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Dec 20 18:38:12 2016 +0100

    tests: Avoid skipping exectool tests.
    
    * common/t-exectool.c (test_executing_true): Try also /usr/bin/true.
    (test_executing_false): Try also /usr/bin/false.
    --
    
    Reported-by: Nelson H. F. Beebe
      I then ran a test on all our test lab systems, and found that
      /bin/false is missing on DragonFlyBSD, FreeBSD, GhostBSD,
      HardenedBSD, Mac OS X, MidnightBSD, Minix, one version of MirBSD,
      NetBSD, OpenBSD, PacBSD, PCBSD, and TrueOS.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/t-exectool.c b/common/t-exectool.c
index 8b6ee6a..9cea2d1 100644
--- a/common/t-exectool.c
+++ b/common/t-exectool.c
@@ -39,21 +39,27 @@ static void
 test_executing_true (void)
 {
   gpg_error_t err;
-  const char *argv[] = { "/bin/true", NULL };
+  const char *pgmname     = "/bin/true";
+  const char *alt_pgmname = "/usr/bin/true";
+  const char *argv[]     = { NULL, NULL };
   char *result;
   size_t len;
 
-  if (access (argv[0], X_OK))
+  if (access (pgmname, X_OK))
     {
-      fprintf (stderr, "skipping test: %s not executable: %s",
-               argv[0], strerror (errno));
-      return;
+      if (access (alt_pgmname, X_OK))
+        {
+          fprintf (stderr, "skipping test: %s not executable: %s\n",
+                   pgmname, strerror (errno));
+          return;
+        }
+      pgmname = alt_pgmname;
     }
 
   if (verbose)
-    fprintf (stderr, "Executing %s...\n", argv[0]);
+    fprintf (stderr, "Executing %s...\n", pgmname);
 
-  err = gnupg_exec_tool (argv[0], &argv[1], "", &result, &len);
+  err = gnupg_exec_tool (pgmname, argv, "", &result, &len);
   if (err)
     fail ("gnupg_exec_tool", err);
 
@@ -66,24 +72,31 @@ static void
 test_executing_false (void)
 {
   gpg_error_t err;
-  const char *argv[] = { "/bin/false", NULL };
+  const char *pgmname     = "/bin/false";
+  const char *alt_pgmname = "/usr/bin/false";
+  const char *argv[]     = { NULL, NULL };
   char *result;
   size_t len;
 
-  if (access (argv[0], X_OK))
+  if (access (pgmname, X_OK))
     {
-      fprintf (stderr, "skipping test: %s not executable: %s",
-               argv[0], strerror (errno));
-      return;
+      if (access (alt_pgmname, X_OK))
+        {
+          fprintf (stderr, "skipping test: %s not executable: %s\n",
+                   pgmname, strerror (errno));
+          return;
+        }
+      pgmname = alt_pgmname;
     }
 
   if (verbose)
-    fprintf (stderr, "Executing %s...\n", argv[0]);
+    fprintf (stderr, "Executing %s...\n", pgmname);
 
-  err = gnupg_exec_tool (argv[0], &argv[1], "", &result, &len);
+  err = gnupg_exec_tool (pgmname, argv, "", &result, &len);
   assert (err == GPG_ERR_GENERAL);
 }
 
+
 static void
 test_executing_cat (const char *vector)
 {
@@ -94,7 +107,7 @@ test_executing_cat (const char *vector)
 
   if (access (argv[0], X_OK))
     {
-      fprintf (stderr, "skipping test: %s not executable: %s",
+      fprintf (stderr, "skipping test: %s not executable: %s\n",
                argv[0], strerror (errno));
       return;
     }
@@ -131,7 +144,7 @@ test_catting_cat (void)
 
   if (access (argv[0], X_OK))
     {
-      fprintf (stderr, "skipping test: %s not executable: %s",
+      fprintf (stderr, "skipping test: %s not executable: %s\n",
                argv[0], strerror (errno));
       return;
     }
@@ -139,7 +152,7 @@ test_catting_cat (void)
   in = es_fopen (argv[1], "r");
   if (in == NULL)
     {
-      fprintf (stderr, "skipping test: could not open %s: %s",
+      fprintf (stderr, "skipping test: could not open %s: %s\n",
                argv[1], strerror (errno));
       return;
     }
@@ -147,7 +160,7 @@ test_catting_cat (void)
   err = es_fseek (in, 0L, SEEK_END);
   if (err)
     {
-      fprintf (stderr, "skipping test: could not seek in %s: %s",
+      fprintf (stderr, "skipping test: could not seek in %s: %s\n",
                argv[1], gpg_strerror (err));
       return;
     }

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

Summary of changes:
 common/t-exectool.c | 49 +++++++++++++++++++++++++++++++------------------
 1 file changed, 31 insertions(+), 18 deletions(-)


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




More information about the Gnupg-commits mailing list