[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Richard Levitte levitte at openssl.org
Wed Feb 22 17:37:43 UTC 2017


The branch OpenSSL_1_1_0-stable has been updated
       via  d8d3b66971dab2b54dd0946d85fd45a2470714a8 (commit)
      from  05361483e732b64e2e0a15da4e6ba97c3bbeeca0 (commit)


- Log -----------------------------------------------------------------
commit d8d3b66971dab2b54dd0946d85fd45a2470714a8
Author: Richard Levitte <levitte at openssl.org>
Date:   Wed Feb 22 16:48:55 2017 +0100

    Make "openssl rehash" work on VMS 8.3 and up
    
    A spelling error prevented it from building correctly.
    Furthermore, we need to be more careful when to add a / at the end
    of the dirname and when not.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2706)
    (cherry picked from commit 5c80e2af3a7d8aa5129a1668c286c1464983e1ac)

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

Summary of changes:
 apps/rehash.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/apps/rehash.c b/apps/rehash.c
index 4e10ded..6544ae1 100644
--- a/apps/rehash.c
+++ b/apps/rehash.c
@@ -16,7 +16,7 @@
 #include "apps.h"
 
 #if defined(OPENSSL_SYS_UNIX) || defined(__APPLE__) || \
-    (defined(__VMS) && defined(__DECC) && __CTRL_VER >= 80300000)
+    (defined(__VMS) && defined(__DECC) && __CRTL_VER >= 80300000)
 # include <unistd.h>
 # include <stdio.h>
 # include <limits.h>
@@ -267,6 +267,20 @@ static void str_free(char *s)
     OPENSSL_free(s);
 }
 
+static int ends_with_dirsep(const char *path)
+{
+    if (*path != '\0')
+        path += strlen(path) - 1;
+# ifdef __VMS
+    if (*path == ']' || *path == '>' || *path == ':')
+        return 1;
+# elif _WIN32
+    if (*path == '\\')
+        return 1;
+# endif
+    return *path == '/';
+}
+
 /*
  * Process a directory; return number of errors found.
  */
@@ -289,7 +303,7 @@ static int do_dir(const char *dirname, enum Hash h)
         return 1;
     }
     buflen = strlen(dirname);
-    pathsep = (buflen && dirname[buflen - 1] == '/') ? "" : "/";
+    pathsep = (buflen && !ends_with_dirsep(dirname)) ? "/": "";
     buflen += NAME_MAX + 1 + 1;
     buf = app_malloc(buflen, "filename buffer");
 


More information about the openssl-commits mailing list