← Commit list

51f813308e

Viktor Szakats
Viktor Szakats
2026-03-19
SUCCESS Duration: 279s

Subject

scripts: harden / tidy up more Perl `system()` calls

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

.github/scripts/cmp-config.pl+1 -1
@@ -135,4 +135,4 @@ foreach my $v (keys %remove) {
}
# return the exit code from diff
-exit system("diff -u /tmp/autotools /tmp/cmake") >> 8;
+exit system('diff', ('-u', '/tmp/autotools', '/tmp/cmake')) >> 8;
.github/scripts/verify-examples.pl+2 -2
@@ -37,12 +37,12 @@ if(!@files || $files[0] eq "-h") {
}
sub testcompile {
- my $rc = system("gcc -c test.c -I include -W -Wall -pedantic -Werror -Wno-unused-parameter -Wno-unused-but-set-variable -DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_DEPRECATION") >> 8;
+ my $rc = system('gcc -c test.c -I include -W -Wall -pedantic -Werror -Wno-unused-parameter -Wno-unused-but-set-variable -DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_DEPRECATION') >> 8;
return $rc;
}
sub checksrc {
- my $rc = system("$check test.c") >> 8;
+ my $rc = system($check, ('test.c')) >> 8;
return $rc;
}
.github/scripts/verify-synopsis.pl+1 -1
@@ -35,7 +35,7 @@ if(!@files || $files[0] eq "-h") {
}
sub testcompile {
- my $rc = system("gcc -c test.c -I include -W -Wall -pedantic -Werror -DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_TYPECHECK") >> 8;
+ my $rc = system('gcc -c test.c -I include -W -Wall -pedantic -Werror -DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_TYPECHECK') >> 8;
return $rc;
}
scripts/cdall+1 -1
@@ -38,7 +38,7 @@ sub convert {
my $nroff = "$cd";
$nroff =~ s/\.md\z/.3/;
print "$dir/$cd = $dir/$nroff\n";
- system("./scripts/cd2nroff -d $dir $dir/$cd");
+ system('./scripts/cd2nroff', ('-d', $dir, "$dir/$cd"));
}
}
scripts/randdisable+9 -9
@@ -53,31 +53,31 @@ do {
my $num = rand(scalar(@disable) - 2) + 2;
my $c = 0;
- my $arg;
+ my @arg;
for my $d (shuffle @disable) {
- $arg .= " $d";
+ push @arg, $d;
if(++$c >= $num) {
last;
}
}
my @stls = shuffle @tls;
- $arg.= " ".$stls[0];
+ push @arg, @stls;
- system("make clean");
- if(system("./configure $arg")) {
+ system('make', ('clean'));
+ if(system('./configure', @arg)) {
print STDERR "configure problem\n";
- print STDERR "./configure $arg\n";
+ print STDERR "./configure " . join(' ', @arg) . "\n";
exit 1;
}
- if(system("make -sj10")) {
+ if(system('make', ('-sj10'))) {
print STDERR "Build problem\n";
- print STDERR "./configure $arg\n";
+ print STDERR "./configure " . join(' ', @arg) . "\n";
exit 1;
}
if(system("./src/curl -V 2>/dev/null")) {
print STDERR "Running problem\n";
- print STDERR "./configure $arg\n";
+ print STDERR "./configure " . join(' ', @arg) . "\n";
exit 1;
}
} while(1);
scripts/spacecheck.pl+1 -1
@@ -97,7 +97,7 @@ sub eol_detect {
my $issues = 0;
-open(my $git_ls_files, '-|', 'git ls-files') or die "Failed running git ls-files: $!";
+open(my $git_ls_files, '-|', 'git', 'ls-files') or die "Failed running git ls-files: $!";
while(my $filename = <$git_ls_files>) {
chomp $filename;
tests/certs/genserv.pl+1 -1
@@ -72,7 +72,7 @@ if(!$CAPREFIX) {
}
print "$OPENSSL\n";
- system("$OPENSSL version");
+ system($OPENSSL, ('version'));
$PREFIX = $CAPREFIX;
$DURATION = 6000;
tests/libtest/test613.pl+2 -2
@@ -76,7 +76,7 @@ if($ARGV[0] eq "prepare") {
utime time, timegm(0,0,12,31,11,100), "rofile.txt";
chmod 0444, "rofile.txt";
if($^O eq 'cygwin') {
- system "chattr +r rofile.txt";
+ system('chattr', ('+r', 'rofile.txt'));
}
exit 0;
@@ -86,7 +86,7 @@ elsif($ARGV[0] eq "postprocess") {
# Clean up the test directory
if($^O eq 'cygwin') {
- system "chattr -r $dirname/rofile.txt";
+ system('chattr', ('-r', "$dirname/rofile.txt"));
}
chmod 0666, "$dirname/rofile.txt";
unlink "$dirname/rofile.txt";
tests/sshserver.pl+1 -1
@@ -811,7 +811,7 @@ if($error) {
#***************************************************************************
# Verify that sshd actually supports our generated configuration file
#
-if(system "\"$sshd\" -t -f $sshdconfig_abs > $sshdlog 2>&1") {
+if(system("\"$sshd\" -t -f $sshdconfig_abs > $sshdlog 2>&1")) {
logmsg "sshd configuration file $sshdconfig failed verification\n";
display_sshdlog();
display_sshdconfig();
tests/testcurl.pl+3 -3
@@ -190,10 +190,10 @@ sub rmtree($) {
if($^O eq 'MSWin32') {
foreach (glob($target)) {
s:/:\\:g;
- system("rd /s /q $_");
+ system('rd', ('/s', '/q', $_));
}
} else {
- system("rm -rf $target");
+ system('rm', ('-rf', $target));
}
}
@@ -568,7 +568,7 @@ if($configurebuild) {
} else {
logit "copying files to build directory ...";
if($^O eq 'MSWin32') {
- system("xcopy /s /q \"$CURLDIR\" .");
+ system('xcopy', ('/s', '/q', $CURLDIR, '.'));
}
}