From 578760bb6aae6a9d7f3805eea66bab124d06c9b0 Mon Sep 17 00:00:00 2001 From: Alexandr Nedvedicky Date: Tue, 26 Nov 2024 09:05:09 +0100 Subject: die() in .tmpl file should not be silently ignored. call to die() in perl templates is currently ignored. any error printed by die() commad appears in template output. In order to make sure die() terminates processing we must ensure we emite `undef` value. This is ensured by adding a `BROKEN` callback to `fill_in()` Template method. The callback must return undef to stop processing. Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26064) --- configdata.pm.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configdata.pm.in') diff --git a/configdata.pm.in b/configdata.pm.in index 68439ae93c..fea6004d6c 100644 --- a/configdata.pm.in +++ b/configdata.pm.in @@ -145,7 +145,7 @@ _____ # defined in one template stick around for the # next, making them combinable PACKAGE => 'OpenSSL::safe') - or die $Text::Template::ERROR; + or die $OpenSSL::Template::ERROR; close BUILDFILE; rename("$buildfile.new", $buildfile) or die "Trying to rename $buildfile.new to $buildfile: $!"; @@ -167,7 +167,7 @@ _____ # defined in one template stick around for the # next, making them combinable PACKAGE => 'OpenSSL::safe') - or die $Text::Template::ERROR; + or die $OpenSSL::Template::ERROR; close CONFIGURATION_H; # When using stat() on Windows, we can get it to perform better by -- cgit v1.2.3