mirror of
https://github.com/webmin/webmin.git
synced 2026-10-23 12:40:39 +01:00
Properly handle filenames starting with -
This commit is contained in:
@@ -42,7 +42,7 @@ elsif ($in{'method'} eq 'zip') {
|
||||
$extension = ".zip";
|
||||
$full = &validate_filename_path($in{'arch'}.$extension);
|
||||
$command = "cd ".quotemeta($cwd).
|
||||
" && zip -r ".quotemeta($full);
|
||||
" && zip -r -- ".quotemeta($full);
|
||||
}
|
||||
else {
|
||||
&error("Unknown method!");
|
||||
|
||||
@@ -31,9 +31,9 @@ elsif ($archive_type =~ /x-7z/ ||
|
||||
elsif ($archive_type =~ /\/zip/) {
|
||||
my $unzip_out = `unzip --help`;
|
||||
my $uu = ($unzip_out =~ /-UU/ ? '-UU' : undef);
|
||||
$cmd = "unzip $uu -q -o ".
|
||||
quotemeta($full).
|
||||
" -d ".quotemeta($cwd);
|
||||
$cmd = "unzip $uu -q -o".
|
||||
" -d ".quotemeta($cwd).
|
||||
" -- ".quotemeta($full);
|
||||
}
|
||||
elsif ($archive_type =~ /\/x-rar|\/vnd\.rar/) {
|
||||
$cmd = "unrar x -r -y ".
|
||||
|
||||
@@ -1110,10 +1110,9 @@ foreach my $fref (@{$files_to_extract}) {
|
||||
my $uu = ($unzip_out =~ /-UU/
|
||||
? '-UU' : undef);
|
||||
$status = system(
|
||||
"$unzip_cmd $uu -q -o " .
|
||||
quotemeta($archive) .
|
||||
" -d " .
|
||||
quotemeta($extract_to));
|
||||
"$unzip_cmd $uu -q -o".
|
||||
" -d " .quotemeta($extract_to).
|
||||
" -- ".quotemeta($archive));
|
||||
}
|
||||
}
|
||||
elsif ($archive_type =~ /\/x-rar|\/vnd\.rar/) {
|
||||
|
||||
Reference in New Issue
Block a user