当我解压一个组合的多部分 zip 文件时,出现错误:
error: invalid zip file with overlapped components (possible zip bomb)
最初我以为可能是因为文件内的特殊字符。但即使在我运行dos2unix
示例输入文件后Other_advisors-current_02.txt
,错误仍然相同。以下是我为此执行的命令。请帮忙。
[hdf-user@hostname1 zip_test]$ ll
total 98124
drwxr-x---. 2 hdf-user hdf-user 4096 Jun 14 03:03 input
-rw-rw----. 1 hdf-user hdf-user 100073472 Jun 14 02:49 Other_advisors-current_02.txt
drwxr-x---. 2 hdf-user hdf-user 4096 Jun 14 03:03 output
[hdf-user@hostname1 zip_test]$ ll input/
total 0
[hdf-user@hostname1 zip_test]$ ll output/
total 0
[hdf-user@hostname1 zip_test]$ zip -s 5m -r input/Other_advisors-current_02.zip Other_advisors-current_02.txt
adding: Other_advisors-current_02.txt (deflated 90%)
[hdf-user@hostname1 zip_test]$ ll input/
total 10300
-rw-r-----. 1 hdf-user hdf-user 5242880 Jun 14 03:04 Other_advisors-current_02.z01
-rw-r-----. 1 hdf-user hdf-user 5242880 Jun 14 03:04 Other_advisors-current_02.z02
-rw-r-----. 1 hdf-user hdf-user 209 Jun 14 03:04 Other_advisors-current_02.zip
[hdf-user@hostname1 zip_test]$ cd input/
[hdf-user@hostname1 input]$ zip -s 0 Other_advisors-current_02.zip --out ./../output/Other_advisors-current_02.zip
copying: Other_advisors-current_02.txt
[hdf-user@hostname1 input]$ cd ../output/
[hdf-user@hostname1 output]$ ll
total 10292
-rw-r-----. 1 hdf-user hdf-user 10485877 Jun 14 03:05 Other_advisors-current_02.zip
[hdf-user@hostname1 output]$ unzip Other_advisors-current_02.zip
Archive: Other_advisors-current_02.zip
inflating: Other_advisors-current_02.txt
error: invalid compressed data to inflate
bad CRC 1b65d96d (should be 0ed95e82)
error: invalid zip file with overlapped components (possible zip bomb)
[hdf-user@hostname1 output]$
[hdf-user@hostname1 input]$ zip -FF Other_advisors-current_02.zip --out existing.zip
Fix archive (-FF) - salvage what can
Found end record (EOCDR) - says expect 3 splits
Scanning for entries...
Found spanning marker - expected as this is split (multi-disk) archive...
copying: Other_advisors-current_02.txt (10485757 bytes)
zip warning: entry truncated: Other_advisors-current_02.txt
zip warning: expected compressed/stored size 10485757, actual 10485669
Central Directory found...
no local entry: Other_advisors-current_02.txt
EOCDR found ( 3 187)...
zip warning: zip file empty
答案1
我能解决这个问题的唯一方法是连接所有文件,然后像下面这样解压缩:
cat Other_advisors-current_02.z01 Other_advisors-current_02.z02 Other_advisors-current_02.zip > Output.zip
unzip Output.zip