perl: harden external command invocations

In `adddocsref.pl`, `checksrc-all.pl`, `singleuse.pl` and tests 307, 1013,
1022, 1275, 1707, 1708, 1710.

Closes #21097
This commit is contained in:
Viktor Szakats 2026-03-22 02:42:17 +01:00
parent a56ab9dbc8
commit 20914e3753
No known key found for this signature in database
11 changed files with 24 additions and 23 deletions

View file

@ -28,6 +28,8 @@
use strict;
use warnings;
use File::Copy;
my $docroot="https://curl.se/libcurl/c";
for my $f (@ARGV) {
@ -56,6 +58,6 @@ for my $f (@ARGV) {
close(F);
close(NEW);
system("mv $f $f.org");
system("mv $f.new $f");
move($f, "$f.org");
move("$f.new", $f);
}