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:
Ilia Ross
2026-10-11 15:12:35 +02:00
parent c57711a3b5
commit 6b78f7d8b5

View File

@@ -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!");