mirror of
https://github.com/webmin/webmin.git
synced 2026-10-25 12:40:38 +00:00
Fix Filemin archive option handling
Fixes a regression from [1e1f9982d](https://github.com/webmin/webmin/commit/1e1f9982d). That change put `--` in the wrong place for Zip, causing compression to fail.
Tar could still treat filenames as command options. This puts `--` in the correct place for both.
This commit is contained in:
@@ -17,32 +17,32 @@ if ($in{'method'} eq 'plain-tar') {
|
||||
$extension = ".tar";
|
||||
$full = &validate_filename_path($in{'arch'}.$extension);
|
||||
$command = "tar cf ".quotemeta($full).
|
||||
" -C ".quotemeta($cwd);
|
||||
" -C ".quotemeta($cwd)." --";
|
||||
}
|
||||
elsif ($in{'method'} eq 'xz-tar') {
|
||||
$extension = ".tar.xz";
|
||||
$full = &validate_filename_path($in{'arch'}.$extension);
|
||||
$command = "tar cJf ".quotemeta($full).
|
||||
" -C ".quotemeta($cwd);
|
||||
" -C ".quotemeta($cwd)." --";
|
||||
}
|
||||
elsif ($in{'method'} eq 'zstd-tar') {
|
||||
$extension = ".zst";
|
||||
$full = &validate_filename_path($in{'arch'}.$extension);
|
||||
$command = "ZSTD_CLEVEL=19 tar --zstd -cf ".
|
||||
quotemeta($full).
|
||||
" -C ".quotemeta($cwd);
|
||||
" -C ".quotemeta($cwd)." --";
|
||||
}
|
||||
elsif ($in{'method'} eq 'tar') {
|
||||
$extension = ".tar.gz";
|
||||
$full = &validate_filename_path($in{'arch'}.$extension);
|
||||
$command = "tar czf ".quotemeta($full).
|
||||
" -C ".quotemeta($cwd);
|
||||
" -C ".quotemeta($cwd)." --";
|
||||
}
|
||||
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!");
|
||||
|
||||
Reference in New Issue
Block a user