From dc6a62d5d5de905776433ab8ab6b1b2fffaae1ea Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 4 Oct 2017 09:42:23 +0200 Subject: [PATCH] Configurations/windows-makefile.tmpl: canonicalise configured paths This avoids issues that can come with an ending backslash, among other. Fixes #4458 Reviewed-by: Andy Polyakov (Merged from https://github.com/openssl/openssl/pull/4461) --- Configurations/windows-makefile.tmpl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index c13dbdf4a3..45b9c3416e 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -114,11 +114,12 @@ APPS_OPENSSL={- use File::Spec::Functions; INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet # use File::Spec::Functions qw(:DEFAULT splitpath); - our $prefix = $config{prefix} || "$win_installroot\\OpenSSL"; + our $prefix = canonpath($config{prefix} + || "$win_installroot\\OpenSSL"); our ($prefix_dev, $prefix_dir, $prefix_file) = splitpath($prefix, 1); $prefix_dev -} -INSTALLTOP_dir={- $prefix_dir -} +INSTALLTOP_dir={- canonpath($prefix_dir) -} OPENSSLDIR_dev={- # # The logic here is that if no --openssldir was given, # OPENSSLDIR will get the value "$win_commonroot\\SSL". @@ -132,13 +133,13 @@ OPENSSLDIR_dev={- # our $openssldir = $config{openssldir} ? (file_name_is_absolute($config{openssldir}) ? - $config{openssldir} + canonpath($config{openssldir}) : catdir($prefix, $config{openssldir})) - : "$win_commonroot\\SSL"; + : canonpath("$win_commonroot\\SSL"); our ($openssldir_dev, $openssldir_dir, $openssldir_file) = splitpath($openssldir, 1); $openssldir_dev -} -OPENSSLDIR_dir={- $openssldir_dir -} +OPENSSLDIR_dir={- canonpath($openssldir_dir) -} LIBDIR={- our $libdir = $config{libdir} || "lib"; $libdir -} ENGINESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath); @@ -146,7 +147,7 @@ ENGINESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath); our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) = splitpath($enginesdir, 1); $enginesdir_dev -} -ENGINESDIR_dir={- $enginesdir_dir -} +ENGINESDIR_dir={- canonpath($enginesdir_dir) -} !IF "$(DESTDIR)" != "" INSTALLTOP=$(DESTDIR)$(INSTALLTOP_dir) OPENSSLDIR=$(DESTDIR)$(OPENSSLDIR_dir) -- 2.25.1