VMS: be less picky when loading DSOs
authorRichard Levitte <levitte@openssl.org>
Thu, 8 Sep 2016 18:48:30 +0000 (20:48 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 11 Sep 2016 21:18:03 +0000 (23:18 +0200)
The DSO API was picky about casing of symbol names on VMS.

There's really no reason to be that picky, it's mostly just annoying.
Therefore, we take away the possibility to flag for a choice, and will
instead first try to find a symbol with exact case, and failing that,
we try to find it in upper case.

Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/dso/dso_vms.c
include/internal/dso.h

index 90d387eb53633ee3c0adac9c6b0965ade145ae7e..2e0d84cb538aa055633346d4776e2de2834c425c 100644 (file)
@@ -261,15 +261,13 @@ static int do_find_symbol(DSO_VMS_INTERNAL *ptr,
                                      symname_dsc, sym, 0, flags);
 }
 
+# ifndef LIB$M_FIS_MIXEDCASE
+#  define LIB$M_FIS_MIXEDCASE (1 << 4);
+# endif
 void vms_bind_sym(DSO *dso, const char *symname, void **sym)
 {
     DSO_VMS_INTERNAL *ptr;
-    int status;
-# ifdef LIB$M_FIS_MIXEDCASE
-    int flags = LIB$M_FIS_MIXEDCASE;
-# else
-    int flags = (1 << 4);
-# endif
+    int status = 0;
     struct dsc$descriptor_s symname_dsc;
 
 /* Arrange 32-bit pointer to (copied) string storage, if needed. */
@@ -312,10 +310,10 @@ void vms_bind_sym(DSO *dso, const char *symname, void **sym)
         return;
     }
 
-    if (dso->flags & DSO_FLAG_UPCASE_SYMBOL)
-        flags = 0;
+    status = do_find_symbol(ptr, &symname_dsc, sym, LIB$M_FIS_MIXEDCASE);
 
-    status = do_find_symbol(ptr, &symname_dsc, sym, flags);
+    if (!$VMS_STATUS_SUCCESS(status))
+        status = do_find_symbol(ptr, &symname_dsc, sym, 0);
 
     if (!$VMS_STATUS_SUCCESS(status)) {
         unsigned short length;
index 970beeb195702ae3c2e8f9355ddd6d3d8908672c..79d98f4785390c48c1391a44235f773cfbaf09ed 100644 (file)
@@ -42,12 +42,6 @@ extern "C" {
  */
 # define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY      0x02
 
-/*
- * The following flag controls the translation of symbol names to upper case.
- * This is currently only being implemented for OpenVMS.
- */
-# define DSO_FLAG_UPCASE_SYMBOL                  0x10
-
 /*
  * This flag loads the library with public symbols. Meaning: The exported
  * symbols of this library are public to all libraries loaded after this