diff options
author | Richard Levitte <levitte@openssl.org> | 2011-01-20 22:12:50 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2011-01-20 22:12:50 +0000 |
commit | 54db796991ebc5a5877361f34af752b742446cf5 (patch) | |
tree | d88dc0b8415655d5bb179007371a9691d33d0c6c /util | |
parent | 119e912a8340e1ca869c415bc3b374a0ceaecd81 (diff) |
PR: 2434
Under Windows, there seems to be a problem relinking fips_premain_dso
because that file is locked. Changing from backtick op to using
system() with redirection and reading the hash from the output file
seems to fix the problem.
In an ideal world, there should be no difference, as a command in a
backtick op should terminate before the backtick returns, same as it
does with system(). We suspect, though, that the loaded binary is
cached by Windows for a little while, and that reading the output from
a file provides enough delay for the lock to drop before we try to
relink.
Diffstat (limited to 'util')
-rw-r--r-- | util/fipslink.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/fipslink.pl b/util/fipslink.pl index 3597bc1740..8b6fbad7d8 100644 --- a/util/fipslink.pl +++ b/util/fipslink.pl @@ -43,7 +43,12 @@ die "First stage Link failure" if $? != 0; print "$fips_premain_dso $fips_target\n"; -$fips_hash=`$fips_premain_dso $fips_target`; +system("$fips_premain_dso $fips_target >$fips_target.sha1"); +die "Get hash failure" if $? != 0; +open my $sha1_res, '<', $fips_target.".sha1" or die "Get hash failure"; +$fips_hash=<$sha1_res>; +close $sha1_res; +unlink $fips_target.".sha1"; chomp $fips_hash; die "Get hash failure" if $? != 0; |