]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Configure: Fix ordering bug when processing split DEPENDs
authorRichard Levitte <levitte@openssl.org>
Wed, 7 Feb 2024 03:38:28 +0000 (04:38 +0100)
committerTomas Mraz <tomas@openssl.org>
Thu, 8 Feb 2024 10:39:29 +0000 (11:39 +0100)
Configure was recently made to process this sort of line:

    DEPEND[generated]=util/perl|OpenSSL/something.pm

Unfortunately, in processing such lines, the order in which paths
were recomputed caused some resulting paths to be faulty under some
circumstances.  This change fixes that.

Fixes #22853

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23500)

Configure

index cca1ac8d162ee448778411a30b37cdba5c3397fa..caa69b4f476fb36ec34a8d552c0b5a97f5866256 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -2473,10 +2473,11 @@ EOF
                     && $f =~ m/^(.*?)\|(.*)$/) {
                     $i = $1;
                     $m = $2;
-                    $i = cleanfile($sourced, $i, $blddir, 1);
-                    $i2 = cleanfile($buildd, $i, $blddir);
+                    # We must be very careful to modify $i last
                     $d = cleanfile($sourced, "$i/$m", $blddir, 1);
                     $d2 = cleanfile($buildd, "$i/$m", $blddir);
+                    $i2 = cleandir($buildd, $i, $blddir);
+                    $i = cleandir($sourced, $i, $blddir, 1);
                 } else {
                     $d = cleanfile($sourced, $f, $blddir, 1);
                     $d2 = cleanfile($buildd, $f, $blddir);