From 1cdc41815d28d18ea5653a5254aeb473ef084290 Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Sat, 17 Aug 2024 19:04:13 +0200 Subject: [PATCH] CI: use chmod and File::Copy's copy, not system Before, ci/test-11-unpriv.pl used Perl's "system" function to execute a Unix command line to copy a file and change the permissions of the copy. Now, the Perl functions "copy" (from File::Copy) and "chmod" are used instead. --- ci/test-11-unpriv.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/test-11-unpriv.pl b/ci/test-11-unpriv.pl index 558255ee..74deb6a4 100755 --- a/ci/test-11-unpriv.pl +++ b/ci/test-11-unpriv.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl -w use English; +use File::Copy; use File::Temp qw/ tempdir /; use Test::Command; use Test::More; @@ -25,7 +26,8 @@ sub get_ping_gid_range { my $tmpdir = tempdir(CLEANUP => 1); my $fping_bin = `which fping`; chomp $fping_bin; my $fping_copy = "$tmpdir/fping.copy"; -system("cp $fping_bin $fping_copy; chmod +x $fping_copy"); +copy($fping_bin, $fping_copy); +chmod 0755, $fping_copy; # Determine what test to run, based on whether unprivileged # pings are allowed.