We can call this module also now over the API through
pvedaemon/pveproxy which have tainting checks on.
Thus we need to untaint the "read existing backups" inputs,
as else this errors out here.
Only triggers when over 10 backups existed already, so this does
not triggers really often in the real world.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
if ((my $count = scalar(@$backups)) > $maxfiles) {
foreach my $f (@$backups[$maxfiles..$count-1]) {
+ next if $f !~ m/^(\S+)$/; # untaint
print "delete old backup '$1'\n";
unlink $1;
}