postgres.git / summary / log / commit / refs

commit    aed688eb730f0e46bc7950589d7577db6bb2d724
Author:   Peter Eisentraut <peter_e@gmx.net>
Date:     Tue Aug 25 13:58:49 2015 +0000
First released in: 9.6.0, 9.5.0

    Simplify Perl chmod calls
    
    The Perl chmod function already takes multiple file arguments, so we
    don't need a separate looping function.


src/test/ssl/ServerSetup.pm | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/test/ssl/ServerSetup.pm b/src/test/ssl/ServerSetup.pm index 8c1b5175755..a8228b04c0f 100644 --- a/src/test/ssl/ServerSetup.pm +++ b/src/test/ssl/ServerSetup.pm @@ -43,20 +43,6 @@ sub copy_files } } -# Perform chmod on a set of files, taking into account wildcards -sub chmod_files -{ - my $mode = shift; - my $file_expr = shift; - - my @all_files = glob $file_expr; - foreach my $file_entry (@all_files) - { - chmod $mode, $file_entry - or die "Could not run chmod with mode $mode on $file_entry"; - } -} - sub configure_test_server_for_ssl { my $tempdir = $_[0]; @@ -82,7 +68,7 @@ sub configure_test_server_for_ssl # Copy all server certificates and keys, and client root cert, to the data dir copy_files("ssl/server-*.crt", "$tempdir/pgdata"); copy_files("ssl/server-*.key", "$tempdir/pgdata"); - chmod_files(0600, "$tempdir/pgdata/server-*.key"); + chmod(0600, glob "$tempdir/pgdata/server-*.key") or die $!; copy_files("ssl/root+client_ca.crt", "$tempdir/pgdata"); copy_files("ssl/root+client.crl", "$tempdir/pgdata"); [parent: 440fc48cac7f]