]> git.gsnw.org Git - fping.git/commitdiff
CI: use chmod and File::Copy's copy, not system
authorErik Auerswald <auerswal@unix-ag.uni-kl.de>
Sat, 17 Aug 2024 17:04:13 +0000 (19:04 +0200)
committerErik Auerswald <auerswal@unix-ag.uni-kl.de>
Sun, 18 Aug 2024 15:02:23 +0000 (17:02 +0200)
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

index 558255ee2952272b08eac97cd61e3e313f90fe7f..74deb6a4c85a75bc29dfa2e5bbd467b6df512a21 100755 (executable)
@@ -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 @@ my @allowed = 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.