Files
webmin/cpan/delete_file.cgi
Ilia Ross 35a7459950
Some checks failed
Tests / prove (push) Has been cancelled
Build / build (push) Has been cancelled
Fix temp file delete path validation
2026-05-29 16:59:05 +02:00

14 lines
366 B
Perl
Executable File

#!/usr/local/bin/perl
# delete_file.cgi
# Delete a downloaded package that is no longer needed
require './cpan-lib.pl';
&ReadParse();
$tmp_base = $gconfig{'tempdir'} || &default_webmin_temp_dir();
foreach $f (split(/\0/, $in{'file'})) {
&is_under_directory($tmp_base, $f) || &error($text{'delete_efile'});
unlink($f) if (!&is_readonly_mode());
}
&redirect("");