Fix test_out_option
authorPatrick Steuer <patrick.steuer@de.ibm.com>
Mon, 12 Mar 2018 12:53:21 +0000 (12:53 +0000)
committerRichard Levitte <levitte@openssl.org>
Wed, 14 Mar 2018 17:37:08 +0000 (18:37 +0100)
Random path generation code in test/recipes/15-test_out_option.t
does not work: The code sets rand_path to "/test.pem". I.e. the
test will fail as expected for unprivileged user but will pass
for root user.

Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5595)

test/recipes/15-test_out_option.t

index 018ff3d00d6b6efb279cdfd8e6e991fc53013f17..f50001d48b9f91e42744bdb201a07708474b23f0 100644 (file)
@@ -36,7 +36,8 @@ test_illegal_path('../');
 
 # Test for trying to create a file in a non-exist directory
 my @chars = ("A".."Z", "a".."z", "0".."9");
-my $rand_path = $chars[rand @chars] for 1..32;
+my $rand_path = "";
+$rand_path .= $chars[rand @chars] for 1..32;
 $rand_path .= "/test.pem";
 
 test_illegal_path($rand_path);