Skip to content

Commit

Permalink
CI: use chmod and File::Copy's copy, not system
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
auerswal committed Aug 17, 2024
1 parent 998bfc8 commit 1cdc418
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ci/test-11-unpriv.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/perl -w

use English;
use File::Copy;
use File::Temp qw/ tempdir /;
use Test::Command;
use Test::More;
Expand All @@ -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.
Expand Down

0 comments on commit 1cdc418

Please sign in to comment.