summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-05-17 15:04:42 +0200
committerRichard Levitte <levitte@openssl.org>2021-05-19 12:31:17 +0200
commita2625c0fc8ad229871874782ee2b5c46e66f9716 (patch)
tree583a9f7272c9bfb17ec4939f4f5509e9bd1b0005 /util
parent22119050ab21ed5c9cf361d29aabc6b5da9c8aad (diff)
Fix OpenSSL::fallback for VMS
VMS unpackers will typically convert any period ('.') in directory names to underscores, since the period is a path separator on VMS, just like '/' is a path separator on Unix. Our fallback mechanism needs to account for that. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15317)
Diffstat (limited to 'util')
-rw-r--r--util/perl/OpenSSL/fallback.pm19
1 files changed, 17 insertions, 2 deletions
diff --git a/util/perl/OpenSSL/fallback.pm b/util/perl/OpenSSL/fallback.pm
index 8f45971bd9..041fb30ba3 100644
--- a/util/perl/OpenSSL/fallback.pm
+++ b/util/perl/OpenSSL/fallback.pm
@@ -89,9 +89,24 @@ sub import {
while (my $l = <$fh>) {
$l =~ s|\R$||; # Better chomp
my $d = "$dir/$l";
+ my $checked = $d;
+
+ if ($^O eq 'VMS') {
+ # Some VMS unpackers replace periods with underscores
+ # We must be real careful not to convert the directories
+ # '.' and '..', though.
+ $checked =
+ join('/',
+ map { my $x = $_;
+ $x =~ s|\.|_|g
+ if ($x ne '..' && $x ne '.');
+ $x }
+ split(m|/|, $checked))
+ unless -e $checked && -d $checked;
+ }
croak "All lines in $path must be a directory, not a file: $l"
- unless -e $d && -d $d;
- push @INC, $d;
+ unless -e $checked && -d $checked;
+ push @INC, $checked;
}
} else { # It's a directory
push @INC, $path;