react-native-update 10.34.3 → 10.34.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/harmony/pushy/src/main/cpp/HDiffPatch/CHANGELOG.md +34 -172
- package/harmony/pushy/src/main/cpp/HDiffPatch/LICENSE +4 -4
- package/harmony/pushy/src/main/cpp/HDiffPatch/Makefile +63 -379
- package/harmony/pushy/src/main/cpp/HDiffPatch/README.md +170 -415
- package/harmony/pushy/src/main/cpp/HDiffPatch/_atosize.h +10 -54
- package/harmony/pushy/src/main/cpp/HDiffPatch/_clock_for_demo.h +1 -13
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Android.mk +18 -171
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Application.mk +4 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.c +7 -38
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.h +4 -15
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch_jni.c +12 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/java/com/github/sisong/HPatch.java +4 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HDiffPatch.workspace +8 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HDiffZ.cbp +219 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HPatchZ.cbp +156 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/unitTest.cbp +65 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffPatch.sln +105 -155
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj +236 -363
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj.user +3 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj +317 -347
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj.user +3 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj +181 -295
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj.user +3 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata +0 -9
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/bestParams.xcodeproj/project.pbxproj +14 -53
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hdiffz.xcodeproj/project.pbxproj +32 -162
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hpatchz.xcodeproj/project.pbxproj +22 -89
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lzma.xcodeproj/project.pbxproj +13 -237
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/testHashClash.xcodeproj/project.pbxproj +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/unitTest.xcodeproj/project.pbxproj +14 -194
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zstd.xcodeproj/project.pbxproj +10 -30
- package/harmony/pushy/src/main/cpp/HDiffPatch/checksum_plugin_demo.h +3 -458
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.cpp +71 -106
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.h +3 -3
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_plugin_demo.h +110 -484
- package/harmony/pushy/src/main/cpp/HDiffPatch/decompress_plugin_demo.h +193 -835
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.cpp +50 -99
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.h +4 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.cpp +8 -147
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.h +6 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.cpp +25 -7
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/file_for_dirDiff.h +113 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.c +97 -163
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.h +39 -49
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.c +15 -15
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.h +2 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_types.h +4 -8
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.c +57 -72
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.h +13 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.c +1 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.h +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.c +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.h +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.c +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.h +1 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.c +100 -311
- package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.h +72 -53
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz.cpp +487 -888
- package/harmony/pushy/src/main/cpp/HDiffPatch/hpatch_dir_listener.h +28 -45
- package/harmony/pushy/src/main/cpp/HDiffPatch/hpatchz.c +247 -812
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.cpp +544 -1265
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.h +38 -123
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_types.h +0 -115
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.cpp +102 -272
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.h +12 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp +4 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.h +5 -7
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/{divsufsort.cpp → divsufsort.c} +8 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.c.inc.h +164 -91
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.h +102 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.c +13 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.h +97 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort_private.h +44 -23
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/sssort.c.inc.h +89 -54
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/trsort.c.inc.h +55 -48
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/utils.c.inc.h +381 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.c +47 -110
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.h +4 -11
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/bloom_filter.h +26 -53
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/covers.h +25 -103
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp +130 -271
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.h +7 -17
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp +37 -628
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.h +43 -203
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/mem_buf.h +10 -14
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/pack_uint.h +7 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp +46 -132
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.h +9 -48
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.c +299 -650
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.h +82 -120
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_private.h +7 -87
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_types.h +9 -119
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.cpp +6 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.h +15 -192
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.cpp +367 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.h +56 -31
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/_private_searchBestParams.cpp +1 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/hpatchz_test.cpp +1 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/testHashClash.cpp +31 -225
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/unit_test.cpp +94 -566
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zAsm.asm +28 -222
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zCrcOpt.asm +117 -228
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/AesOpt.asm +173 -678
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzmaDecOpt.asm +22 -103
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/XzCrc64Opt.asm +167 -485
- package/harmony/pushy/src/main/cpp/lzma/C/7z.h +6 -8
- package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.c +30 -39
- package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/7zArcIn.c +217 -232
- package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.c +68 -404
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.h +6 -9
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrcOpt.c +79 -163
- package/harmony/pushy/src/main/cpp/lzma/C/7zDec.c +78 -160
- package/harmony/pushy/src/main/cpp/lzma/C/7zFile.c +58 -215
- package/harmony/pushy/src/main/cpp/lzma/C/7zFile.h +6 -15
- package/harmony/pushy/src/main/cpp/lzma/C/7zStream.c +23 -46
- package/harmony/pushy/src/main/cpp/lzma/C/7zTypes.h +89 -311
- package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/C/Aes.c +68 -191
- package/harmony/pushy/src/main/cpp/lzma/C/Aes.h +8 -30
- package/harmony/pushy/src/main/cpp/lzma/C/AesOpt.c +108 -926
- package/harmony/pushy/src/main/cpp/lzma/C/Alloc.c +96 -246
- package/harmony/pushy/src/main/cpp/lzma/C/Alloc.h +8 -33
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.c +144 -177
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.h +42 -228
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2Enc.c +182 -377
- package/harmony/pushy/src/main/cpp/lzma/C/Bra.c +143 -622
- package/harmony/pushy/src/main/cpp/lzma/C/Bra.h +40 -81
- package/harmony/pushy/src/main/cpp/lzma/C/Bra86.c +58 -163
- package/harmony/pushy/src/main/cpp/lzma/C/BraIA64.c +48 -9
- package/harmony/pushy/src/main/cpp/lzma/C/Compiler.h +15 -228
- package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.c +133 -885
- package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.h +78 -428
- package/harmony/pushy/src/main/cpp/lzma/C/Delta.c +31 -136
- package/harmony/pushy/src/main/cpp/lzma/C/Delta.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.c +62 -53
- package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/C/LzFind.c +495 -1114
- package/harmony/pushy/src/main/cpp/lzma/C/LzFind.h +25 -64
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.c +400 -969
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.h +24 -37
- package/harmony/pushy/src/main/cpp/lzma/C/LzHash.h +48 -25
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.c +7 -12
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.h +7 -8
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.c +83 -96
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.h +9 -11
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.c +92 -96
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.h +9 -12
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Dec.c +4 -3
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Enc.c +6 -3
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.c +206 -384
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.h +8 -11
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.c +315 -489
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.h +9 -18
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.c +3 -5
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.h +14 -21
- package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.c +87 -90
- package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.h +25 -28
- package/harmony/pushy/src/main/cpp/lzma/C/MtDec.c +88 -74
- package/harmony/pushy/src/main/cpp/lzma/C/MtDec.h +20 -21
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd.h +34 -118
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.c +293 -712
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.h +70 -109
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Dec.c +116 -237
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Enc.c +95 -245
- package/harmony/pushy/src/main/cpp/lzma/C/Precomp.h +5 -122
- package/harmony/pushy/src/main/cpp/lzma/C/RotateDefs.h +4 -24
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256.c +143 -387
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256.h +7 -67
- package/harmony/pushy/src/main/cpp/lzma/C/Sort.c +114 -241
- package/harmony/pushy/src/main/cpp/lzma/C/Sort.h +7 -4
- package/harmony/pushy/src/main/cpp/lzma/C/Threads.c +14 -731
- package/harmony/pushy/src/main/cpp/lzma/C/Threads.h +14 -204
- package/harmony/pushy/src/main/cpp/lzma/C/ThreadsP.c +396 -0
- package/harmony/pushy/src/main/cpp/lzma/C/ThreadsP.h +31 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsp +2 -10
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7zMain.c +79 -282
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.h +7 -10
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile +3 -7
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile.gcc +75 -32
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.c +56 -111
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsp +0 -24
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile +0 -2
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile.gcc +41 -18
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsp +2 -30
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLibExports.c +6 -7
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/makefile +2 -27
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.h +7 -10
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.c +22 -39
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile +2 -9
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile_con +1 -3
- package/harmony/pushy/src/main/cpp/lzma/C/Xz.c +3 -5
- package/harmony/pushy/src/main/cpp/lzma/C/Xz.h +47 -129
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.c +43 -97
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.h +8 -8
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64Opt.c +36 -228
- package/harmony/pushy/src/main/cpp/lzma/C/XzDec.c +295 -405
- package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.c +139 -194
- package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.h +11 -15
- package/harmony/pushy/src/main/cpp/lzma/C/XzIn.c +134 -200
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip.mak +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Aes.mak +1 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.h +13 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.cpp +90 -120
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.h +6 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.cpp +140 -183
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.h +20 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zExtract.cpp +57 -78
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.cpp +44 -169
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.h +17 -57
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.cpp +109 -141
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.h +57 -54
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandlerOut.cpp +116 -336
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.h +9 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.cpp +136 -234
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.h +26 -35
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zItem.h +5 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.cpp +155 -280
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.h +40 -51
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.cpp +59 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.h +2 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zRegister.cpp +2 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.cpp +3 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.h +9 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.cpp +387 -975
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.h +16 -44
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive.def +0 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive2.def +0 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/ArchiveExports.cpp +8 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.cpp +87 -106
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.h +57 -57
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.h +8 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.cpp +43 -126
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.h +18 -77
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +9 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.h +23 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.cpp +9 -61
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.h +3 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.cpp +27 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.h +26 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.h +8 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/DllExports2.cpp +10 -63
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/IArchive.h +173 -319
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/LzmaHandler.cpp +113 -92
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/SplitHandler.cpp +53 -47
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.cpp +208 -352
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Asm.mak +3 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsp +47 -227
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile +5 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/makefile +2 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/makefile +1 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +53 -71
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +22 -85
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile +4 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile.gcc +166 -102
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +4 -109
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +30 -69
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile +7 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/resource.rc +1 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +16 -16
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +12 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +9 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +5 -74
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +51 -58
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.h +10 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/makefile +5 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +6 -92
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +19 -46
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.h +11 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/makefile +5 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.rc +0 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.cpp +28 -136
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.h +5 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.cpp +62 -74
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.h +24 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.cpp +7 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.cpp +100 -548
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.h +86 -125
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.cpp +116 -258
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.h +76 -72
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.cpp +15 -34
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.h +9 -38
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.cpp +82 -192
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.h +28 -25
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.cpp +52 -78
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.h +83 -52
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.cpp +67 -323
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.h +38 -123
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.cpp +8 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.h +13 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.cpp +12 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.h +7 -74
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.cpp +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.h +13 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/PropId.cpp +1 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterArc.h +14 -16
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterCodec.h +16 -16
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.cpp +50 -45
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.h +21 -39
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.cpp +42 -47
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.h +53 -42
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.cpp +4 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.h +2 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.h +5 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.cpp +9 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.cpp +355 -556
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.h +59 -66
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Register.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.cpp +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.h +13 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjRegister.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.cpp +5 -88
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.h +18 -42
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchRegister.cpp +16 -33
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/ByteSwap.cpp +53 -52
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CodecExports.cpp +30 -64
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.cpp +22 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.h +26 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/DeltaFilter.cpp +28 -26
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.cpp +28 -30
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.h +54 -45
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.cpp +12 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.h +22 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Register.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.cpp +26 -33
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.h +51 -51
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.cpp +40 -232
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.h +14 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaRegister.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.cpp +35 -84
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.h +41 -42
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.cpp +25 -66
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.h +17 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdRegister.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.cpp +12 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.h +32 -26
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.cpp +16 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.h +20 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc.mak +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc64.mak +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.cpp +32 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.h +18 -30
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAesRegister.cpp +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.cpp +43 -208
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.h +25 -90
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAesReg.cpp +4 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.cpp +21 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.h +3 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/GuiCommon.rc +3 -38
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Guid.txt +3 -26
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/ICoder.h +172 -253
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IDecl.h +7 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IPassword.h +12 -43
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IProgress.h +9 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IStream.h +50 -133
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec.mak +2 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersionInfo.rc +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/PropID.h +2 -53
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.cpp +177 -329
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsp +1 -97
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile +1 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +183 -687
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.h +15 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +913 -2275
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.h +115 -353
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.cpp +106 -127
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.h +3 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +35 -272
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.h +64 -134
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.cpp +1200 -2608
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.h +20 -64
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DirItem.h +36 -253
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.cpp +233 -774
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.h +6 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExitCode.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.cpp +63 -156
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.h +10 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractMode.h +2 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.cpp +6 -22
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.cpp +65 -1991
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.h +29 -241
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/IFileExtractCallback.h +47 -45
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.cpp +179 -442
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.h +89 -147
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.cpp +380 -529
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.h +42 -75
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.cpp +86 -163
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Property.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.cpp +15 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.cpp +1 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.cpp +368 -595
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.h +47 -68
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.cpp +146 -444
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.h +68 -103
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.cpp +42 -111
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.cpp +3 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.h +6 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.cpp +35 -25
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.h +4 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ZipRegistry.h +9 -91
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.mak +1 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.manifest +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp +19 -48
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.h +12 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +41 -162
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.h +41 -88
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.cpp +81 -140
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.h +17 -27
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.cpp +124 -182
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.h +7 -22
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Main.cpp +109 -590
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/MainAr.cpp +2 -62
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.h +10 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.cpp +10 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.h +9 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +24 -320
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.h +26 -50
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.cpp +5 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile +2 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.cpp +6 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.cpp +195 -302
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.h +4 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.h +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/DialogSize.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.cpp +181 -416
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.h +197 -216
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/LangUtils.h +5 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MyWindowsNew.h +5 -48
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +49 -215
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.h +30 -50
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.rc +1 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +3 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.cpp +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.h +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.rc +0 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.cpp +10 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.h +17 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +130 -276
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.h +52 -56
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +1 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +3 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyNameRes.h +0 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.cpp +89 -185
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.h +20 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resource.h +1 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resourceGui.h +0 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/Extract.rc +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.cpp +33 -36
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.h +15 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.cpp +22 -39
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.h +3 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/HashGUI.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Build.mak +13 -109
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/AutoPtr.h +14 -25
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CRC.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.cpp +90 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.h +49 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ComTry.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.cpp +7 -41
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common.h +29 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CrcReg.cpp +45 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Defs.h +2 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynamicBuffer.h +5 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.cpp +110 -132
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.h +9 -35
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Lang.h +5 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.cpp +31 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer.h +21 -59
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer2.h +10 -95
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyCom.h +81 -497
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyException.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyGuidDef.h +9 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyInitGuid.h +5 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyLinux.h +2 -35
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.cpp +164 -347
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.h +35 -246
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyTypes.h +8 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyUnknown.h +11 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.h +94 -184
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.cpp +11 -158
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.h +54 -148
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.cpp +27 -204
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.h +5 -38
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Reg.cpp +16 -43
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdAfx.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.cpp +11 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.h +5 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.cpp +39 -124
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.h +11 -27
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.cpp +15 -458
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.h +2 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.cpp +89 -99
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.h +2 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.cpp +11 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.cpp +102 -677
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.h +5 -377
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.cpp +84 -197
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.h +25 -107
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Reg.cpp +14 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/COM.h +8 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.cpp +113 -197
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.h +12 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.h +10 -22
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/CommandBar.h +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.cpp +47 -242
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.h +51 -94
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Edit.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.cpp +26 -33
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.h +22 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ProgressBar.h +13 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.cpp +34 -56
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.h +9 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ReBar.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Static.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StatusBar.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ToolBar.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Trackbar.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.cpp +6 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.h +7 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.cpp +8 -77
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.h +10 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Defs.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.cpp +2 -69
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.h +2 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.cpp +80 -728
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.h +7 -62
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.cpp +56 -756
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.h +19 -205
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.cpp +47 -569
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.h +28 -283
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileLink.cpp +112 -369
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.cpp +113 -185
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.h +14 -41
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.cpp +10 -66
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.h +2 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Handle.h +4 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.cpp +14 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/NtCheck.h +2 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.cpp +56 -102
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.h +9 -68
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.cpp +14 -150
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.h +3 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.cpp +128 -212
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.h +20 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.h +2 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.cpp +18 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.h +56 -39
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.cpp +58 -539
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.h +14 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.cpp +0 -77
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.h +18 -240
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.cpp +38 -317
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.h +5 -154
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Thread.h +10 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.cpp +37 -291
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.h +10 -124
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.cpp +7 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.h +19 -98
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj +90 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/Methods.txt +2 -6
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-history.txt +0 -205
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-sdk.txt +13 -93
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma.txt +13 -30
- package/harmony/pushy/src/main/cpp/lzma/bin/7zS2.sfx +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zS2con.sfx +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zSD.sfx +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zdec.exe +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zr.exe +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/lzma.exe +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/x64/7zr.exe +0 -0
- package/package.json +1 -1
- package/react-native-update.podspec +0 -1
- package/react-native.config.js +1 -0
- package/src/client.ts +1 -2
- package/src/type.ts +1 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/README_cn.md +0 -547
- package/harmony/pushy/src/main/cpp/HDiffPatch/_hextobytes.h +0 -112
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.cpp +0 -389
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.h +0 -73
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.c +0 -266
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.h +0 -58
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.bat +0 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.sh +0 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/bzip2.vcxproj +0 -228
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/hpatchz_test.vcxproj +0 -215
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/libdeflate.vcxproj +0 -256
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/longPathAware.exe.manifest +0 -7
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/lzma.vcxproj +0 -271
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/testHashClash.vcxproj +0 -228
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zlib.vcxproj +0 -242
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zstd.vcxproj +0 -287
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -8
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/libdeflate.xcodeproj/project.pbxproj +0 -286
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zlib.xcodeproj/project.pbxproj +0 -308
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.h +0 -33
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.m +0 -33
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj +0 -774
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.c +0 -31
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.h +0 -42
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_for_hpatch_lite.h +0 -74
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp +0 -478
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.h +0 -222
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.cpp +0 -14
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.cpp +0 -168
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.h +0 -44
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/qsort_parallel.h +0 -125
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.c +0 -243
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.h +0 -51
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.c +0 -153
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.h +0 -54
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.c +0 -158
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.h +0 -49
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.c +0 -294
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.h +0 -59
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_patch_private_mt.h +0 -217
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.c +0 -349
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.h +0 -110
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c +0 -366
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.h +0 -91
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_input_cache.h +0 -31
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_types.h +0 -106
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.c +0 -497
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.h +0 -106
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.cpp +0 -254
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.h +0 -39
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_sign_diff_type.h +0 -37
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.cpp +0 -62
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.h +0 -44
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dict_decompress_plugin.h +0 -156
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.cpp +0 -440
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.h +0 -88
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.cpp +0 -332
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.h +0 -48
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_types.h +0 -198
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.cpp +0 -697
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.h +0 -74
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_private.h +0 -262
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type.h +0 -174
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type_private.h +0 -174
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.cpp +0 -252
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.h +0 -67
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.cpp +0 -680
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.h +0 -137
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dict_compress_plugin.h +0 -83
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.cpp +0 -125
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.h +0 -56
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/hsynz_plugin.h +0 -55
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.cpp +0 -147
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.h +0 -38
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.cpp +0 -354
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.h +0 -76
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.cpp +0 -521
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.h +0 -69
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_hash_clash.h +0 -122
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_private.h +0 -66
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type.h +0 -36
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type_private.h +0 -81
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.cpp +0 -247
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.h +0 -71
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.cpp +0 -351
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.h +0 -42
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.cpp +0 -124
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.h +0 -38
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.cpp +0 -203
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.h +0 -55
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.cpp +0 -79
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.h +0 -66
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.cpp +0 -628
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.h +0 -95
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_code_table.h +0 -78
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.c +0 -950
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.h +0 -72
- package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/7zAsm.S +0 -181
- package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/LzmaDecOpt.S +0 -1487
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzFindOpt.asm +0 -540
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sha256Opt.asm +0 -275
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sort.asm +0 -860
- package/harmony/pushy/src/main/cpp/lzma/C/7zWindows.h +0 -101
- package/harmony/pushy/src/main/cpp/lzma/C/7zip_gcc_c.mak +0 -360
- package/harmony/pushy/src/main/cpp/lzma/C/Asm_c.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindOpt.c +0 -578
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256Opt.c +0 -451
- package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.c +0 -835
- package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.h +0 -17
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/Precomp.h +0 -13
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.c +0 -4
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.h +0 -13
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_arm64.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x86.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_arm64.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x64.mak +0 -10
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x86.mak +0 -10
- package/harmony/pushy/src/main/cpp/lzma/C/var_mac_arm64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_mac_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/warn_clang.mak +0 -1
- package/harmony/pushy/src/main/cpp/lzma/C/warn_clang_mac.mak +0 -1
- package/harmony/pushy/src/main/cpp/lzma/C/warn_gcc.mak +0 -51
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip_gcc.mak +0 -1370
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile.gcc +0 -279
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile.gcc +0 -215
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.cpp +0 -855
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.h +0 -160
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzFindOpt.mak +0 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec_gcc.mak +0 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sha256.mak +0 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sort.mak +0 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile.gcc +0 -72
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile.gcc +0 -187
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.cpp +0 -218
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.h +0 -48
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialogRes.h +0 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/StdAfx.h +0 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/7zG.exe.manifest +0 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_arm64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x86.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_arm64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x86.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_arm64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_x64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_arm64.mak +0 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x86.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_arm64.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x86.mak +0 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_arm64.mak +0 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang_mac.mak +0 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_gcc.mak +0 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common0.h +0 -330
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.cpp +0 -93
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.h +0 -41
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/LzFindPrepare.cpp +0 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Prepare.cpp +0 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.cpp +0 -130
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.h +0 -28
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.cpp +0 -36
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.h +0 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.cpp +0 -1251
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.h +0 -19
- package/ios/ImportReact.h +0 -2
|
@@ -6,14 +6,15 @@
|
|
|
6
6
|
#undef printf
|
|
7
7
|
|
|
8
8
|
// #include <stdio.h>
|
|
9
|
+
// #include "../../../../C/CpuTicks.h"
|
|
9
10
|
|
|
10
11
|
#include "../../../../C/Alloc.h"
|
|
11
12
|
#include "../../../../C/CpuArch.h"
|
|
12
13
|
|
|
14
|
+
|
|
13
15
|
#include "../../../Common/ComTry.h"
|
|
14
16
|
#include "../../../Common/IntToString.h"
|
|
15
17
|
#include "../../../Common/StringConvert.h"
|
|
16
|
-
#include "../../../Common/UTFConvert.h"
|
|
17
18
|
#include "../../../Common/Wildcard.h"
|
|
18
19
|
|
|
19
20
|
#include "../../../Windows/ErrorMsg.h"
|
|
@@ -23,15 +24,13 @@
|
|
|
23
24
|
#include "../../../Windows/PropVariant.h"
|
|
24
25
|
#include "../../../Windows/PropVariantConv.h"
|
|
25
26
|
|
|
26
|
-
#if defined(_WIN32) && !defined(UNDER_CE) && !defined(
|
|
27
|
-
#define
|
|
27
|
+
#if defined(_WIN32) && !defined(UNDER_CE) && !defined(_SFX)
|
|
28
|
+
#define _USE_SECURITY_CODE
|
|
28
29
|
#include "../../../Windows/SecurityUtils.h"
|
|
29
30
|
#endif
|
|
30
31
|
|
|
31
32
|
#include "../../Common/FilePathAutoRename.h"
|
|
32
|
-
#include "../../Common/StreamUtils.h"
|
|
33
|
-
|
|
34
|
-
#include "../../Archive/Common/ItemNameUtils.h"
|
|
33
|
+
// #include "../../Common/StreamUtils.h"
|
|
35
34
|
|
|
36
35
|
#include "../Common/ExtractingFilePath.h"
|
|
37
36
|
#include "../Common/PropIDUtils.h"
|
|
@@ -42,40 +41,19 @@ using namespace NWindows;
|
|
|
42
41
|
using namespace NFile;
|
|
43
42
|
using namespace NDir;
|
|
44
43
|
|
|
45
|
-
static const char * const kCantAutoRename = "
|
|
46
|
-
static const char * const kCantRenameFile = "
|
|
47
|
-
static const char * const kCantDeleteOutputFile = "
|
|
48
|
-
static const char * const kCantDeleteOutputDir = "
|
|
49
|
-
static const char * const
|
|
50
|
-
|
|
51
|
-
static const char * const
|
|
52
|
-
|
|
53
|
-
static const char * const kCantSetFileLen = "Cannot set length for output file";
|
|
54
|
-
#ifdef SUPPORT_LINKS
|
|
55
|
-
static const char * const kCantCreateHardLink = "Cannot create hard link";
|
|
56
|
-
static const char * const kCantCreateSymLink = "Cannot create symbolic link";
|
|
57
|
-
static const char * const k_HardLink_to_SymLink_Ignored = "Hard link to symbolic link was ignored";
|
|
58
|
-
static const char * const k_CantDelete_File_for_SymLink = "Cannot delete file for symbolic link creation";
|
|
59
|
-
static const char * const k_CantDelete_Dir_for_SymLink = "Cannot delete directory for symbolic link creation";
|
|
60
|
-
#endif
|
|
61
|
-
|
|
62
|
-
static const unsigned k_LinkDataSize_LIMIT = 1 << 12;
|
|
44
|
+
static const char * const kCantAutoRename = "Can not create file with auto name";
|
|
45
|
+
static const char * const kCantRenameFile = "Can not rename existing file";
|
|
46
|
+
static const char * const kCantDeleteOutputFile = "Can not delete output file";
|
|
47
|
+
static const char * const kCantDeleteOutputDir = "Can not delete output folder";
|
|
48
|
+
static const char * const kCantCreateHardLink = "Can not create hard link";
|
|
49
|
+
static const char * const kCantCreateSymLink = "Can not create symbolic link";
|
|
50
|
+
static const char * const kCantOpenOutFile = "Can not open output file";
|
|
51
|
+
static const char * const kCantSetFileLen = "Can not set length for output file";
|
|
63
52
|
|
|
64
|
-
#ifdef SUPPORT_LINKS
|
|
65
|
-
#if WCHAR_PATH_SEPARATOR != L'/'
|
|
66
|
-
// we convert linux slashes to windows slashes for further processing.
|
|
67
|
-
// also we convert linux backslashes to BackslashReplacement character.
|
|
68
|
-
#define REPLACE_SLASHES_from_Linux_to_Sys(s) \
|
|
69
|
-
{ NArchive::NItemName::ReplaceToWinSlashes(s, true); } // useBackslashReplacement
|
|
70
|
-
// { s.Replace(L'/', WCHAR_PATH_SEPARATOR); }
|
|
71
|
-
#else
|
|
72
|
-
#define REPLACE_SLASHES_from_Linux_to_Sys(s)
|
|
73
|
-
#endif
|
|
74
|
-
#endif
|
|
75
53
|
|
|
76
|
-
#ifndef
|
|
54
|
+
#ifndef _SFX
|
|
77
55
|
|
|
78
|
-
|
|
56
|
+
STDMETHODIMP COutStreamWithHash::Write(const void *data, UInt32 size, UInt32 *processedSize)
|
|
79
57
|
{
|
|
80
58
|
HRESULT result = S_OK;
|
|
81
59
|
if (_stream)
|
|
@@ -88,11 +66,9 @@ Z7_COM7F_IMF(COutStreamWithHash::Write(const void *data, UInt32 size, UInt32 *pr
|
|
|
88
66
|
return result;
|
|
89
67
|
}
|
|
90
68
|
|
|
91
|
-
#endif
|
|
92
|
-
|
|
69
|
+
#endif
|
|
93
70
|
|
|
94
|
-
#ifdef
|
|
95
|
-
bool InitLocalPrivileges();
|
|
71
|
+
#ifdef _USE_SECURITY_CODE
|
|
96
72
|
bool InitLocalPrivileges()
|
|
97
73
|
{
|
|
98
74
|
NSecurity::CAccessToken token;
|
|
@@ -111,92 +87,8 @@ bool InitLocalPrivileges()
|
|
|
111
87
|
return false;
|
|
112
88
|
return (GetLastError() == ERROR_SUCCESS);
|
|
113
89
|
}
|
|
114
|
-
#endif // Z7_USE_SECURITY_CODE
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
#if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
|
|
119
|
-
|
|
120
|
-
static const char * const kOfficeExtensions =
|
|
121
|
-
" doc dot wbk"
|
|
122
|
-
" docx docm dotx dotm docb wll wwl"
|
|
123
|
-
" xls xlt xlm"
|
|
124
|
-
" xlsx xlsm xltx xltm xlsb xla xlam"
|
|
125
|
-
" ppt pot pps ppa ppam"
|
|
126
|
-
" pptx pptm potx potm ppam ppsx ppsm sldx sldm"
|
|
127
|
-
" ";
|
|
128
|
-
|
|
129
|
-
static bool FindExt2(const char *p, const UString &name)
|
|
130
|
-
{
|
|
131
|
-
const int pathPos = name.ReverseFind_PathSepar();
|
|
132
|
-
const int dotPos = name.ReverseFind_Dot();
|
|
133
|
-
if (dotPos < 0
|
|
134
|
-
|| dotPos < pathPos
|
|
135
|
-
|| dotPos == (int)name.Len() - 1)
|
|
136
|
-
return false;
|
|
137
|
-
|
|
138
|
-
AString s;
|
|
139
|
-
for (unsigned pos = (unsigned)(dotPos + 1);; pos++)
|
|
140
|
-
{
|
|
141
|
-
const wchar_t c = name[pos];
|
|
142
|
-
if (c <= 0)
|
|
143
|
-
break;
|
|
144
|
-
if (c >= 0x80)
|
|
145
|
-
return false;
|
|
146
|
-
s.Add_Char((char)MyCharLower_Ascii((char)c));
|
|
147
|
-
}
|
|
148
|
-
for (unsigned i = 0; p[i] != 0;)
|
|
149
|
-
{
|
|
150
|
-
unsigned j;
|
|
151
|
-
for (j = i; p[j] != ' '; j++);
|
|
152
|
-
if (s.Len() == j - i && memcmp(p + i, (const char *)s, s.Len()) == 0)
|
|
153
|
-
return true;
|
|
154
|
-
i = j + 1;
|
|
155
|
-
}
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
static const char * const k_ZoneId_StreamName_With_Colon_Prefix = ":Zone.Identifier";
|
|
161
|
-
|
|
162
|
-
bool Is_ZoneId_StreamName(const wchar_t *s)
|
|
163
|
-
{
|
|
164
|
-
return StringsAreEqualNoCase_Ascii(s, k_ZoneId_StreamName_With_Colon_Prefix + 1);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
void ReadZoneFile_Of_BaseFile(CFSTR fileName, CByteBuffer &buf)
|
|
168
|
-
{
|
|
169
|
-
buf.Free();
|
|
170
|
-
FString path (fileName);
|
|
171
|
-
path += k_ZoneId_StreamName_With_Colon_Prefix;
|
|
172
|
-
NIO::CInFile file;
|
|
173
|
-
if (!file.Open(path))
|
|
174
|
-
return;
|
|
175
|
-
UInt64 fileSize;
|
|
176
|
-
if (!file.GetLength(fileSize))
|
|
177
|
-
return;
|
|
178
|
-
if (fileSize == 0 || fileSize >= (1u << 15))
|
|
179
|
-
return;
|
|
180
|
-
buf.Alloc((size_t)fileSize);
|
|
181
|
-
size_t processed;
|
|
182
|
-
if (file.ReadFull(buf, (size_t)fileSize, processed) && processed == fileSize)
|
|
183
|
-
return;
|
|
184
|
-
buf.Free();
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
bool WriteZoneFile_To_BaseFile(CFSTR fileName, const CByteBuffer &buf)
|
|
188
|
-
{
|
|
189
|
-
FString path (fileName);
|
|
190
|
-
path += k_ZoneId_StreamName_With_Colon_Prefix;
|
|
191
|
-
NIO::COutFile file;
|
|
192
|
-
if (!file.Create_ALWAYS(path))
|
|
193
|
-
return false;
|
|
194
|
-
return file.WriteFull(buf, buf.Size());
|
|
195
|
-
}
|
|
196
|
-
|
|
197
90
|
#endif
|
|
198
91
|
|
|
199
|
-
|
|
200
92
|
#ifdef SUPPORT_LINKS
|
|
201
93
|
|
|
202
94
|
int CHardLinkNode::Compare(const CHardLinkNode &a) const
|
|
@@ -213,13 +105,13 @@ static HRESULT Archive_Get_HardLinkNode(IInArchive *archive, UInt32 index, CHard
|
|
|
213
105
|
defined = false;
|
|
214
106
|
{
|
|
215
107
|
NCOM::CPropVariant prop;
|
|
216
|
-
RINOK(archive->GetProperty(index, kpidINode, &prop))
|
|
108
|
+
RINOK(archive->GetProperty(index, kpidINode, &prop));
|
|
217
109
|
if (!ConvertPropVariantToUInt64(prop, h.INode))
|
|
218
110
|
return S_OK;
|
|
219
111
|
}
|
|
220
112
|
{
|
|
221
113
|
NCOM::CPropVariant prop;
|
|
222
|
-
RINOK(archive->GetProperty(index, kpidStreamId, &prop))
|
|
114
|
+
RINOK(archive->GetProperty(index, kpidStreamId, &prop));
|
|
223
115
|
ConvertPropVariantToUInt64(prop, h.StreamId);
|
|
224
116
|
}
|
|
225
117
|
defined = true;
|
|
@@ -234,7 +126,7 @@ HRESULT CArchiveExtractCallback::PrepareHardLinks(const CRecordVector<UInt32> *r
|
|
|
234
126
|
if (!_arc->Ask_INode)
|
|
235
127
|
return S_OK;
|
|
236
128
|
|
|
237
|
-
IInArchive *
|
|
129
|
+
IInArchive *archive = _arc->Archive;
|
|
238
130
|
CRecordVector<CHardLinkNode> &hardIDs = _hardLinks.IDs;
|
|
239
131
|
|
|
240
132
|
{
|
|
@@ -243,27 +135,22 @@ HRESULT CArchiveExtractCallback::PrepareHardLinks(const CRecordVector<UInt32> *r
|
|
|
243
135
|
numItems = realIndices->Size();
|
|
244
136
|
else
|
|
245
137
|
{
|
|
246
|
-
RINOK(archive->GetNumberOfItems(&numItems))
|
|
138
|
+
RINOK(archive->GetNumberOfItems(&numItems));
|
|
247
139
|
}
|
|
248
140
|
|
|
249
141
|
for (UInt32 i = 0; i < numItems; i++)
|
|
250
142
|
{
|
|
251
143
|
CHardLinkNode h;
|
|
252
144
|
bool defined;
|
|
253
|
-
|
|
145
|
+
UInt32 realIndex = realIndices ? (*realIndices)[i] : i;
|
|
254
146
|
|
|
255
|
-
RINOK(Archive_Get_HardLinkNode(archive, realIndex, h, defined))
|
|
147
|
+
RINOK(Archive_Get_HardLinkNode(archive, realIndex, h, defined));
|
|
256
148
|
if (defined)
|
|
257
149
|
{
|
|
258
150
|
bool isAltStream = false;
|
|
259
|
-
RINOK(Archive_IsItem_AltStream(archive, realIndex, isAltStream))
|
|
151
|
+
RINOK(Archive_IsItem_AltStream(archive, realIndex, isAltStream));
|
|
260
152
|
if (!isAltStream)
|
|
261
|
-
|
|
262
|
-
bool isDir = false;
|
|
263
|
-
RINOK(Archive_IsItem_Dir(archive, realIndex, isDir))
|
|
264
|
-
if (!isDir)
|
|
265
|
-
hardIDs.Add(h);
|
|
266
|
-
}
|
|
153
|
+
hardIDs.Add(h);
|
|
267
154
|
}
|
|
268
155
|
}
|
|
269
156
|
}
|
|
@@ -271,7 +158,7 @@ HRESULT CArchiveExtractCallback::PrepareHardLinks(const CRecordVector<UInt32> *r
|
|
|
271
158
|
hardIDs.Sort2();
|
|
272
159
|
|
|
273
160
|
{
|
|
274
|
-
//
|
|
161
|
+
// wee keep only items that have 2 or more items
|
|
275
162
|
unsigned k = 0;
|
|
276
163
|
unsigned numSame = 1;
|
|
277
164
|
for (unsigned i = 1; i < hardIDs.Size(); i++)
|
|
@@ -292,30 +179,23 @@ HRESULT CArchiveExtractCallback::PrepareHardLinks(const CRecordVector<UInt32> *r
|
|
|
292
179
|
return S_OK;
|
|
293
180
|
}
|
|
294
181
|
|
|
295
|
-
#endif
|
|
296
|
-
|
|
182
|
+
#endif
|
|
297
183
|
|
|
298
184
|
CArchiveExtractCallback::CArchiveExtractCallback():
|
|
299
|
-
// Write_CTime(true),
|
|
300
|
-
// Write_ATime(true),
|
|
301
|
-
// Write_MTime(true),
|
|
302
|
-
Is_elimPrefix_Mode(false),
|
|
303
185
|
_arc(NULL),
|
|
186
|
+
WriteCTime(true),
|
|
187
|
+
WriteATime(true),
|
|
188
|
+
WriteMTime(true),
|
|
304
189
|
_multiArchives(false)
|
|
305
190
|
{
|
|
306
|
-
|
|
191
|
+
LocalProgressSpec = new CLocalProgress();
|
|
192
|
+
_localProgress = LocalProgressSpec;
|
|
193
|
+
|
|
194
|
+
#ifdef _USE_SECURITY_CODE
|
|
307
195
|
_saclEnabled = InitLocalPrivileges();
|
|
308
196
|
#endif
|
|
309
197
|
}
|
|
310
198
|
|
|
311
|
-
|
|
312
|
-
void CArchiveExtractCallback::InitBeforeNewArchive()
|
|
313
|
-
{
|
|
314
|
-
#if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
|
|
315
|
-
ZoneBuf.Free();
|
|
316
|
-
#endif
|
|
317
|
-
}
|
|
318
|
-
|
|
319
199
|
void CArchiveExtractCallback::Init(
|
|
320
200
|
const CExtractNtOptions &ntOptions,
|
|
321
201
|
const NWildcard::CCensorNode *wildcardCensor,
|
|
@@ -328,39 +208,36 @@ void CArchiveExtractCallback::Init(
|
|
|
328
208
|
{
|
|
329
209
|
ClearExtractedDirsInfo();
|
|
330
210
|
_outFileStream.Release();
|
|
331
|
-
_bufPtrSeqOutStream.Release();
|
|
332
211
|
|
|
333
|
-
#ifdef SUPPORT_LINKS
|
|
212
|
+
#ifdef SUPPORT_LINKS
|
|
334
213
|
_hardLinks.Clear();
|
|
335
|
-
|
|
336
|
-
#endif
|
|
214
|
+
#endif
|
|
337
215
|
|
|
338
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
216
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
339
217
|
_renamedFiles.Clear();
|
|
340
|
-
#endif
|
|
218
|
+
#endif
|
|
341
219
|
|
|
342
220
|
_ntOptions = ntOptions;
|
|
343
221
|
_wildcardCensor = wildcardCensor;
|
|
222
|
+
|
|
344
223
|
_stdOutMode = stdOutMode;
|
|
345
224
|
_testMode = testMode;
|
|
346
|
-
|
|
347
|
-
_progressTotal = packSize;
|
|
225
|
+
|
|
348
226
|
// _progressTotal = 0;
|
|
349
227
|
// _progressTotal_Defined = false;
|
|
350
|
-
|
|
228
|
+
|
|
229
|
+
_packTotal = packSize;
|
|
230
|
+
_progressTotal = packSize;
|
|
231
|
+
_progressTotal_Defined = true;
|
|
232
|
+
|
|
351
233
|
_extractCallback2 = extractCallback2;
|
|
352
|
-
/*
|
|
353
234
|
_compressProgress.Release();
|
|
354
235
|
_extractCallback2.QueryInterface(IID_ICompressProgressInfo, &_compressProgress);
|
|
355
|
-
|
|
356
|
-
_extractCallback2.QueryInterface(IID_IArchiveExtractCallbackMessage2, &_callbackMessage);
|
|
357
|
-
*/
|
|
358
|
-
_folderArchiveExtractCallback2.Release();
|
|
236
|
+
_extractCallback2.QueryInterface(IID_IArchiveExtractCallbackMessage, &_callbackMessage);
|
|
359
237
|
_extractCallback2.QueryInterface(IID_IFolderArchiveExtractCallback2, &_folderArchiveExtractCallback2);
|
|
360
238
|
|
|
361
|
-
#ifndef
|
|
239
|
+
#ifndef _SFX
|
|
362
240
|
|
|
363
|
-
ExtractToStreamCallback.Release();
|
|
364
241
|
_extractCallback2.QueryInterface(IID_IFolderExtractToStreamCallback, &ExtractToStreamCallback);
|
|
365
242
|
if (ExtractToStreamCallback)
|
|
366
243
|
{
|
|
@@ -379,7 +256,7 @@ void CArchiveExtractCallback::Init(
|
|
|
379
256
|
_removePathParts = removePathParts;
|
|
380
257
|
_removePartsForAltStreams = removePartsForAltStreams;
|
|
381
258
|
|
|
382
|
-
#ifndef
|
|
259
|
+
#ifndef _SFX
|
|
383
260
|
_baseParentFolder = (UInt32)(Int32)-1;
|
|
384
261
|
_use_baseParentFolder_mode = false;
|
|
385
262
|
#endif
|
|
@@ -397,19 +274,17 @@ void CArchiveExtractCallback::Init(
|
|
|
397
274
|
}
|
|
398
275
|
}
|
|
399
276
|
|
|
400
|
-
|
|
401
|
-
Z7_COM7F_IMF(CArchiveExtractCallback::SetTotal(UInt64 size))
|
|
277
|
+
STDMETHODIMP CArchiveExtractCallback::SetTotal(UInt64 size)
|
|
402
278
|
{
|
|
403
279
|
COM_TRY_BEGIN
|
|
404
280
|
_progressTotal = size;
|
|
405
|
-
|
|
281
|
+
_progressTotal_Defined = true;
|
|
406
282
|
if (!_multiArchives && _extractCallback2)
|
|
407
283
|
return _extractCallback2->SetTotal(size);
|
|
408
284
|
return S_OK;
|
|
409
285
|
COM_TRY_END
|
|
410
286
|
}
|
|
411
287
|
|
|
412
|
-
|
|
413
288
|
static void NormalizeVals(UInt64 &v1, UInt64 &v2)
|
|
414
289
|
{
|
|
415
290
|
const UInt64 kMax = (UInt64)1 << 31;
|
|
@@ -420,7 +295,6 @@ static void NormalizeVals(UInt64 &v1, UInt64 &v2)
|
|
|
420
295
|
}
|
|
421
296
|
}
|
|
422
297
|
|
|
423
|
-
|
|
424
298
|
static UInt64 MyMultDiv64(UInt64 unpCur, UInt64 unpTotal, UInt64 packTotal)
|
|
425
299
|
{
|
|
426
300
|
NormalizeVals(packTotal, unpTotal);
|
|
@@ -430,8 +304,7 @@ static UInt64 MyMultDiv64(UInt64 unpCur, UInt64 unpTotal, UInt64 packTotal)
|
|
|
430
304
|
return unpCur * packTotal / unpTotal;
|
|
431
305
|
}
|
|
432
306
|
|
|
433
|
-
|
|
434
|
-
Z7_COM7F_IMF(CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue))
|
|
307
|
+
STDMETHODIMP CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue)
|
|
435
308
|
{
|
|
436
309
|
COM_TRY_BEGIN
|
|
437
310
|
|
|
@@ -442,7 +315,7 @@ Z7_COM7F_IMF(CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue))
|
|
|
442
315
|
if (_multiArchives)
|
|
443
316
|
{
|
|
444
317
|
packCur = LocalProgressSpec->InSize;
|
|
445
|
-
if (completeValue
|
|
318
|
+
if (completeValue && _progressTotal_Defined)
|
|
446
319
|
packCur += MyMultDiv64(*completeValue, _progressTotal, _packTotal);
|
|
447
320
|
completeValue = &packCur;
|
|
448
321
|
}
|
|
@@ -451,20 +324,15 @@ Z7_COM7F_IMF(CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue))
|
|
|
451
324
|
COM_TRY_END
|
|
452
325
|
}
|
|
453
326
|
|
|
454
|
-
|
|
455
|
-
Z7_COM7F_IMF(CArchiveExtractCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize))
|
|
327
|
+
STDMETHODIMP CArchiveExtractCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
|
|
456
328
|
{
|
|
457
329
|
COM_TRY_BEGIN
|
|
458
|
-
return
|
|
330
|
+
return _localProgress->SetRatioInfo(inSize, outSize);
|
|
459
331
|
COM_TRY_END
|
|
460
332
|
}
|
|
461
333
|
|
|
462
|
-
|
|
463
|
-
void CArchiveExtractCallback::CreateComplexDirectory(
|
|
464
|
-
const UStringVector &dirPathParts, bool isFinal, FString &fullPath)
|
|
334
|
+
void CArchiveExtractCallback::CreateComplexDirectory(const UStringVector &dirPathParts, FString &fullPath)
|
|
465
335
|
{
|
|
466
|
-
// we use (_item.IsDir) in this function
|
|
467
|
-
|
|
468
336
|
bool isAbsPath = false;
|
|
469
337
|
|
|
470
338
|
if (!dirPathParts.IsEmpty())
|
|
@@ -492,60 +360,35 @@ void CArchiveExtractCallback::CreateComplexDirectory(
|
|
|
492
360
|
fullPath.Add_PathSepar();
|
|
493
361
|
const UString &s = dirPathParts[i];
|
|
494
362
|
fullPath += us2fs(s);
|
|
495
|
-
|
|
496
|
-
const bool isFinalDir = (i == dirPathParts.Size() - 1 && isFinal && _item.IsDir);
|
|
497
|
-
|
|
498
|
-
if (fullPath.IsEmpty())
|
|
499
|
-
{
|
|
500
|
-
if (isFinalDir)
|
|
501
|
-
_itemFailure = true;
|
|
502
|
-
continue;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
363
|
#if defined(_WIN32) && !defined(UNDER_CE)
|
|
506
364
|
if (_pathMode == NExtract::NPathMode::kAbsPaths)
|
|
507
365
|
if (i == 0 && s.Len() == 2 && NName::IsDrivePath2(s))
|
|
508
|
-
{
|
|
509
|
-
if (isFinalDir)
|
|
510
|
-
{
|
|
511
|
-
// we don't want to call SetAttrib() for root drive path
|
|
512
|
-
_itemFailure = true;
|
|
513
|
-
}
|
|
514
366
|
continue;
|
|
515
|
-
}
|
|
516
367
|
#endif
|
|
517
|
-
|
|
518
|
-
HRESULT hres = S_OK;
|
|
519
|
-
if (!CreateDir(fullPath))
|
|
520
|
-
hres = GetLastError_noZero_HRESULT();
|
|
521
|
-
if (isFinalDir)
|
|
522
|
-
{
|
|
523
|
-
if (!NFile::NFind::DoesDirExist(fullPath))
|
|
524
|
-
{
|
|
525
|
-
_itemFailure = true;
|
|
526
|
-
SendMessageError_with_Error(hres, "Cannot create folder", fullPath);
|
|
527
|
-
}
|
|
528
|
-
}
|
|
368
|
+
CreateDir(fullPath);
|
|
529
369
|
}
|
|
530
370
|
}
|
|
531
371
|
|
|
532
|
-
|
|
533
|
-
HRESULT CArchiveExtractCallback::GetTime(UInt32 index, PROPID propID, CArcTime &ft)
|
|
372
|
+
HRESULT CArchiveExtractCallback::GetTime(UInt32 index, PROPID propID, FILETIME &filetime, bool &filetimeIsDefined)
|
|
534
373
|
{
|
|
535
|
-
|
|
374
|
+
filetimeIsDefined = false;
|
|
375
|
+
filetime.dwLowDateTime = 0;
|
|
376
|
+
filetime.dwHighDateTime = 0;
|
|
536
377
|
NCOM::CPropVariant prop;
|
|
537
|
-
RINOK(_arc->Archive->GetProperty(index, propID, &prop))
|
|
378
|
+
RINOK(_arc->Archive->GetProperty(index, propID, &prop));
|
|
538
379
|
if (prop.vt == VT_FILETIME)
|
|
539
|
-
|
|
380
|
+
{
|
|
381
|
+
filetime = prop.filetime;
|
|
382
|
+
filetimeIsDefined = (filetime.dwHighDateTime != 0 || filetime.dwLowDateTime != 0);
|
|
383
|
+
}
|
|
540
384
|
else if (prop.vt != VT_EMPTY)
|
|
541
385
|
return E_FAIL;
|
|
542
386
|
return S_OK;
|
|
543
387
|
}
|
|
544
388
|
|
|
545
|
-
|
|
546
389
|
HRESULT CArchiveExtractCallback::GetUnpackSize()
|
|
547
390
|
{
|
|
548
|
-
return _arc->
|
|
391
|
+
return _arc->GetItemSize(_index, _curSize, _curSizeDefined);
|
|
549
392
|
}
|
|
550
393
|
|
|
551
394
|
static void AddPathToMessage(UString &s, const FString &path)
|
|
@@ -554,18 +397,18 @@ static void AddPathToMessage(UString &s, const FString &path)
|
|
|
554
397
|
s += fs2us(path);
|
|
555
398
|
}
|
|
556
399
|
|
|
557
|
-
HRESULT CArchiveExtractCallback::SendMessageError(const char *message, const FString &path)
|
|
400
|
+
HRESULT CArchiveExtractCallback::SendMessageError(const char *message, const FString &path)
|
|
558
401
|
{
|
|
559
402
|
UString s (message);
|
|
560
403
|
AddPathToMessage(s, path);
|
|
561
404
|
return _extractCallback2->MessageError(s);
|
|
562
405
|
}
|
|
563
406
|
|
|
564
|
-
|
|
565
|
-
HRESULT CArchiveExtractCallback::SendMessageError_with_Error(HRESULT errorCode, const char *message, const FString &path) const
|
|
407
|
+
HRESULT CArchiveExtractCallback::SendMessageError_with_LastError(const char *message, const FString &path)
|
|
566
408
|
{
|
|
409
|
+
DWORD errorCode = GetLastError();
|
|
567
410
|
UString s (message);
|
|
568
|
-
if (errorCode !=
|
|
411
|
+
if (errorCode != 0)
|
|
569
412
|
{
|
|
570
413
|
s += " : ";
|
|
571
414
|
s += NError::MyFormatMessage(errorCode);
|
|
@@ -574,51 +417,23 @@ HRESULT CArchiveExtractCallback::SendMessageError_with_Error(HRESULT errorCode,
|
|
|
574
417
|
return _extractCallback2->MessageError(s);
|
|
575
418
|
}
|
|
576
419
|
|
|
577
|
-
HRESULT CArchiveExtractCallback::
|
|
578
|
-
{
|
|
579
|
-
const HRESULT errorCode = GetLastError_noZero_HRESULT();
|
|
580
|
-
return SendMessageError_with_Error(errorCode, message, path);
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
HRESULT CArchiveExtractCallback::SendMessageError2(HRESULT errorCode, const char *message, const FString &path1, const FString &path2) const
|
|
420
|
+
HRESULT CArchiveExtractCallback::SendMessageError2(const char *message, const FString &path1, const FString &path2)
|
|
584
421
|
{
|
|
585
422
|
UString s (message);
|
|
586
|
-
if (errorCode != 0)
|
|
587
|
-
{
|
|
588
|
-
s += " : ";
|
|
589
|
-
s += NError::MyFormatMessage(errorCode);
|
|
590
|
-
}
|
|
591
423
|
AddPathToMessage(s, path1);
|
|
592
424
|
AddPathToMessage(s, path2);
|
|
593
425
|
return _extractCallback2->MessageError(s);
|
|
594
426
|
}
|
|
595
427
|
|
|
596
|
-
|
|
597
|
-
const char *message, const FString &path1, const FString &path2) const
|
|
598
|
-
{
|
|
599
|
-
const HRESULT errorCode = GetLastError_noZero_HRESULT();
|
|
600
|
-
return SendMessageError2(errorCode, message, path1, path2);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
#ifndef Z7_SFX
|
|
604
|
-
|
|
605
|
-
Z7_CLASS_IMP_COM_1(
|
|
606
|
-
CGetProp
|
|
607
|
-
, IGetProp
|
|
608
|
-
)
|
|
609
|
-
public:
|
|
610
|
-
UInt32 IndexInArc;
|
|
611
|
-
const CArc *Arc;
|
|
612
|
-
// UString BaseName; // relative path
|
|
613
|
-
};
|
|
428
|
+
#ifndef _SFX
|
|
614
429
|
|
|
615
|
-
|
|
430
|
+
STDMETHODIMP CGetProp::GetProp(PROPID propID, PROPVARIANT *value)
|
|
616
431
|
{
|
|
617
432
|
/*
|
|
618
|
-
if (propID ==
|
|
433
|
+
if (propID == kpidName)
|
|
619
434
|
{
|
|
620
435
|
COM_TRY_BEGIN
|
|
621
|
-
NCOM::CPropVariant prop =
|
|
436
|
+
NCOM::CPropVariant prop = Name;
|
|
622
437
|
prop.Detach(value);
|
|
623
438
|
return S_OK;
|
|
624
439
|
COM_TRY_END
|
|
@@ -627,32 +442,35 @@ Z7_COM7F_IMF(CGetProp::GetProp(PROPID propID, PROPVARIANT *value))
|
|
|
627
442
|
return Arc->Archive->GetProperty(IndexInArc, propID, value);
|
|
628
443
|
}
|
|
629
444
|
|
|
630
|
-
#endif
|
|
445
|
+
#endif
|
|
446
|
+
|
|
631
447
|
|
|
448
|
+
#ifdef SUPPORT_LINKS
|
|
632
449
|
|
|
633
|
-
|
|
450
|
+
static UString GetDirPrefixOf(const UString &src)
|
|
634
451
|
{
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
452
|
+
UString s (src);
|
|
453
|
+
if (!s.IsEmpty())
|
|
454
|
+
{
|
|
455
|
+
if (IsPathSepar(s.Back()))
|
|
456
|
+
s.DeleteBack();
|
|
457
|
+
int pos = s.ReverseFind_PathSepar();
|
|
458
|
+
s.DeleteFrom(pos + 1);
|
|
459
|
+
}
|
|
460
|
+
return s;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
#endif
|
|
639
464
|
|
|
640
|
-
void Parse(const UString &path, bool isWSL);
|
|
641
|
-
};
|
|
642
465
|
|
|
643
|
-
|
|
466
|
+
bool IsSafePath(const UString &path)
|
|
644
467
|
{
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
NName::IsAbsolutePath(path);
|
|
648
|
-
LowLevel = 0;
|
|
649
|
-
FinalLevel = 0;
|
|
650
|
-
ParentDirDots_after_NonParent = false;
|
|
651
|
-
bool nonParentDir = false;
|
|
468
|
+
if (NName::IsAbsolutePath(path))
|
|
469
|
+
return false;
|
|
652
470
|
|
|
653
471
|
UStringVector parts;
|
|
654
472
|
SplitPathToParts(path, parts);
|
|
655
|
-
|
|
473
|
+
unsigned level = 0;
|
|
656
474
|
|
|
657
475
|
FOR_VECTOR (i, parts)
|
|
658
476
|
{
|
|
@@ -660,51 +478,29 @@ void CLinkLevelsInfo::Parse(const UString &path, bool isWSL)
|
|
|
660
478
|
if (s.IsEmpty())
|
|
661
479
|
{
|
|
662
480
|
if (i == 0)
|
|
663
|
-
|
|
481
|
+
return false;
|
|
664
482
|
continue;
|
|
665
483
|
}
|
|
666
|
-
if (s
|
|
484
|
+
if (s == L".")
|
|
667
485
|
continue;
|
|
668
|
-
if (s
|
|
486
|
+
if (s == L"..")
|
|
669
487
|
{
|
|
670
|
-
if (
|
|
671
|
-
|
|
488
|
+
if (level == 0)
|
|
489
|
+
return false;
|
|
672
490
|
level--;
|
|
673
|
-
if (LowLevel > level)
|
|
674
|
-
LowLevel = level;
|
|
675
491
|
}
|
|
676
492
|
else
|
|
677
|
-
{
|
|
678
|
-
nonParentDir = true;
|
|
679
493
|
level++;
|
|
680
|
-
}
|
|
681
494
|
}
|
|
682
495
|
|
|
683
|
-
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
static bool IsSafePath(const UString &path, bool isWSL)
|
|
688
|
-
{
|
|
689
|
-
CLinkLevelsInfo levelsInfo;
|
|
690
|
-
levelsInfo.Parse(path, isWSL);
|
|
691
|
-
return !levelsInfo.IsAbsolute
|
|
692
|
-
&& levelsInfo.LowLevel >= 0
|
|
693
|
-
&& levelsInfo.FinalLevel > 0;
|
|
496
|
+
return level > 0;
|
|
694
497
|
}
|
|
695
498
|
|
|
696
|
-
bool IsSafePath(const UString &path);
|
|
697
|
-
bool IsSafePath(const UString &path)
|
|
698
|
-
{
|
|
699
|
-
return IsSafePath(path, false); // isWSL
|
|
700
|
-
}
|
|
701
499
|
|
|
702
|
-
bool CensorNode_CheckPath2(const NWildcard::CCensorNode &node, const CReadArcItem &item, bool &include);
|
|
703
500
|
bool CensorNode_CheckPath2(const NWildcard::CCensorNode &node, const CReadArcItem &item, bool &include)
|
|
704
501
|
{
|
|
705
502
|
bool found = false;
|
|
706
|
-
|
|
707
|
-
// CheckPathVect() doesn't check path to Parent nodes
|
|
503
|
+
|
|
708
504
|
if (node.CheckPathVect(item.PathParts, !item.MainIsDir, include))
|
|
709
505
|
{
|
|
710
506
|
if (!include)
|
|
@@ -727,7 +523,7 @@ bool CensorNode_CheckPath2(const NWildcard::CCensorNode &node, const CReadArcIte
|
|
|
727
523
|
if (pathParts2.IsEmpty())
|
|
728
524
|
pathParts2.AddNew();
|
|
729
525
|
UString &back = pathParts2.Back();
|
|
730
|
-
back
|
|
526
|
+
back += ':';
|
|
731
527
|
back += item.AltStreamName;
|
|
732
528
|
bool include2;
|
|
733
529
|
|
|
@@ -739,12 +535,11 @@ bool CensorNode_CheckPath2(const NWildcard::CCensorNode &node, const CReadArcIte
|
|
|
739
535
|
return true;
|
|
740
536
|
}
|
|
741
537
|
|
|
742
|
-
#endif
|
|
538
|
+
#endif
|
|
743
539
|
|
|
744
540
|
return found;
|
|
745
541
|
}
|
|
746
542
|
|
|
747
|
-
|
|
748
543
|
bool CensorNode_CheckPath(const NWildcard::CCensorNode &node, const CReadArcItem &item)
|
|
749
544
|
{
|
|
750
545
|
bool include;
|
|
@@ -753,7 +548,6 @@ bool CensorNode_CheckPath(const NWildcard::CCensorNode &node, const CReadArcItem
|
|
|
753
548
|
return false;
|
|
754
549
|
}
|
|
755
550
|
|
|
756
|
-
|
|
757
551
|
static FString MakePath_from_2_Parts(const FString &prefix, const FString &path)
|
|
758
552
|
{
|
|
759
553
|
FString s (prefix);
|
|
@@ -769,10 +563,9 @@ static FString MakePath_from_2_Parts(const FString &prefix, const FString &path)
|
|
|
769
563
|
}
|
|
770
564
|
|
|
771
565
|
|
|
772
|
-
|
|
566
|
+
/*
|
|
773
567
|
#ifdef SUPPORT_LINKS
|
|
774
568
|
|
|
775
|
-
/*
|
|
776
569
|
struct CTempMidBuffer
|
|
777
570
|
{
|
|
778
571
|
void *Buf;
|
|
@@ -791,15 +584,15 @@ HRESULT CArchiveExtractCallback::MyCopyFile(ISequentialOutStream *outStream)
|
|
|
791
584
|
NIO::CInFile inFile;
|
|
792
585
|
NIO::COutFile outFile;
|
|
793
586
|
|
|
794
|
-
if (!inFile.Open(
|
|
795
|
-
return SendMessageError_with_LastError("Open error",
|
|
587
|
+
if (!inFile.Open(_CopyFile_Path))
|
|
588
|
+
return SendMessageError_with_LastError("Open error", _CopyFile_Path);
|
|
796
589
|
|
|
797
590
|
for (;;)
|
|
798
591
|
{
|
|
799
592
|
UInt32 num;
|
|
800
593
|
|
|
801
594
|
if (!inFile.Read(buf.Buf, kBufSize, num))
|
|
802
|
-
return SendMessageError_with_LastError("Read error",
|
|
595
|
+
return SendMessageError_with_LastError("Read error", _CopyFile_Path);
|
|
803
596
|
|
|
804
597
|
if (num == 0)
|
|
805
598
|
return S_OK;
|
|
@@ -808,1883 +601,940 @@ HRESULT CArchiveExtractCallback::MyCopyFile(ISequentialOutStream *outStream)
|
|
|
808
601
|
RINOK(WriteStream(outStream, buf.Buf, num));
|
|
809
602
|
}
|
|
810
603
|
}
|
|
604
|
+
|
|
605
|
+
#endif
|
|
811
606
|
*/
|
|
812
607
|
|
|
813
608
|
|
|
814
|
-
|
|
609
|
+
STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStream **outStream, Int32 askExtractMode)
|
|
815
610
|
{
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
611
|
+
COM_TRY_BEGIN
|
|
612
|
+
|
|
613
|
+
*outStream = NULL;
|
|
614
|
+
|
|
615
|
+
#ifndef _SFX
|
|
616
|
+
if (_hashStream)
|
|
617
|
+
_hashStreamSpec->ReleaseStream();
|
|
618
|
+
_hashStreamWasUsed = false;
|
|
619
|
+
#endif
|
|
620
|
+
|
|
621
|
+
_outFileStream.Release();
|
|
622
|
+
|
|
623
|
+
_encrypted = false;
|
|
624
|
+
_position = 0;
|
|
625
|
+
_isSplit = false;
|
|
626
|
+
|
|
627
|
+
_curSize = 0;
|
|
628
|
+
_curSizeDefined = false;
|
|
629
|
+
_fileLengthWasSet = false;
|
|
630
|
+
_index = index;
|
|
631
|
+
|
|
632
|
+
_diskFilePath.Empty();
|
|
633
|
+
|
|
634
|
+
// _fi.Clear();
|
|
635
|
+
|
|
636
|
+
#ifdef SUPPORT_LINKS
|
|
637
|
+
// _CopyFile_Path.Empty();
|
|
638
|
+
linkPath.Empty();
|
|
639
|
+
#endif
|
|
640
|
+
|
|
641
|
+
IInArchive *archive = _arc->Archive;
|
|
642
|
+
|
|
643
|
+
#ifndef _SFX
|
|
644
|
+
_item._use_baseParentFolder_mode = _use_baseParentFolder_mode;
|
|
645
|
+
if (_use_baseParentFolder_mode)
|
|
646
|
+
{
|
|
647
|
+
_item._baseParentFolder = _baseParentFolder;
|
|
648
|
+
if (_pathMode == NExtract::NPathMode::kFullPaths ||
|
|
649
|
+
_pathMode == NExtract::NPathMode::kAbsPaths)
|
|
650
|
+
_item._baseParentFolder = -1;
|
|
651
|
+
}
|
|
652
|
+
#endif
|
|
653
|
+
|
|
654
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
655
|
+
_item.WriteToAltStreamIfColon = _ntOptions.WriteToAltStreamIfColon;
|
|
656
|
+
#endif
|
|
657
|
+
|
|
658
|
+
RINOK(_arc->GetItem(index, _item));
|
|
659
|
+
|
|
660
|
+
{
|
|
661
|
+
NCOM::CPropVariant prop;
|
|
662
|
+
RINOK(archive->GetProperty(index, kpidPosition, &prop));
|
|
663
|
+
if (prop.vt != VT_EMPTY)
|
|
664
|
+
{
|
|
665
|
+
if (prop.vt != VT_UI8)
|
|
666
|
+
return E_FAIL;
|
|
667
|
+
_position = prop.uhVal.QuadPart;
|
|
668
|
+
_isSplit = true;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
#ifdef SUPPORT_LINKS
|
|
673
|
+
|
|
674
|
+
// bool isCopyLink = false;
|
|
675
|
+
bool isHardLink = false;
|
|
676
|
+
bool isJunction = false;
|
|
677
|
+
bool isRelative = false;
|
|
678
|
+
|
|
819
679
|
{
|
|
820
680
|
NCOM::CPropVariant prop;
|
|
821
|
-
RINOK(archive->GetProperty(index, kpidHardLink, &prop))
|
|
681
|
+
RINOK(archive->GetProperty(index, kpidHardLink, &prop));
|
|
822
682
|
if (prop.vt == VT_BSTR)
|
|
823
683
|
{
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
// 7-Zip 24-: rar5 handler returned path with system slash.
|
|
829
|
-
// 7-Zip 25+: tar/rar5 handlers return linux path in most cases.
|
|
684
|
+
isHardLink = true;
|
|
685
|
+
// isCopyLink = false;
|
|
686
|
+
isRelative = false; // RAR5, TAR: hard links are from root folder of archive
|
|
687
|
+
linkPath.SetFromBstr(prop.bstrVal);
|
|
830
688
|
}
|
|
831
689
|
else if (prop.vt != VT_EMPTY)
|
|
832
690
|
return E_FAIL;
|
|
833
691
|
}
|
|
692
|
+
|
|
834
693
|
/*
|
|
835
694
|
{
|
|
836
695
|
NCOM::CPropVariant prop;
|
|
837
696
|
RINOK(archive->GetProperty(index, kpidCopyLink, &prop));
|
|
838
697
|
if (prop.vt == VT_BSTR)
|
|
839
698
|
{
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
699
|
+
isHardLink = false;
|
|
700
|
+
isCopyLink = true;
|
|
701
|
+
isRelative = false; // RAR5: copy links are from root folder of archive
|
|
702
|
+
linkPath.SetFromBstr(prop.bstrVal);
|
|
843
703
|
}
|
|
844
704
|
else if (prop.vt != VT_EMPTY)
|
|
845
705
|
return E_FAIL;
|
|
846
706
|
}
|
|
847
707
|
*/
|
|
708
|
+
|
|
848
709
|
{
|
|
849
710
|
NCOM::CPropVariant prop;
|
|
850
|
-
RINOK(archive->GetProperty(index, kpidSymLink, &prop))
|
|
711
|
+
RINOK(archive->GetProperty(index, kpidSymLink, &prop));
|
|
851
712
|
if (prop.vt == VT_BSTR)
|
|
852
713
|
{
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
// 7-Zip 24-: rar5 handler returned path with system slash.
|
|
858
|
-
// 7-Zip 25+: all handlers return linux path in most cases.
|
|
714
|
+
isHardLink = false;
|
|
715
|
+
// isCopyLink = false;
|
|
716
|
+
isRelative = true; // RAR5, TAR: symbolic links can be relative
|
|
717
|
+
linkPath.SetFromBstr(prop.bstrVal);
|
|
859
718
|
}
|
|
860
719
|
else if (prop.vt != VT_EMPTY)
|
|
861
720
|
return E_FAIL;
|
|
862
721
|
}
|
|
863
722
|
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
if (!_link.LinkPath.IsEmpty())
|
|
869
|
-
{
|
|
870
|
-
REPLACE_SLASHES_from_Linux_to_Sys(_link.LinkPath)
|
|
871
|
-
}
|
|
872
|
-
else if (_arc->GetRawProps)
|
|
723
|
+
|
|
724
|
+
bool isOkReparse = false;
|
|
725
|
+
|
|
726
|
+
if (linkPath.IsEmpty() && _arc->GetRawProps)
|
|
873
727
|
{
|
|
874
728
|
const void *data;
|
|
875
|
-
UInt32 dataSize
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
729
|
+
UInt32 dataSize;
|
|
730
|
+
UInt32 propType;
|
|
731
|
+
|
|
732
|
+
_arc->GetRawProps->GetRawProp(_index, kpidNtReparse, &data, &dataSize, &propType);
|
|
733
|
+
|
|
734
|
+
if (dataSize != 0)
|
|
879
735
|
{
|
|
880
736
|
if (propType != NPropDataType::kRaw)
|
|
881
737
|
return E_FAIL;
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
if (_link.LinkPath.IsEmpty())
|
|
891
|
-
return S_OK;
|
|
892
|
-
// (_link.LinkPath) uses system path separator.
|
|
893
|
-
// windows: (_link.LinkPath) doesn't contain linux separator (slash).
|
|
894
|
-
{
|
|
895
|
-
// _link.LinkPath = "\\??\\r:\\1\\2"; // for debug
|
|
896
|
-
// rar5+ returns kpidSymLink absolute link path with "\??\" prefix.
|
|
897
|
-
// we normalize such prefix:
|
|
898
|
-
if (_link.LinkPath.IsPrefixedBy(STRING_PATH_SEPARATOR "??" STRING_PATH_SEPARATOR))
|
|
899
|
-
{
|
|
900
|
-
_link.isRelative = false;
|
|
901
|
-
// we normalize prefix from "\??\" to "\\?\":
|
|
902
|
-
_link.LinkPath.ReplaceOneCharAtPos(1, WCHAR_PATH_SEPARATOR);
|
|
903
|
-
_link.isWindowsPath = true;
|
|
904
|
-
if (_link.LinkPath.IsPrefixedBy_Ascii_NoCase(
|
|
905
|
-
STRING_PATH_SEPARATOR
|
|
906
|
-
STRING_PATH_SEPARATOR "?"
|
|
907
|
-
STRING_PATH_SEPARATOR "UNC"
|
|
908
|
-
STRING_PATH_SEPARATOR))
|
|
909
|
-
{
|
|
910
|
-
// we normalize prefix from "\\?\UNC\path" to "\\path":
|
|
911
|
-
_link.LinkPath.DeleteFrontal(6);
|
|
912
|
-
_link.LinkPath.ReplaceOneCharAtPos(0, WCHAR_PATH_SEPARATOR);
|
|
913
|
-
}
|
|
914
|
-
else
|
|
738
|
+
UString s;
|
|
739
|
+
CReparseAttr reparse;
|
|
740
|
+
DWORD errorCode = 0;
|
|
741
|
+
isOkReparse = reparse.Parse((const Byte *)data, dataSize, errorCode);
|
|
742
|
+
if (isOkReparse)
|
|
915
743
|
{
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
744
|
+
isHardLink = false;
|
|
745
|
+
// isCopyLink = false;
|
|
746
|
+
linkPath = reparse.GetPath();
|
|
747
|
+
isJunction = reparse.IsMountPoint();
|
|
748
|
+
isRelative = reparse.IsRelative();
|
|
749
|
+
#ifndef _WIN32
|
|
750
|
+
linkPath.Replace(L'\\', WCHAR_PATH_SEPARATOR);
|
|
751
|
+
#endif
|
|
919
752
|
}
|
|
920
753
|
}
|
|
921
754
|
}
|
|
922
|
-
_link.Normalize_to_RelativeSafe(_removePathParts);
|
|
923
|
-
return S_OK;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
#endif // SUPPORT_LINKS
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
#ifndef _WIN32
|
|
930
755
|
|
|
931
|
-
|
|
932
|
-
UInt32 index, UInt32 pidName, UInt32 pidId, CProcessedFileInfo::COwnerInfo &res)
|
|
933
|
-
{
|
|
756
|
+
if (!linkPath.IsEmpty())
|
|
934
757
|
{
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
758
|
+
#ifdef _WIN32
|
|
759
|
+
linkPath.Replace(L'/', WCHAR_PATH_SEPARATOR);
|
|
760
|
+
#endif
|
|
761
|
+
|
|
762
|
+
// rar5 uses "\??\" prefix for absolute links
|
|
763
|
+
if (linkPath.IsPrefixedBy(WSTRING_PATH_SEPARATOR L"??" WSTRING_PATH_SEPARATOR))
|
|
938
764
|
{
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
// res.Id++; // for debug
|
|
942
|
-
// if (pidId == kpidGroupId) res.Id += 7; // for debug
|
|
943
|
-
// res.Id = 0; // for debug
|
|
765
|
+
isRelative = false;
|
|
766
|
+
linkPath.DeleteFrontal(4);
|
|
944
767
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
{
|
|
949
|
-
NWindows::NCOM::CPropVariant prop;
|
|
950
|
-
RINOK(archive->GetProperty(index, pidName, &prop))
|
|
951
|
-
if (prop.vt == VT_BSTR)
|
|
768
|
+
|
|
769
|
+
for (;;)
|
|
770
|
+
// while (NName::IsAbsolutePath(linkPath))
|
|
952
771
|
{
|
|
953
|
-
|
|
954
|
-
|
|
772
|
+
unsigned n = NName::GetRootPrefixSize(linkPath);
|
|
773
|
+
if (n == 0)
|
|
774
|
+
break;
|
|
775
|
+
isRelative = false;
|
|
776
|
+
linkPath.DeleteFrontal(n);
|
|
955
777
|
}
|
|
956
|
-
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
if (!linkPath.IsEmpty() && !isRelative && _removePathParts.Size() != 0)
|
|
781
|
+
{
|
|
782
|
+
UStringVector pathParts;
|
|
783
|
+
SplitPathToParts(linkPath, pathParts);
|
|
784
|
+
bool badPrefix = false;
|
|
785
|
+
FOR_VECTOR (i, _removePathParts)
|
|
957
786
|
{
|
|
958
|
-
|
|
959
|
-
|
|
787
|
+
if (CompareFileNames(_removePathParts[i], pathParts[i]) != 0)
|
|
788
|
+
{
|
|
789
|
+
badPrefix = true;
|
|
790
|
+
break;
|
|
791
|
+
}
|
|
960
792
|
}
|
|
961
|
-
|
|
962
|
-
|
|
793
|
+
if (!badPrefix)
|
|
794
|
+
pathParts.DeleteFrontal(_removePathParts.Size());
|
|
795
|
+
linkPath = MakePathFromParts(pathParts);
|
|
963
796
|
}
|
|
964
|
-
return S_OK;
|
|
965
|
-
}
|
|
966
797
|
|
|
967
|
-
#endif
|
|
798
|
+
#endif
|
|
799
|
+
|
|
800
|
+
RINOK(Archive_GetItemBoolProp(archive, index, kpidEncrypted, _encrypted));
|
|
968
801
|
|
|
802
|
+
RINOK(GetUnpackSize());
|
|
969
803
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
804
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
805
|
+
|
|
806
|
+
if (!_ntOptions.AltStreams.Val && _item.IsAltStream)
|
|
807
|
+
return S_OK;
|
|
808
|
+
|
|
809
|
+
#endif
|
|
974
810
|
|
|
975
|
-
_fi.Attrib_Defined = false;
|
|
976
811
|
|
|
977
|
-
|
|
978
|
-
_fi.Owner.Clear();
|
|
979
|
-
_fi.Group.Clear();
|
|
980
|
-
#endif
|
|
812
|
+
UStringVector &pathParts = _item.PathParts;
|
|
981
813
|
|
|
814
|
+
if (_wildcardCensor)
|
|
982
815
|
{
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
if (prop.vt == VT_UI4)
|
|
986
|
-
{
|
|
987
|
-
_fi.SetFromPosixAttrib(prop.ulVal);
|
|
988
|
-
}
|
|
989
|
-
else if (prop.vt != VT_EMPTY)
|
|
990
|
-
return E_FAIL;
|
|
816
|
+
if (!CensorNode_CheckPath(*_wildcardCensor, _item))
|
|
817
|
+
return S_OK;
|
|
991
818
|
}
|
|
992
|
-
|
|
819
|
+
|
|
820
|
+
#ifndef _SFX
|
|
821
|
+
if (_use_baseParentFolder_mode)
|
|
993
822
|
{
|
|
994
|
-
|
|
995
|
-
RINOK(archive->GetProperty(index, kpidAttrib, &prop))
|
|
996
|
-
if (prop.vt == VT_UI4)
|
|
823
|
+
if (!pathParts.IsEmpty())
|
|
997
824
|
{
|
|
998
|
-
|
|
999
|
-
|
|
825
|
+
unsigned numRemovePathParts = 0;
|
|
826
|
+
|
|
827
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
828
|
+
if (_pathMode == NExtract::NPathMode::kNoPathsAlt && _item.IsAltStream)
|
|
829
|
+
numRemovePathParts = pathParts.Size();
|
|
830
|
+
else
|
|
831
|
+
#endif
|
|
832
|
+
if (_pathMode == NExtract::NPathMode::kNoPaths ||
|
|
833
|
+
_pathMode == NExtract::NPathMode::kNoPathsAlt)
|
|
834
|
+
numRemovePathParts = pathParts.Size() - 1;
|
|
835
|
+
pathParts.DeleteFrontal(numRemovePathParts);
|
|
1000
836
|
}
|
|
1001
|
-
else if (prop.vt != VT_EMPTY)
|
|
1002
|
-
return E_FAIL;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
RINOK(GetTime(index, kpidCTime, _fi.CTime))
|
|
1006
|
-
RINOK(GetTime(index, kpidATime, _fi.ATime))
|
|
1007
|
-
RINOK(GetTime(index, kpidMTime, _fi.MTime))
|
|
1008
|
-
|
|
1009
|
-
#ifndef _WIN32
|
|
1010
|
-
if (_ntOptions.ExtractOwner)
|
|
1011
|
-
{
|
|
1012
|
-
// SendMessageError_with_LastError("_ntOptions.ExtractOwner", _diskFilePath);
|
|
1013
|
-
GetOwner(archive, index, kpidUser, kpidUserId, _fi.Owner);
|
|
1014
|
-
GetOwner(archive, index, kpidGroup, kpidGroupId, _fi.Group);
|
|
1015
837
|
}
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
return S_OK;
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
void CArchiveExtractCallback::CorrectPathParts()
|
|
1024
|
-
{
|
|
1025
|
-
UStringVector &pathParts = _item.PathParts;
|
|
1026
|
-
|
|
1027
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1028
|
-
if (!_item.IsAltStream
|
|
1029
|
-
|| !pathParts.IsEmpty()
|
|
1030
|
-
|| !(_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt))
|
|
838
|
+
else
|
|
1031
839
|
#endif
|
|
1032
|
-
Correct_FsPath(_pathMode == NExtract::NPathMode::kAbsPaths, _keepAndReplaceEmptyDirPrefixes, pathParts, _item.MainIsDir);
|
|
1033
|
-
|
|
1034
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1035
|
-
|
|
1036
|
-
if (_item.IsAltStream)
|
|
1037
840
|
{
|
|
1038
|
-
UString s (_item.AltStreamName);
|
|
1039
|
-
Correct_AltStream_Name(s);
|
|
1040
|
-
bool needColon = true;
|
|
1041
|
-
|
|
1042
841
|
if (pathParts.IsEmpty())
|
|
1043
842
|
{
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
843
|
+
if (_item.IsDir)
|
|
844
|
+
return S_OK;
|
|
845
|
+
/*
|
|
846
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
847
|
+
if (!_item.IsAltStream)
|
|
848
|
+
#endif
|
|
849
|
+
return E_FAIL;
|
|
850
|
+
*/
|
|
1047
851
|
}
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
NWildcard::GetNumPrefixParts_if_DrivePath(pathParts) == pathParts.Size())
|
|
1051
|
-
pathParts.AddNew();
|
|
1052
|
-
#endif
|
|
852
|
+
|
|
853
|
+
unsigned numRemovePathParts = 0;
|
|
1053
854
|
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
855
|
+
switch (_pathMode)
|
|
856
|
+
{
|
|
857
|
+
case NExtract::NPathMode::kFullPaths:
|
|
858
|
+
case NExtract::NPathMode::kCurPaths:
|
|
859
|
+
{
|
|
860
|
+
if (_removePathParts.IsEmpty())
|
|
861
|
+
break;
|
|
862
|
+
bool badPrefix = false;
|
|
863
|
+
|
|
864
|
+
if (pathParts.Size() < _removePathParts.Size())
|
|
865
|
+
badPrefix = true;
|
|
866
|
+
else
|
|
867
|
+
{
|
|
868
|
+
if (pathParts.Size() == _removePathParts.Size())
|
|
869
|
+
{
|
|
870
|
+
if (_removePartsForAltStreams)
|
|
871
|
+
{
|
|
872
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
873
|
+
if (!_item.IsAltStream)
|
|
874
|
+
#endif
|
|
875
|
+
badPrefix = true;
|
|
876
|
+
}
|
|
877
|
+
else
|
|
878
|
+
{
|
|
879
|
+
if (!_item.MainIsDir)
|
|
880
|
+
badPrefix = true;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
if (!badPrefix)
|
|
885
|
+
FOR_VECTOR (i, _removePathParts)
|
|
886
|
+
{
|
|
887
|
+
if (CompareFileNames(_removePathParts[i], pathParts[i]) != 0)
|
|
888
|
+
{
|
|
889
|
+
badPrefix = true;
|
|
890
|
+
break;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
if (badPrefix)
|
|
896
|
+
{
|
|
897
|
+
if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
|
|
898
|
+
return E_FAIL;
|
|
899
|
+
}
|
|
900
|
+
else
|
|
901
|
+
numRemovePathParts = _removePathParts.Size();
|
|
902
|
+
break;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
case NExtract::NPathMode::kNoPaths:
|
|
906
|
+
{
|
|
907
|
+
if (!pathParts.IsEmpty())
|
|
908
|
+
numRemovePathParts = pathParts.Size() - 1;
|
|
909
|
+
break;
|
|
910
|
+
}
|
|
911
|
+
case NExtract::NPathMode::kNoPathsAlt:
|
|
912
|
+
{
|
|
913
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
914
|
+
if (_item.IsAltStream)
|
|
915
|
+
numRemovePathParts = pathParts.Size();
|
|
916
|
+
else
|
|
917
|
+
#endif
|
|
918
|
+
if (!pathParts.IsEmpty())
|
|
919
|
+
numRemovePathParts = pathParts.Size() - 1;
|
|
920
|
+
break;
|
|
921
|
+
}
|
|
922
|
+
/*
|
|
923
|
+
case NExtract::NPathMode::kFullPaths:
|
|
924
|
+
case NExtract::NPathMode::kAbsPaths:
|
|
925
|
+
break;
|
|
926
|
+
*/
|
|
927
|
+
}
|
|
1059
928
|
|
|
1060
|
-
|
|
1061
|
-
}
|
|
1062
|
-
|
|
929
|
+
pathParts.DeleteFrontal(numRemovePathParts);
|
|
930
|
+
}
|
|
1063
931
|
|
|
1064
|
-
|
|
1065
|
-
{
|
|
1066
|
-
pt.CTime_Defined = false;
|
|
1067
|
-
pt.ATime_Defined = false;
|
|
1068
|
-
pt.MTime_Defined = false;
|
|
932
|
+
#ifndef _SFX
|
|
1069
933
|
|
|
1070
|
-
|
|
934
|
+
if (ExtractToStreamCallback)
|
|
1071
935
|
{
|
|
1072
|
-
if (
|
|
936
|
+
if (!GetProp)
|
|
1073
937
|
{
|
|
1074
|
-
|
|
1075
|
-
|
|
938
|
+
GetProp_Spec = new CGetProp;
|
|
939
|
+
GetProp = GetProp_Spec;
|
|
1076
940
|
}
|
|
1077
|
-
|
|
941
|
+
GetProp_Spec->Arc = _arc;
|
|
942
|
+
GetProp_Spec->IndexInArc = index;
|
|
943
|
+
UString name (MakePathFromParts(pathParts));
|
|
944
|
+
|
|
945
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
946
|
+
if (_item.IsAltStream)
|
|
1078
947
|
{
|
|
1079
|
-
|
|
1080
|
-
|
|
948
|
+
if (!pathParts.IsEmpty() || (!_removePartsForAltStreams && _pathMode != NExtract::NPathMode::kNoPathsAlt))
|
|
949
|
+
name += ':';
|
|
950
|
+
name += _item.AltStreamName;
|
|
1081
951
|
}
|
|
1082
|
-
|
|
952
|
+
#endif
|
|
1083
953
|
|
|
1084
|
-
|
|
1085
|
-
{
|
|
1086
|
-
fi.CTime.Write_To_FiTime(pt.CTime);
|
|
1087
|
-
pt.CTime_Defined = true;
|
|
954
|
+
return ExtractToStreamCallback->GetStream7(name, BoolToInt(_item.IsDir), outStream, askExtractMode, GetProp);
|
|
1088
955
|
}
|
|
1089
956
|
|
|
1090
|
-
|
|
1091
|
-
{
|
|
1092
|
-
fi.ATime.Write_To_FiTime(pt.ATime);
|
|
1093
|
-
pt.ATime_Defined = true;
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
957
|
+
#endif
|
|
1096
958
|
|
|
959
|
+
CMyComPtr<ISequentialOutStream> outStreamLoc;
|
|
1097
960
|
|
|
1098
|
-
|
|
961
|
+
if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
|
|
1099
962
|
{
|
|
1100
|
-
|
|
1101
|
-
UStringVector pathParts = _item.PathParts;
|
|
1102
|
-
|
|
1103
|
-
bool isFinal = true;
|
|
1104
|
-
// bool is_DirOp = false;
|
|
1105
|
-
if (!pathParts.IsEmpty())
|
|
1106
|
-
{
|
|
1107
|
-
/* v23: if we extract symlink, and we know that it links to dir:
|
|
1108
|
-
Linux: we don't create dir item (symlink_from_path) here.
|
|
1109
|
-
Windows: SetReparseData() will create dir item, if it doesn't exist,
|
|
1110
|
-
but if we create dir item here, it's not problem. */
|
|
1111
|
-
if (!_item.IsDir
|
|
1112
|
-
#ifdef SUPPORT_LINKS
|
|
1113
|
-
// #ifndef WIN32
|
|
1114
|
-
|| !_link.LinkPath.IsEmpty()
|
|
1115
|
-
// #endif
|
|
1116
|
-
#endif
|
|
1117
|
-
)
|
|
1118
|
-
{
|
|
1119
|
-
pathParts.DeleteBack();
|
|
1120
|
-
isFinal = false; // last path part was excluded
|
|
1121
|
-
}
|
|
1122
|
-
// else is_DirOp = true;
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
if (pathParts.IsEmpty())
|
|
1126
|
-
{
|
|
1127
|
-
/* if (_some_pathParts_wereRemoved && Is_elimPrefix_Mode),
|
|
1128
|
-
then we can have empty pathParts() here for root folder.
|
|
1129
|
-
v24.00: fixed: we set timestamps for such folder still.
|
|
1130
|
-
*/
|
|
1131
|
-
if (!_some_pathParts_wereRemoved ||
|
|
1132
|
-
!Is_elimPrefix_Mode)
|
|
1133
|
-
return;
|
|
1134
|
-
// return; // ignore empty paths case
|
|
1135
|
-
}
|
|
1136
|
-
/*
|
|
1137
|
-
if (is_DirOp)
|
|
963
|
+
if (_stdOutMode)
|
|
1138
964
|
{
|
|
1139
|
-
|
|
1140
|
-
_op_WasReported = true;
|
|
965
|
+
outStreamLoc = new CStdOutFileStream;
|
|
1141
966
|
}
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
FString fullPathNew;
|
|
1145
|
-
CreateComplexDirectory(pathParts, isFinal, fullPathNew);
|
|
1146
|
-
|
|
1147
|
-
/*
|
|
1148
|
-
if (is_DirOp)
|
|
967
|
+
else
|
|
1149
968
|
{
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
return;
|
|
969
|
+
{
|
|
970
|
+
NCOM::CPropVariant prop;
|
|
971
|
+
RINOK(archive->GetProperty(index, kpidAttrib, &prop));
|
|
972
|
+
if (prop.vt == VT_UI4)
|
|
973
|
+
{
|
|
974
|
+
_fi.Attrib = prop.ulVal;
|
|
975
|
+
_fi.AttribDefined = true;
|
|
976
|
+
}
|
|
977
|
+
else if (prop.vt == VT_EMPTY)
|
|
978
|
+
_fi.AttribDefined = false;
|
|
979
|
+
else
|
|
980
|
+
return E_FAIL;
|
|
981
|
+
}
|
|
1164
982
|
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
if (pt.IsSomeTimeDefined())
|
|
1169
|
-
{
|
|
1170
|
-
pt.Path = fullPathNew;
|
|
1171
|
-
pt.SetDirTime_to_FS_2();
|
|
1172
|
-
_extractedFolders.Add(pt);
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
983
|
+
RINOK(GetTime(index, kpidCTime, _fi.CTime, _fi.CTimeDefined));
|
|
984
|
+
RINOK(GetTime(index, kpidATime, _fi.ATime, _fi.ATimeDefined));
|
|
985
|
+
RINOK(GetTime(index, kpidMTime, _fi.MTime, _fi.MTimeDefined));
|
|
1175
986
|
|
|
987
|
+
bool isAnti = false;
|
|
988
|
+
RINOK(_arc->IsItemAnti(index, isAnti));
|
|
1176
989
|
|
|
990
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
991
|
+
if (!_item.IsAltStream
|
|
992
|
+
|| !pathParts.IsEmpty()
|
|
993
|
+
|| !(_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt))
|
|
994
|
+
#endif
|
|
995
|
+
Correct_FsPath(_pathMode == NExtract::NPathMode::kAbsPaths, _keepAndReplaceEmptyDirPrefixes, pathParts, _item.MainIsDir);
|
|
1177
996
|
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
997
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
998
|
+
|
|
999
|
+
if (_item.IsAltStream)
|
|
1000
|
+
{
|
|
1001
|
+
UString s (_item.AltStreamName);
|
|
1002
|
+
Correct_AltStream_Name(s);
|
|
1003
|
+
bool needColon = true;
|
|
1183
1004
|
|
|
1184
|
-
|
|
1185
|
-
{
|
|
1186
|
-
|
|
1005
|
+
if (pathParts.IsEmpty())
|
|
1006
|
+
{
|
|
1007
|
+
pathParts.AddNew();
|
|
1008
|
+
if (_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt)
|
|
1009
|
+
needColon = false;
|
|
1010
|
+
}
|
|
1011
|
+
else if (_pathMode == NExtract::NPathMode::kAbsPaths &&
|
|
1012
|
+
NWildcard::GetNumPrefixParts_if_DrivePath(pathParts) == pathParts.Size())
|
|
1013
|
+
pathParts.AddNew();
|
|
1187
1014
|
|
|
1188
|
-
|
|
1015
|
+
UString &name = pathParts.Back();
|
|
1016
|
+
if (needColon)
|
|
1017
|
+
name += (char)(_ntOptions.ReplaceColonForAltStream ? '_' : ':');
|
|
1018
|
+
name += s;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
#endif
|
|
1189
1022
|
|
|
1190
|
-
|
|
1191
|
-
{
|
|
1192
|
-
if (_overwriteMode == NExtract::NOverwriteMode::kSkip)
|
|
1193
|
-
return S_OK;
|
|
1023
|
+
UString processedPath (MakePathFromParts(pathParts));
|
|
1194
1024
|
|
|
1195
|
-
if (
|
|
1025
|
+
if (!isAnti)
|
|
1196
1026
|
{
|
|
1197
|
-
|
|
1198
|
-
const FString realFullProcessedPath = fullProcessedPath.Left((unsigned)(slashPos + 1)) + fileInfo.Name;
|
|
1199
|
-
|
|
1200
|
-
/* (fileInfo) can be symbolic link.
|
|
1201
|
-
we can show final file properties here. */
|
|
1202
|
-
|
|
1203
|
-
FILETIME ft1;
|
|
1204
|
-
FiTime_To_FILETIME(fileInfo.MTime, ft1);
|
|
1205
|
-
|
|
1206
|
-
Int32 overwriteResult;
|
|
1207
|
-
RINOK(_extractCallback2->AskOverwrite(
|
|
1208
|
-
fs2us(realFullProcessedPath), &ft1, &fileInfo.Size, _item.Path,
|
|
1209
|
-
_fi.MTime.Def ? &_fi.MTime.FT : NULL,
|
|
1210
|
-
_curSize_Defined ? &_curSize : NULL,
|
|
1211
|
-
&overwriteResult))
|
|
1212
|
-
|
|
1213
|
-
switch (overwriteResult)
|
|
1027
|
+
if (!_item.IsDir)
|
|
1214
1028
|
{
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
return S_OK;
|
|
1219
|
-
case NOverwriteAnswer::kNoToAll:
|
|
1220
|
-
_overwriteMode = NExtract::NOverwriteMode::kSkip;
|
|
1221
|
-
return S_OK;
|
|
1029
|
+
if (!pathParts.IsEmpty())
|
|
1030
|
+
pathParts.DeleteBack();
|
|
1031
|
+
}
|
|
1222
1032
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1033
|
+
if (!pathParts.IsEmpty())
|
|
1034
|
+
{
|
|
1035
|
+
FString fullPathNew;
|
|
1036
|
+
CreateComplexDirectory(pathParts, fullPathNew);
|
|
1037
|
+
|
|
1038
|
+
if (_item.IsDir)
|
|
1039
|
+
{
|
|
1040
|
+
CDirPathTime &pt = _extractedFolders.AddNew();
|
|
1041
|
+
|
|
1042
|
+
pt.CTime = _fi.CTime;
|
|
1043
|
+
pt.CTimeDefined = (WriteCTime && _fi.CTimeDefined);
|
|
1044
|
+
|
|
1045
|
+
pt.ATime = _fi.ATime;
|
|
1046
|
+
pt.ATimeDefined = (WriteATime && _fi.ATimeDefined);
|
|
1047
|
+
|
|
1048
|
+
pt.MTimeDefined = false;
|
|
1049
|
+
|
|
1050
|
+
if (WriteMTime)
|
|
1051
|
+
{
|
|
1052
|
+
if (_fi.MTimeDefined)
|
|
1053
|
+
{
|
|
1054
|
+
pt.MTime = _fi.MTime;
|
|
1055
|
+
pt.MTimeDefined = true;
|
|
1056
|
+
}
|
|
1057
|
+
else if (_arc->MTimeDefined)
|
|
1058
|
+
{
|
|
1059
|
+
pt.MTime = _arc->MTime;
|
|
1060
|
+
pt.MTimeDefined = true;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
pt.Path = fullPathNew;
|
|
1065
|
+
|
|
1066
|
+
pt.SetDirTime();
|
|
1067
|
+
}
|
|
1233
1068
|
}
|
|
1234
|
-
}
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1235
1071
|
|
|
1236
|
-
|
|
1072
|
+
FString fullProcessedPath (us2fs(processedPath));
|
|
1073
|
+
if (_pathMode != NExtract::NPathMode::kAbsPaths
|
|
1074
|
+
|| !NName::IsAbsolutePath(processedPath))
|
|
1237
1075
|
{
|
|
1238
|
-
|
|
1239
|
-
{
|
|
1240
|
-
RINOK(SendMessageError(kCantAutoRename, fullProcessedPath))
|
|
1241
|
-
return E_FAIL;
|
|
1242
|
-
}
|
|
1243
|
-
_isRenamed = true;
|
|
1076
|
+
fullProcessedPath = MakePath_from_2_Parts(_dirPathPrefix, fullProcessedPath);
|
|
1244
1077
|
}
|
|
1245
|
-
|
|
1078
|
+
|
|
1079
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
1080
|
+
|
|
1081
|
+
if (_item.IsAltStream && _item.ParentIndex != (UInt32)(Int32)-1)
|
|
1246
1082
|
{
|
|
1247
|
-
|
|
1248
|
-
if (
|
|
1249
|
-
{
|
|
1250
|
-
RINOK(SendMessageError(kCantAutoRename, fullProcessedPath))
|
|
1251
|
-
return E_FAIL;
|
|
1252
|
-
}
|
|
1253
|
-
// MyMoveFile can rename folders. So it's OK to use it for folders too
|
|
1254
|
-
if (!MyMoveFile(fullProcessedPath, existPath))
|
|
1083
|
+
int renIndex = _renamedFiles.FindInSorted(CIndexToPathPair(_item.ParentIndex));
|
|
1084
|
+
if (renIndex >= 0)
|
|
1255
1085
|
{
|
|
1256
|
-
|
|
1257
|
-
|
|
1086
|
+
const CIndexToPathPair &pair = _renamedFiles[renIndex];
|
|
1087
|
+
fullProcessedPath = pair.Path;
|
|
1088
|
+
fullProcessedPath += ':';
|
|
1089
|
+
UString s (_item.AltStreamName);
|
|
1090
|
+
Correct_AltStream_Name(s);
|
|
1091
|
+
fullProcessedPath += us2fs(s);
|
|
1258
1092
|
}
|
|
1259
1093
|
}
|
|
1260
|
-
|
|
1094
|
+
|
|
1095
|
+
#endif
|
|
1096
|
+
|
|
1097
|
+
bool isRenamed = false;
|
|
1098
|
+
|
|
1099
|
+
if (_item.IsDir)
|
|
1100
|
+
{
|
|
1101
|
+
_diskFilePath = fullProcessedPath;
|
|
1102
|
+
if (isAnti)
|
|
1103
|
+
RemoveDir(_diskFilePath);
|
|
1104
|
+
#ifdef SUPPORT_LINKS
|
|
1105
|
+
if (linkPath.IsEmpty())
|
|
1106
|
+
#endif
|
|
1107
|
+
return S_OK;
|
|
1108
|
+
}
|
|
1109
|
+
else if (!_isSplit)
|
|
1110
|
+
{
|
|
1111
|
+
|
|
1112
|
+
// ----- Is file (not split) -----
|
|
1113
|
+
NFind::CFileInfo fileInfo;
|
|
1114
|
+
if (fileInfo.Find(fullProcessedPath))
|
|
1261
1115
|
{
|
|
1262
|
-
|
|
1116
|
+
switch (_overwriteMode)
|
|
1263
1117
|
{
|
|
1264
|
-
|
|
1265
|
-
if (!RemoveDir(fullProcessedPath))
|
|
1266
|
-
{
|
|
1267
|
-
RINOK(SendMessageError_with_LastError(kCantDeleteOutputDir, fullProcessedPath))
|
|
1118
|
+
case NExtract::NOverwriteMode::kSkip:
|
|
1268
1119
|
return S_OK;
|
|
1120
|
+
case NExtract::NOverwriteMode::kAsk:
|
|
1121
|
+
{
|
|
1122
|
+
int slashPos = fullProcessedPath.ReverseFind_PathSepar();
|
|
1123
|
+
FString realFullProcessedPath (fullProcessedPath.Left(slashPos + 1) + fileInfo.Name);
|
|
1124
|
+
|
|
1125
|
+
Int32 overwriteResult;
|
|
1126
|
+
RINOK(_extractCallback2->AskOverwrite(
|
|
1127
|
+
fs2us(realFullProcessedPath), &fileInfo.MTime, &fileInfo.Size, _item.Path,
|
|
1128
|
+
_fi.MTimeDefined ? &_fi.MTime : NULL,
|
|
1129
|
+
_curSizeDefined ? &_curSize : NULL,
|
|
1130
|
+
&overwriteResult))
|
|
1131
|
+
|
|
1132
|
+
switch (overwriteResult)
|
|
1133
|
+
{
|
|
1134
|
+
case NOverwriteAnswer::kCancel: return E_ABORT;
|
|
1135
|
+
case NOverwriteAnswer::kNo: return S_OK;
|
|
1136
|
+
case NOverwriteAnswer::kNoToAll: _overwriteMode = NExtract::NOverwriteMode::kSkip; return S_OK;
|
|
1137
|
+
case NOverwriteAnswer::kYes: break;
|
|
1138
|
+
case NOverwriteAnswer::kYesToAll: _overwriteMode = NExtract::NOverwriteMode::kOverwrite; break;
|
|
1139
|
+
case NOverwriteAnswer::kAutoRename: _overwriteMode = NExtract::NOverwriteMode::kRename; break;
|
|
1140
|
+
default:
|
|
1141
|
+
return E_FAIL;
|
|
1142
|
+
}
|
|
1269
1143
|
}
|
|
1270
1144
|
}
|
|
1271
|
-
|
|
1145
|
+
if (_overwriteMode == NExtract::NOverwriteMode::kRename)
|
|
1272
1146
|
{
|
|
1273
|
-
if (
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
} // fileInfo is not Dir
|
|
1282
|
-
} // not Rename*
|
|
1283
|
-
}
|
|
1284
|
-
else // not Find(fullProcessedPath)
|
|
1285
|
-
{
|
|
1286
|
-
#if defined(_WIN32) && !defined(UNDER_CE)
|
|
1287
|
-
// we need to clear READ-ONLY of parent before creating alt stream
|
|
1288
|
-
const int colonPos = NName::FindAltStreamColon(fullProcessedPath);
|
|
1289
|
-
if (colonPos >= 0 && fullProcessedPath[(unsigned)colonPos + 1] != 0)
|
|
1290
|
-
{
|
|
1291
|
-
FString parentFsPath (fullProcessedPath);
|
|
1292
|
-
parentFsPath.DeleteFrom((unsigned)colonPos);
|
|
1293
|
-
NFind::CFileInfo parentFi;
|
|
1294
|
-
if (parentFi.Find(parentFsPath))
|
|
1147
|
+
if (!AutoRenamePath(fullProcessedPath))
|
|
1148
|
+
{
|
|
1149
|
+
RINOK(SendMessageError(kCantAutoRename, fullProcessedPath));
|
|
1150
|
+
return E_FAIL;
|
|
1151
|
+
}
|
|
1152
|
+
isRenamed = true;
|
|
1153
|
+
}
|
|
1154
|
+
else if (_overwriteMode == NExtract::NOverwriteMode::kRenameExisting)
|
|
1295
1155
|
{
|
|
1296
|
-
|
|
1156
|
+
FString existPath (fullProcessedPath);
|
|
1157
|
+
if (!AutoRenamePath(existPath))
|
|
1158
|
+
{
|
|
1159
|
+
RINOK(SendMessageError(kCantAutoRename, fullProcessedPath));
|
|
1160
|
+
return E_FAIL;
|
|
1161
|
+
}
|
|
1162
|
+
// MyMoveFile can raname folders. So it's OK to use it for folders too
|
|
1163
|
+
if (!MyMoveFile(fullProcessedPath, existPath))
|
|
1297
1164
|
{
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
SetFileAttrib(parentFsPath, parentFi.Attrib & ~(DWORD)FILE_ATTRIBUTE_READONLY);
|
|
1165
|
+
RINOK(SendMessageError2(kCantRenameFile, existPath, fullProcessedPath));
|
|
1166
|
+
return E_FAIL;
|
|
1301
1167
|
}
|
|
1302
1168
|
}
|
|
1303
|
-
|
|
1304
|
-
#endif // defined(_WIN32) && !defined(UNDER_CE)
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
needExit = false;
|
|
1308
|
-
return S_OK;
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
/*
|
|
1314
|
-
return:
|
|
1315
|
-
needExit = false: caller will use (outStreamLoc) and _hashStreamSpec
|
|
1316
|
-
needExit = true : caller will not use (outStreamLoc) and _hashStreamSpec.
|
|
1317
|
-
*/
|
|
1318
|
-
HRESULT CArchiveExtractCallback::GetExtractStream(CMyComPtr<ISequentialOutStream> &outStreamLoc, bool &needExit)
|
|
1319
|
-
{
|
|
1320
|
-
needExit = true;
|
|
1321
|
-
|
|
1322
|
-
RINOK(Read_fi_Props())
|
|
1323
|
-
|
|
1324
|
-
#ifdef SUPPORT_LINKS
|
|
1325
|
-
IInArchive * const archive = _arc->Archive;
|
|
1326
|
-
#endif
|
|
1327
|
-
|
|
1328
|
-
const UInt32 index = _index;
|
|
1329
|
-
|
|
1330
|
-
bool isAnti = false;
|
|
1331
|
-
RINOK(_arc->IsItem_Anti(index, isAnti))
|
|
1332
|
-
|
|
1333
|
-
CorrectPathParts();
|
|
1334
|
-
UString processedPath (MakePathFromParts(_item.PathParts));
|
|
1335
|
-
|
|
1336
|
-
if (!isAnti)
|
|
1337
|
-
{
|
|
1338
|
-
// 21.04: CreateFolders doesn't change (_item.PathParts)
|
|
1339
|
-
CreateFolders();
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
FString fullProcessedPath (us2fs(processedPath));
|
|
1343
|
-
if (_pathMode != NExtract::NPathMode::kAbsPaths
|
|
1344
|
-
|| !NName::IsAbsolutePath(processedPath))
|
|
1345
|
-
{
|
|
1346
|
-
fullProcessedPath = MakePath_from_2_Parts(_dirPathPrefix, fullProcessedPath);
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1350
|
-
if (_item.IsAltStream && _item.ParentIndex != (UInt32)(Int32)-1)
|
|
1351
|
-
{
|
|
1352
|
-
const int renIndex = _renamedFiles.FindInSorted(CIndexToPathPair(_item.ParentIndex));
|
|
1353
|
-
if (renIndex != -1)
|
|
1354
|
-
{
|
|
1355
|
-
const CIndexToPathPair &pair = _renamedFiles[(unsigned)renIndex];
|
|
1356
|
-
fullProcessedPath = pair.Path;
|
|
1357
|
-
fullProcessedPath.Add_Colon();
|
|
1358
|
-
UString s (_item.AltStreamName);
|
|
1359
|
-
Correct_AltStream_Name(s);
|
|
1360
|
-
fullProcessedPath += us2fs(s);
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
#endif // SUPPORT_ALT_STREAMS
|
|
1364
|
-
|
|
1365
|
-
if (_item.IsDir)
|
|
1366
|
-
{
|
|
1367
|
-
_diskFilePath = fullProcessedPath;
|
|
1368
|
-
if (isAnti)
|
|
1369
|
-
RemoveDir(_diskFilePath);
|
|
1370
|
-
#ifdef SUPPORT_LINKS
|
|
1371
|
-
if (_link.LinkPath.IsEmpty())
|
|
1372
|
-
#endif
|
|
1373
|
-
{
|
|
1374
|
-
if (!isAnti)
|
|
1375
|
-
SetAttrib();
|
|
1376
|
-
return S_OK;
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
else if (!_isSplit)
|
|
1380
|
-
{
|
|
1381
|
-
RINOK(CheckExistFile(fullProcessedPath, needExit))
|
|
1382
|
-
if (needExit)
|
|
1383
|
-
return S_OK;
|
|
1384
|
-
needExit = true;
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
_diskFilePath = fullProcessedPath;
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
if (isAnti)
|
|
1391
|
-
{
|
|
1392
|
-
needExit = false;
|
|
1393
|
-
return S_OK;
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
// not anti
|
|
1397
|
-
|
|
1398
|
-
#ifdef SUPPORT_LINKS
|
|
1399
|
-
|
|
1400
|
-
if (!_link.LinkPath.IsEmpty())
|
|
1401
|
-
{
|
|
1402
|
-
#ifndef UNDER_CE
|
|
1403
|
-
{
|
|
1404
|
-
bool linkWasSet = false;
|
|
1405
|
-
RINOK(SetLink(fullProcessedPath, _link, linkWasSet))
|
|
1406
|
-
/*
|
|
1407
|
-
// we don't set attributes for placeholder.
|
|
1408
|
-
if (linkWasSet)
|
|
1169
|
+
else
|
|
1409
1170
|
{
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1171
|
+
if (fileInfo.IsDir())
|
|
1172
|
+
{
|
|
1173
|
+
// do we need to delete all files in folder?
|
|
1174
|
+
if (!RemoveDir(fullProcessedPath))
|
|
1175
|
+
{
|
|
1176
|
+
RINOK(SendMessageError_with_LastError(kCantDeleteOutputDir, fullProcessedPath));
|
|
1177
|
+
return S_OK;
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
else
|
|
1181
|
+
{
|
|
1182
|
+
bool needDelete = true;
|
|
1183
|
+
if (needDelete)
|
|
1184
|
+
{
|
|
1185
|
+
if (NFind::DoesFileExist(fullProcessedPath))
|
|
1186
|
+
if (!DeleteFileAlways(fullProcessedPath))
|
|
1187
|
+
if (GetLastError() != ERROR_FILE_NOT_FOUND)
|
|
1188
|
+
{
|
|
1189
|
+
RINOK(SendMessageError_with_LastError(kCantDeleteOutputFile, fullProcessedPath));
|
|
1190
|
+
return S_OK;
|
|
1191
|
+
// return E_FAIL;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1413
1195
|
}
|
|
1414
|
-
*/
|
|
1415
1196
|
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
// if (_copyFile_Path.IsEmpty())
|
|
1419
|
-
{
|
|
1420
|
-
needExit = false;
|
|
1421
|
-
return S_OK;
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
if (!_hardLinks.IDs.IsEmpty() && !_item.IsAltStream && !_item.IsDir)
|
|
1426
|
-
{
|
|
1427
|
-
CHardLinkNode h;
|
|
1428
|
-
bool defined;
|
|
1429
|
-
RINOK(Archive_Get_HardLinkNode(archive, index, h, defined))
|
|
1430
|
-
if (defined)
|
|
1197
|
+
else // not Find(fullProcessedPath)
|
|
1431
1198
|
{
|
|
1432
|
-
|
|
1433
|
-
if (
|
|
1199
|
+
// we need to clear READ-ONLY of parent before creating alt stream
|
|
1200
|
+
#if defined(_WIN32) && !defined(UNDER_CE)
|
|
1201
|
+
int colonPos = NName::FindAltStreamColon(fullProcessedPath);
|
|
1202
|
+
if (colonPos >= 0 && fullProcessedPath[(unsigned)colonPos + 1] != 0)
|
|
1434
1203
|
{
|
|
1435
|
-
FString
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1204
|
+
FString parentFsPath (fullProcessedPath);
|
|
1205
|
+
parentFsPath.DeleteFrom(colonPos);
|
|
1206
|
+
NFind::CFileInfo parentFi;
|
|
1207
|
+
if (parentFi.Find(parentFsPath))
|
|
1439
1208
|
{
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
if (!link_was_Created)
|
|
1443
|
-
return S_OK;
|
|
1444
|
-
// printf("\nHard linkWasSet Archive_Get_HardLinkNode %s\n", GetAnsiString(_diskFilePath));
|
|
1445
|
-
// _needSetAttrib = true; // do we need to set attribute ?
|
|
1446
|
-
SetAttrib();
|
|
1447
|
-
/* if we set (needExit = false) here, _hashStreamSpec will be used,
|
|
1448
|
-
and hash will be calulated for all hard links files (it's slower).
|
|
1449
|
-
But "Test" operation also calculates hashes.
|
|
1450
|
-
*/
|
|
1451
|
-
needExit = false;
|
|
1452
|
-
return S_OK;
|
|
1209
|
+
if (parentFi.IsReadOnly())
|
|
1210
|
+
SetFileAttrib(parentFsPath, parentFi.Attrib & ~FILE_ATTRIBUTE_READONLY);
|
|
1453
1211
|
}
|
|
1454
1212
|
}
|
|
1213
|
+
#endif
|
|
1455
1214
|
}
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
#endif // SUPPORT_LINKS
|
|
1459
|
-
|
|
1215
|
+
// ----- END of code for Is file (not split) -----
|
|
1460
1216
|
|
|
1461
|
-
// ---------- CREATE WRITE FILE -----
|
|
1462
|
-
|
|
1463
|
-
_outFileStreamSpec = new COutFileStream;
|
|
1464
|
-
CMyComPtr<IOutStream> outFileStream_Loc(_outFileStreamSpec);
|
|
1465
|
-
|
|
1466
|
-
if (!_outFileStreamSpec->Create_ALWAYS_or_Open_ALWAYS(fullProcessedPath, !_isSplit))
|
|
1467
|
-
{
|
|
1468
|
-
// if (::GetLastError() != ERROR_FILE_EXISTS || !isSplit)
|
|
1469
|
-
{
|
|
1470
|
-
RINOK(SendMessageError_with_LastError(kCantOpenOutFile, fullProcessedPath))
|
|
1471
|
-
return S_OK;
|
|
1472
1217
|
}
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
_needSetAttrib = true;
|
|
1476
|
-
|
|
1477
|
-
bool is_SymLink_in_Data = false;
|
|
1218
|
+
_diskFilePath = fullProcessedPath;
|
|
1219
|
+
|
|
1478
1220
|
|
|
1479
|
-
|
|
1480
|
-
{
|
|
1481
|
-
if (_fi.IsLinuxSymLink())
|
|
1482
|
-
{
|
|
1483
|
-
is_SymLink_in_Data = true;
|
|
1484
|
-
_is_SymLink_in_Data_Linux = true;
|
|
1485
|
-
}
|
|
1486
|
-
else if (_fi.IsReparse())
|
|
1221
|
+
if (!isAnti)
|
|
1487
1222
|
{
|
|
1488
|
-
|
|
1489
|
-
_is_SymLink_in_Data_Linux = false;
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1223
|
+
#ifdef SUPPORT_LINKS
|
|
1492
1224
|
|
|
1493
|
-
|
|
1494
|
-
{
|
|
1495
|
-
_outMemBuf.Alloc((size_t)_curSize);
|
|
1496
|
-
_bufPtrSeqOutStream_Spec = new CBufPtrSeqOutStream;
|
|
1497
|
-
_bufPtrSeqOutStream = _bufPtrSeqOutStream_Spec;
|
|
1498
|
-
_bufPtrSeqOutStream_Spec->Init(_outMemBuf, _outMemBuf.Size());
|
|
1499
|
-
outStreamLoc = _bufPtrSeqOutStream;
|
|
1500
|
-
}
|
|
1501
|
-
else // not reparse
|
|
1502
|
-
{
|
|
1503
|
-
if (_ntOptions.PreAllocateOutFile && !_isSplit && _curSize_Defined && _curSize > (1 << 12))
|
|
1504
|
-
{
|
|
1505
|
-
// UInt64 ticks = GetCpuTicks();
|
|
1506
|
-
_fileLength_that_WasSet = _curSize;
|
|
1507
|
-
bool res = _outFileStreamSpec->File.SetLength(_curSize);
|
|
1508
|
-
_fileLength_WasSet = res;
|
|
1509
|
-
|
|
1510
|
-
// ticks = GetCpuTicks() - ticks;
|
|
1511
|
-
// printf("\nticks = %10d\n", (unsigned)ticks);
|
|
1512
|
-
if (!res)
|
|
1513
|
-
{
|
|
1514
|
-
RINOK(SendMessageError_with_LastError(kCantSetFileLen, fullProcessedPath))
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
/*
|
|
1518
|
-
_outFileStreamSpec->File.Close();
|
|
1519
|
-
ticks = GetCpuTicks() - ticks;
|
|
1520
|
-
printf("\nticks = %10d\n", (unsigned)ticks);
|
|
1521
|
-
return S_FALSE;
|
|
1522
|
-
*/
|
|
1523
|
-
|
|
1524
|
-
/*
|
|
1525
|
-
File.SetLength() on FAT (xp64): is fast, but then File.Close() can be slow,
|
|
1526
|
-
if we don't write any data.
|
|
1527
|
-
File.SetLength() for remote share file (exFAT) can be slow in some cases,
|
|
1528
|
-
and the Windows can return "network error" after 1 minute,
|
|
1529
|
-
while remote file still can grow.
|
|
1530
|
-
We need some way to detect such bad cases and disable PreAllocateOutFile mode.
|
|
1531
|
-
*/
|
|
1532
|
-
|
|
1533
|
-
res = _outFileStreamSpec->SeekToBegin_bool();
|
|
1534
|
-
if (!res)
|
|
1225
|
+
if (!linkPath.IsEmpty())
|
|
1535
1226
|
{
|
|
1536
|
-
|
|
1537
|
-
}
|
|
1538
|
-
} // PreAllocateOutFile
|
|
1539
|
-
|
|
1540
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1541
|
-
if (_isRenamed && !_item.IsAltStream)
|
|
1542
|
-
{
|
|
1543
|
-
CIndexToPathPair pair(index, fullProcessedPath);
|
|
1544
|
-
unsigned oldSize = _renamedFiles.Size();
|
|
1545
|
-
unsigned insertIndex = _renamedFiles.AddToUniqueSorted(pair);
|
|
1546
|
-
if (oldSize == _renamedFiles.Size())
|
|
1547
|
-
_renamedFiles[insertIndex].Path = fullProcessedPath;
|
|
1548
|
-
}
|
|
1549
|
-
#endif // SUPPORT_ALT_STREAMS
|
|
1550
|
-
|
|
1551
|
-
if (_isSplit)
|
|
1552
|
-
{
|
|
1553
|
-
RINOK(outFileStream_Loc->Seek((Int64)_position, STREAM_SEEK_SET, NULL))
|
|
1554
|
-
}
|
|
1555
|
-
outStreamLoc = outFileStream_Loc;
|
|
1556
|
-
} // if not reparse
|
|
1227
|
+
#ifndef UNDER_CE
|
|
1557
1228
|
|
|
1558
|
-
|
|
1229
|
+
UString relatPath;
|
|
1230
|
+
if (isRelative)
|
|
1231
|
+
relatPath = GetDirPrefixOf(_item.Path);
|
|
1232
|
+
relatPath += linkPath;
|
|
1233
|
+
|
|
1234
|
+
if (!IsSafePath(relatPath))
|
|
1235
|
+
{
|
|
1236
|
+
RINOK(SendMessageError("Dangerous link path was ignored", us2fs(relatPath)));
|
|
1237
|
+
}
|
|
1238
|
+
else
|
|
1239
|
+
{
|
|
1240
|
+
FString existPath;
|
|
1241
|
+
if (isHardLink /* || isCopyLink */ || !isRelative)
|
|
1242
|
+
{
|
|
1243
|
+
if (!NName::GetFullPath(_dirPathPrefix_Full, us2fs(relatPath), existPath))
|
|
1244
|
+
{
|
|
1245
|
+
RINOK(SendMessageError("Incorrect path", us2fs(relatPath)));
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
else
|
|
1249
|
+
{
|
|
1250
|
+
existPath = us2fs(linkPath);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
if (!existPath.IsEmpty())
|
|
1254
|
+
{
|
|
1255
|
+
if (isHardLink /* || isCopyLink */)
|
|
1256
|
+
{
|
|
1257
|
+
// if (isHardLink)
|
|
1258
|
+
{
|
|
1259
|
+
if (!MyCreateHardLink(fullProcessedPath, existPath))
|
|
1260
|
+
{
|
|
1261
|
+
RINOK(SendMessageError2(kCantCreateHardLink, fullProcessedPath, existPath));
|
|
1262
|
+
// return S_OK;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
/*
|
|
1266
|
+
else
|
|
1267
|
+
{
|
|
1268
|
+
NFind::CFileInfo fi;
|
|
1269
|
+
if (!fi.Find(existPath))
|
|
1270
|
+
{
|
|
1271
|
+
RINOK(SendMessageError2("Can not find the file for copying", existPath, fullProcessedPath));
|
|
1272
|
+
}
|
|
1273
|
+
else
|
|
1274
|
+
{
|
|
1275
|
+
if (_curSizeDefined && _curSize == fi.Size)
|
|
1276
|
+
_CopyFile_Path = existPath;
|
|
1277
|
+
else
|
|
1278
|
+
{
|
|
1279
|
+
RINOK(SendMessageError2("File size collision for file copying", existPath, fullProcessedPath));
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
// RINOK(MyCopyFile(existPath, fullProcessedPath));
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
*/
|
|
1286
|
+
}
|
|
1287
|
+
else if (_ntOptions.SymLinks.Val)
|
|
1288
|
+
{
|
|
1289
|
+
// bool isSymLink = true; // = false for junction
|
|
1290
|
+
if (_item.IsDir && !isRelative)
|
|
1291
|
+
{
|
|
1292
|
+
// if it's before Vista we use Junction Point
|
|
1293
|
+
// isJunction = true;
|
|
1294
|
+
// convertToAbs = true;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
CByteBuffer data;
|
|
1298
|
+
if (FillLinkData(data, fs2us(existPath), !isJunction))
|
|
1299
|
+
{
|
|
1300
|
+
CReparseAttr attr;
|
|
1301
|
+
DWORD errorCode = 0;
|
|
1302
|
+
if (!attr.Parse(data, data.Size(), errorCode))
|
|
1303
|
+
{
|
|
1304
|
+
RINOK(SendMessageError("Internal error for symbolic link file", us2fs(_item.Path)));
|
|
1305
|
+
// return E_FAIL;
|
|
1306
|
+
}
|
|
1307
|
+
else
|
|
1308
|
+
if (!NFile::NIO::SetReparseData(fullProcessedPath, _item.IsDir, data, (DWORD)data.Size()))
|
|
1309
|
+
{
|
|
1310
|
+
RINOK(SendMessageError_with_LastError(kCantCreateSymLink, fullProcessedPath));
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
#endif
|
|
1318
|
+
}
|
|
1559
1319
|
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
HRESULT CArchiveExtractCallback::GetItem(UInt32 index)
|
|
1567
|
-
{
|
|
1568
|
-
#ifndef Z7_SFX
|
|
1569
|
-
_item._use_baseParentFolder_mode = _use_baseParentFolder_mode;
|
|
1570
|
-
if (_use_baseParentFolder_mode)
|
|
1571
|
-
{
|
|
1572
|
-
_item._baseParentFolder = (int)_baseParentFolder;
|
|
1573
|
-
if (_pathMode == NExtract::NPathMode::kFullPaths ||
|
|
1574
|
-
_pathMode == NExtract::NPathMode::kAbsPaths)
|
|
1575
|
-
_item._baseParentFolder = -1;
|
|
1576
|
-
}
|
|
1577
|
-
#endif // Z7_SFX
|
|
1578
|
-
|
|
1579
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1580
|
-
_item.WriteToAltStreamIfColon = _ntOptions.WriteToAltStreamIfColon;
|
|
1581
|
-
#endif
|
|
1582
|
-
|
|
1583
|
-
return _arc->GetItem(index, _item);
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
Z7_COM7F_IMF(CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStream **outStream, Int32 askExtractMode))
|
|
1588
|
-
{
|
|
1589
|
-
COM_TRY_BEGIN
|
|
1590
|
-
|
|
1591
|
-
*outStream = NULL;
|
|
1592
|
-
|
|
1593
|
-
#ifndef Z7_SFX
|
|
1594
|
-
if (_hashStream)
|
|
1595
|
-
_hashStreamSpec->ReleaseStream();
|
|
1596
|
-
_hashStreamWasUsed = false;
|
|
1597
|
-
#endif
|
|
1598
|
-
|
|
1599
|
-
_outFileStream.Release();
|
|
1600
|
-
_bufPtrSeqOutStream.Release();
|
|
1601
|
-
|
|
1602
|
-
_encrypted = false;
|
|
1603
|
-
_isSplit = false;
|
|
1604
|
-
_curSize_Defined = false;
|
|
1605
|
-
_fileLength_WasSet = false;
|
|
1606
|
-
_isRenamed = false;
|
|
1607
|
-
// _fi.Clear();
|
|
1608
|
-
_extractMode = false;
|
|
1609
|
-
_is_SymLink_in_Data_Linux = false;
|
|
1610
|
-
_needSetAttrib = false;
|
|
1611
|
-
_isSymLinkCreated = false;
|
|
1612
|
-
_itemFailure = false;
|
|
1613
|
-
_some_pathParts_wereRemoved = false;
|
|
1614
|
-
// _op_WasReported = false;
|
|
1615
|
-
|
|
1616
|
-
_position = 0;
|
|
1617
|
-
_curSize = 0;
|
|
1618
|
-
_fileLength_that_WasSet = 0;
|
|
1619
|
-
_index = index;
|
|
1620
|
-
|
|
1621
|
-
#if defined(_WIN32) && !defined(UNDER_CE)
|
|
1622
|
-
_altStream_NeedRestore_AttribVal = 0;
|
|
1623
|
-
_altStream_NeedRestore_Attrib_for_parentFsPath.Empty();
|
|
1624
|
-
#endif
|
|
1625
|
-
|
|
1626
|
-
_diskFilePath.Empty();
|
|
1627
|
-
|
|
1628
|
-
#ifdef SUPPORT_LINKS
|
|
1629
|
-
// _copyFile_Path.Empty();
|
|
1630
|
-
_link.Clear();
|
|
1631
|
-
#endif
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
switch (askExtractMode)
|
|
1635
|
-
{
|
|
1636
|
-
case NArchive::NExtract::NAskMode::kExtract:
|
|
1637
|
-
if (_testMode)
|
|
1320
|
+
if (linkPath.IsEmpty() /* || !_CopyFile_Path.IsEmpty() */)
|
|
1321
|
+
#endif // SUPPORT_LINKS
|
|
1638
1322
|
{
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1323
|
+
bool needWriteFile = true;
|
|
1324
|
+
|
|
1325
|
+
#ifdef SUPPORT_LINKS
|
|
1326
|
+
if (!_hardLinks.IDs.IsEmpty() && !_item.IsAltStream)
|
|
1327
|
+
{
|
|
1328
|
+
CHardLinkNode h;
|
|
1329
|
+
bool defined;
|
|
1330
|
+
RINOK(Archive_Get_HardLinkNode(archive, index, h, defined));
|
|
1331
|
+
if (defined)
|
|
1332
|
+
{
|
|
1333
|
+
{
|
|
1334
|
+
int linkIndex = _hardLinks.IDs.FindInSorted2(h);
|
|
1335
|
+
if (linkIndex >= 0)
|
|
1336
|
+
{
|
|
1337
|
+
FString &hl = _hardLinks.Links[linkIndex];
|
|
1338
|
+
if (hl.IsEmpty())
|
|
1339
|
+
hl = fullProcessedPath;
|
|
1340
|
+
else
|
|
1341
|
+
{
|
|
1342
|
+
if (!MyCreateHardLink(fullProcessedPath, hl))
|
|
1343
|
+
{
|
|
1344
|
+
RINOK(SendMessageError2(kCantCreateHardLink, fullProcessedPath, hl));
|
|
1345
|
+
return S_OK;
|
|
1346
|
+
}
|
|
1347
|
+
needWriteFile = false;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
#endif
|
|
1354
|
+
|
|
1355
|
+
if (needWriteFile)
|
|
1356
|
+
{
|
|
1357
|
+
_outFileStreamSpec = new COutFileStream;
|
|
1358
|
+
CMyComPtr<ISequentialOutStream> outStreamLoc2(_outFileStreamSpec);
|
|
1359
|
+
if (!_outFileStreamSpec->Open(fullProcessedPath, _isSplit ? OPEN_ALWAYS: CREATE_ALWAYS))
|
|
1360
|
+
{
|
|
1361
|
+
// if (::GetLastError() != ERROR_FILE_EXISTS || !isSplit)
|
|
1362
|
+
{
|
|
1363
|
+
RINOK(SendMessageError_with_LastError(kCantOpenOutFile, fullProcessedPath));
|
|
1364
|
+
return S_OK;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1647
1367
|
|
|
1648
|
-
|
|
1368
|
+
if (_ntOptions.PreAllocateOutFile && !_isSplit && _curSizeDefined && _curSize > (1 << 12))
|
|
1369
|
+
{
|
|
1370
|
+
// UInt64 ticks = GetCpuTicks();
|
|
1371
|
+
bool res = _outFileStreamSpec->File.SetLength(_curSize);
|
|
1372
|
+
_fileLengthWasSet = res;
|
|
1649
1373
|
|
|
1650
|
-
|
|
1374
|
+
// ticks = GetCpuTicks() - ticks;
|
|
1375
|
+
// printf("\nticks = %10d\n", (unsigned)ticks);
|
|
1376
|
+
if (!res)
|
|
1377
|
+
{
|
|
1378
|
+
RINOK(SendMessageError_with_LastError(kCantSetFileLen, fullProcessedPath));
|
|
1379
|
+
}
|
|
1651
1380
|
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1381
|
+
/*
|
|
1382
|
+
_outFileStreamSpec->File.Close();
|
|
1383
|
+
ticks = GetCpuTicks() - ticks;
|
|
1384
|
+
printf("\nticks = %10d\n", (unsigned)ticks);
|
|
1385
|
+
return S_FALSE;
|
|
1386
|
+
*/
|
|
1387
|
+
|
|
1388
|
+
/*
|
|
1389
|
+
File.SetLength() on FAT (xp64): is fast, but then File.Close() can be slow,
|
|
1390
|
+
if we don't write any data.
|
|
1391
|
+
File.SetLength() for remote share file (exFAT) can be slow in some cases,
|
|
1392
|
+
and the Windows can return "network error" after 1 minute,
|
|
1393
|
+
while remote file still can grow.
|
|
1394
|
+
We need some way to detect such bad cases and disable PreAllocateOutFile mode.
|
|
1395
|
+
*/
|
|
1396
|
+
|
|
1397
|
+
res = _outFileStreamSpec->File.SeekToBegin();
|
|
1398
|
+
if (!res)
|
|
1399
|
+
{
|
|
1400
|
+
RINOK(SendMessageError_with_LastError("Can not seek to begin of file", fullProcessedPath));
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1663
1403
|
|
|
1664
|
-
#ifdef
|
|
1665
|
-
|
|
1666
|
-
#endif
|
|
1667
|
-
|
|
1668
|
-
RINOK(Archive_GetItemBoolProp(archive, index, kpidEncrypted, _encrypted))
|
|
1669
|
-
|
|
1670
|
-
RINOK(GetUnpackSize())
|
|
1671
|
-
|
|
1672
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1673
|
-
if (!_ntOptions.AltStreams.Val && _item.IsAltStream)
|
|
1674
|
-
return S_OK;
|
|
1675
|
-
#endif // SUPPORT_ALT_STREAMS
|
|
1676
|
-
|
|
1677
|
-
// we can change (_item.PathParts) in this function
|
|
1678
|
-
UStringVector &pathParts = _item.PathParts;
|
|
1679
|
-
|
|
1680
|
-
if (_wildcardCensor)
|
|
1681
|
-
{
|
|
1682
|
-
if (!CensorNode_CheckPath(*_wildcardCensor, _item))
|
|
1683
|
-
return S_OK;
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
|
-
#if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
|
|
1687
|
-
if (askExtractMode == NArchive::NExtract::NAskMode::kExtract
|
|
1688
|
-
&& !_testMode
|
|
1689
|
-
&& _item.IsAltStream
|
|
1690
|
-
&& ZoneBuf.Size() != 0
|
|
1691
|
-
&& Is_ZoneId_StreamName(_item.AltStreamName))
|
|
1692
|
-
if (ZoneMode != NExtract::NZoneIdMode::kOffice
|
|
1693
|
-
|| _item.PathParts.IsEmpty()
|
|
1694
|
-
|| FindExt2(kOfficeExtensions, _item.PathParts.Back()))
|
|
1695
|
-
return S_OK;
|
|
1696
|
-
#endif
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
#ifndef Z7_SFX
|
|
1700
|
-
if (_use_baseParentFolder_mode)
|
|
1701
|
-
{
|
|
1702
|
-
if (!pathParts.IsEmpty())
|
|
1703
|
-
{
|
|
1704
|
-
unsigned numRemovePathParts = 0;
|
|
1705
|
-
|
|
1706
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1707
|
-
if (_pathMode == NExtract::NPathMode::kNoPathsAlt && _item.IsAltStream)
|
|
1708
|
-
numRemovePathParts = pathParts.Size();
|
|
1709
|
-
else
|
|
1710
|
-
#endif
|
|
1711
|
-
if (_pathMode == NExtract::NPathMode::kNoPaths ||
|
|
1712
|
-
_pathMode == NExtract::NPathMode::kNoPathsAlt)
|
|
1713
|
-
numRemovePathParts = pathParts.Size() - 1;
|
|
1714
|
-
pathParts.DeleteFrontal(numRemovePathParts);
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
else
|
|
1718
|
-
#endif // Z7_SFX
|
|
1719
|
-
{
|
|
1720
|
-
if (pathParts.IsEmpty())
|
|
1721
|
-
{
|
|
1722
|
-
if (_item.IsDir)
|
|
1723
|
-
return S_OK;
|
|
1724
|
-
/*
|
|
1725
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1726
|
-
if (!_item.IsAltStream)
|
|
1727
|
-
#endif
|
|
1728
|
-
return E_FAIL;
|
|
1729
|
-
*/
|
|
1730
|
-
}
|
|
1731
|
-
|
|
1732
|
-
unsigned numRemovePathParts = 0;
|
|
1733
|
-
|
|
1734
|
-
switch ((int)_pathMode)
|
|
1735
|
-
{
|
|
1736
|
-
case NExtract::NPathMode::kFullPaths:
|
|
1737
|
-
case NExtract::NPathMode::kCurPaths:
|
|
1738
|
-
{
|
|
1739
|
-
if (_removePathParts.IsEmpty())
|
|
1740
|
-
break;
|
|
1741
|
-
bool badPrefix = false;
|
|
1742
|
-
|
|
1743
|
-
if (pathParts.Size() < _removePathParts.Size())
|
|
1744
|
-
badPrefix = true;
|
|
1745
|
-
else
|
|
1746
|
-
{
|
|
1747
|
-
if (pathParts.Size() == _removePathParts.Size())
|
|
1748
|
-
{
|
|
1749
|
-
if (_removePartsForAltStreams)
|
|
1750
|
-
{
|
|
1751
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1752
|
-
if (!_item.IsAltStream)
|
|
1753
|
-
#endif
|
|
1754
|
-
badPrefix = true;
|
|
1755
|
-
}
|
|
1756
|
-
else
|
|
1757
|
-
{
|
|
1758
|
-
if (!_item.MainIsDir)
|
|
1759
|
-
badPrefix = true;
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
|
|
1763
|
-
if (!badPrefix)
|
|
1764
|
-
FOR_VECTOR (i, _removePathParts)
|
|
1404
|
+
#ifdef SUPPORT_ALT_STREAMS
|
|
1405
|
+
if (isRenamed && !_item.IsAltStream)
|
|
1765
1406
|
{
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
numRemovePathParts = _removePathParts.Size();
|
|
1782
|
-
_some_pathParts_wereRemoved = true;
|
|
1783
|
-
}
|
|
1784
|
-
break;
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
case NExtract::NPathMode::kNoPaths:
|
|
1788
|
-
{
|
|
1789
|
-
if (!pathParts.IsEmpty())
|
|
1790
|
-
numRemovePathParts = pathParts.Size() - 1;
|
|
1791
|
-
break;
|
|
1792
|
-
}
|
|
1793
|
-
case NExtract::NPathMode::kNoPathsAlt:
|
|
1794
|
-
{
|
|
1795
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1796
|
-
if (_item.IsAltStream)
|
|
1797
|
-
numRemovePathParts = pathParts.Size();
|
|
1798
|
-
else
|
|
1799
|
-
#endif
|
|
1800
|
-
if (!pathParts.IsEmpty())
|
|
1801
|
-
numRemovePathParts = pathParts.Size() - 1;
|
|
1802
|
-
break;
|
|
1803
|
-
}
|
|
1804
|
-
case NExtract::NPathMode::kAbsPaths:
|
|
1805
|
-
default:
|
|
1806
|
-
break;
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1809
|
-
pathParts.DeleteFrontal(numRemovePathParts);
|
|
1810
|
-
}
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
#ifndef Z7_SFX
|
|
1814
|
-
|
|
1815
|
-
if (ExtractToStreamCallback)
|
|
1816
|
-
{
|
|
1817
|
-
CMyComPtr2_Create<IGetProp, CGetProp> GetProp;
|
|
1818
|
-
GetProp->Arc = _arc;
|
|
1819
|
-
GetProp->IndexInArc = index;
|
|
1820
|
-
UString name (MakePathFromParts(pathParts));
|
|
1821
|
-
// GetProp->BaseName = name;
|
|
1822
|
-
#ifdef SUPPORT_ALT_STREAMS
|
|
1823
|
-
if (_item.IsAltStream)
|
|
1824
|
-
{
|
|
1825
|
-
if (!pathParts.IsEmpty() || (!_removePartsForAltStreams && _pathMode != NExtract::NPathMode::kNoPathsAlt))
|
|
1826
|
-
name.Add_Colon();
|
|
1827
|
-
name += _item.AltStreamName;
|
|
1828
|
-
}
|
|
1829
|
-
#endif
|
|
1830
|
-
|
|
1831
|
-
return ExtractToStreamCallback->GetStream7(name, BoolToInt(_item.IsDir), outStream, askExtractMode, GetProp);
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
#endif // Z7_SFX
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
CMyComPtr<ISequentialOutStream> outStreamLoc;
|
|
1838
|
-
|
|
1839
|
-
if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
|
|
1840
|
-
{
|
|
1841
|
-
if (_stdOutMode)
|
|
1842
|
-
outStreamLoc = new CStdOutFileStream;
|
|
1843
|
-
else
|
|
1844
|
-
{
|
|
1845
|
-
bool needExit = true;
|
|
1846
|
-
RINOK(GetExtractStream(outStreamLoc, needExit))
|
|
1847
|
-
if (needExit)
|
|
1848
|
-
return S_OK;
|
|
1849
|
-
}
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1852
|
-
#ifndef Z7_SFX
|
|
1853
|
-
if (_hashStream)
|
|
1854
|
-
{
|
|
1855
|
-
if (askExtractMode == NArchive::NExtract::NAskMode::kExtract ||
|
|
1856
|
-
askExtractMode == NArchive::NExtract::NAskMode::kTest)
|
|
1857
|
-
{
|
|
1858
|
-
_hashStreamSpec->SetStream(outStreamLoc);
|
|
1859
|
-
outStreamLoc = _hashStream;
|
|
1860
|
-
_hashStreamSpec->Init(true);
|
|
1861
|
-
_hashStreamWasUsed = true;
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
#endif // Z7_SFX
|
|
1865
|
-
|
|
1866
|
-
if (outStreamLoc)
|
|
1867
|
-
{
|
|
1868
|
-
/*
|
|
1869
|
-
#ifdef SUPPORT_LINKS
|
|
1870
|
-
if (!_copyFile_Path.IsEmpty())
|
|
1871
|
-
{
|
|
1872
|
-
RINOK(PrepareOperation(askExtractMode));
|
|
1873
|
-
RINOK(MyCopyFile(outStreamLoc));
|
|
1874
|
-
return SetOperationResult(NArchive::NExtract::NOperationResult::kOK);
|
|
1875
|
-
}
|
|
1876
|
-
if (_link.isCopyLink && _testMode)
|
|
1877
|
-
return S_OK;
|
|
1878
|
-
#endif
|
|
1879
|
-
*/
|
|
1880
|
-
*outStream = outStreamLoc.Detach();
|
|
1881
|
-
}
|
|
1882
|
-
|
|
1883
|
-
return S_OK;
|
|
1884
|
-
|
|
1885
|
-
COM_TRY_END
|
|
1886
|
-
}
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
Z7_COM7F_IMF(CArchiveExtractCallback::PrepareOperation(Int32 askExtractMode))
|
|
1899
|
-
{
|
|
1900
|
-
COM_TRY_BEGIN
|
|
1901
|
-
|
|
1902
|
-
#ifndef Z7_SFX
|
|
1903
|
-
// if (!_op_WasReported)
|
|
1904
|
-
if (ExtractToStreamCallback)
|
|
1905
|
-
return ExtractToStreamCallback->PrepareOperation7(askExtractMode);
|
|
1906
|
-
#endif
|
|
1907
|
-
|
|
1908
|
-
_extractMode = false;
|
|
1909
|
-
|
|
1910
|
-
switch (askExtractMode)
|
|
1911
|
-
{
|
|
1912
|
-
case NArchive::NExtract::NAskMode::kExtract:
|
|
1913
|
-
if (_testMode)
|
|
1914
|
-
askExtractMode = NArchive::NExtract::NAskMode::kTest;
|
|
1915
|
-
else
|
|
1916
|
-
_extractMode = true;
|
|
1917
|
-
break;
|
|
1918
|
-
default: break;
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
// if (_op_WasReported) return S_OK;
|
|
1922
|
-
|
|
1923
|
-
return _extractCallback2->PrepareOperation(_item.Path, BoolToInt(_item.IsDir),
|
|
1924
|
-
askExtractMode, _isSplit ? &_position: NULL);
|
|
1925
|
-
|
|
1926
|
-
COM_TRY_END
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
HRESULT CArchiveExtractCallback::CloseFile()
|
|
1934
|
-
{
|
|
1935
|
-
if (!_outFileStream)
|
|
1936
|
-
return S_OK;
|
|
1937
|
-
|
|
1938
|
-
HRESULT hres = S_OK;
|
|
1939
|
-
|
|
1940
|
-
const UInt64 processedSize = _outFileStreamSpec->ProcessedSize;
|
|
1941
|
-
if (_fileLength_WasSet && _fileLength_that_WasSet > processedSize)
|
|
1942
|
-
{
|
|
1943
|
-
const bool res = _outFileStreamSpec->File.SetLength(processedSize);
|
|
1944
|
-
_fileLength_WasSet = res;
|
|
1945
|
-
if (!res)
|
|
1946
|
-
{
|
|
1947
|
-
const HRESULT hres2 = SendMessageError_with_LastError(kCantSetFileLen, us2fs(_item.Path));
|
|
1948
|
-
if (hres == S_OK)
|
|
1949
|
-
hres = hres2;
|
|
1950
|
-
}
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
_curSize = processedSize;
|
|
1954
|
-
_curSize_Defined = true;
|
|
1955
|
-
|
|
1956
|
-
#if defined(_WIN32) && !defined(UNDER_CE) && !defined(Z7_SFX)
|
|
1957
|
-
if (ZoneBuf.Size() != 0
|
|
1958
|
-
&& !_item.IsAltStream)
|
|
1959
|
-
{
|
|
1960
|
-
// if (NFind::DoesFileExist_Raw(tempFilePath))
|
|
1961
|
-
if (ZoneMode != NExtract::NZoneIdMode::kOffice ||
|
|
1962
|
-
FindExt2(kOfficeExtensions, fs2us(_diskFilePath)))
|
|
1963
|
-
{
|
|
1964
|
-
// we must write zone file before setting of timestamps
|
|
1965
|
-
if (!WriteZoneFile_To_BaseFile(_diskFilePath, ZoneBuf))
|
|
1966
|
-
{
|
|
1967
|
-
// we can't write it in FAT
|
|
1968
|
-
// SendMessageError_with_LastError("Can't write Zone.Identifier stream", path);
|
|
1969
|
-
}
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
#endif
|
|
1973
|
-
|
|
1974
|
-
CFiTimesCAM t;
|
|
1975
|
-
GetFiTimesCAM(_fi, t, *_arc);
|
|
1976
|
-
|
|
1977
|
-
// #ifdef _WIN32
|
|
1978
|
-
if (t.IsSomeTimeDefined())
|
|
1979
|
-
_outFileStreamSpec->SetTime(
|
|
1980
|
-
t.CTime_Defined ? &t.CTime : NULL,
|
|
1981
|
-
t.ATime_Defined ? &t.ATime : NULL,
|
|
1982
|
-
t.MTime_Defined ? &t.MTime : NULL);
|
|
1983
|
-
// #endif
|
|
1984
|
-
|
|
1985
|
-
RINOK(_outFileStreamSpec->Close())
|
|
1986
|
-
_outFileStream.Release();
|
|
1987
|
-
|
|
1988
|
-
#if defined(_WIN32) && !defined(UNDER_CE)
|
|
1989
|
-
if (!_altStream_NeedRestore_Attrib_for_parentFsPath.IsEmpty())
|
|
1990
|
-
{
|
|
1991
|
-
SetFileAttrib(_altStream_NeedRestore_Attrib_for_parentFsPath, _altStream_NeedRestore_AttribVal);
|
|
1992
|
-
_altStream_NeedRestore_Attrib_for_parentFsPath.Empty();
|
|
1993
|
-
}
|
|
1994
|
-
#endif
|
|
1995
|
-
|
|
1996
|
-
return hres;
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
#ifdef SUPPORT_LINKS
|
|
2001
|
-
|
|
2002
|
-
static bool CheckLinkPath_in_FS_for_pathParts(const FString &path, const UStringVector &v)
|
|
2003
|
-
{
|
|
2004
|
-
FString path2 = path;
|
|
2005
|
-
FOR_VECTOR (i, v)
|
|
2006
|
-
{
|
|
2007
|
-
// if (i == v.Size() - 1) path = path2; // we don't need last part in returned path
|
|
2008
|
-
path2 += us2fs(v[i]);
|
|
2009
|
-
NFind::CFileInfo fi;
|
|
2010
|
-
// printf("\nCheckLinkPath_in_FS_for_pathParts(): %s\n", GetOemString(path2).Ptr());
|
|
2011
|
-
if (fi.Find(path2) && fi.IsOsSymLink())
|
|
2012
|
-
return false;
|
|
2013
|
-
path2.Add_PathSepar();
|
|
2014
|
-
}
|
|
2015
|
-
return true;
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
/*
|
|
2019
|
-
link.isRelative / relative_item_PathPrefix
|
|
2020
|
-
false / empty
|
|
2021
|
-
true / item path without last part
|
|
2022
|
-
*/
|
|
2023
|
-
static bool CheckLinkPath_in_FS(
|
|
2024
|
-
const FString &pathPrefix_in_FS,
|
|
2025
|
-
const CPostLink &postLink,
|
|
2026
|
-
const UString &relative_item_PathPrefix)
|
|
2027
|
-
{
|
|
2028
|
-
const CLinkInfo &link = postLink.LinkInfo;
|
|
2029
|
-
if (postLink.item_PathParts.IsEmpty() || link.LinkPath.IsEmpty())
|
|
2030
|
-
return false;
|
|
2031
|
-
FString path;
|
|
2032
|
-
{
|
|
2033
|
-
const UString &s = postLink.item_PathParts[0];
|
|
2034
|
-
if (!s.IsEmpty() && !NName::IsAbsolutePath(s))
|
|
2035
|
-
path = pathPrefix_in_FS; // item_PathParts is relative. So we use absolutre prefix
|
|
2036
|
-
}
|
|
2037
|
-
if (!CheckLinkPath_in_FS_for_pathParts(path, postLink.item_PathParts))
|
|
2038
|
-
return false;
|
|
2039
|
-
path += us2fs(relative_item_PathPrefix);
|
|
2040
|
-
UStringVector v;
|
|
2041
|
-
SplitPathToParts(link.LinkPath, v);
|
|
2042
|
-
// we check target paths:
|
|
2043
|
-
return CheckLinkPath_in_FS_for_pathParts(path, v);
|
|
2044
|
-
}
|
|
2045
|
-
|
|
2046
|
-
static const unsigned k_DangLevel_MAX_for_Link_over_Link = 9;
|
|
2047
|
-
|
|
2048
|
-
HRESULT CArchiveExtractCallback::CreateHardLink2(
|
|
2049
|
-
const FString &newFilePath, const FString &existFilePath, bool &link_was_Created) const
|
|
2050
|
-
{
|
|
2051
|
-
link_was_Created = false;
|
|
2052
|
-
if (_ntOptions.SymLinks_DangerousLevel <= k_DangLevel_MAX_for_Link_over_Link)
|
|
2053
|
-
{
|
|
2054
|
-
NFind::CFileInfo fi;
|
|
2055
|
-
if (fi.Find(existFilePath) && fi.IsOsSymLink())
|
|
2056
|
-
return SendMessageError2(0, k_HardLink_to_SymLink_Ignored, newFilePath, existFilePath);
|
|
2057
|
-
}
|
|
2058
|
-
if (!MyCreateHardLink(newFilePath, existFilePath))
|
|
2059
|
-
return SendMessageError2_with_LastError(kCantCreateHardLink, newFilePath, existFilePath);
|
|
2060
|
-
link_was_Created = true;
|
|
2061
|
-
return S_OK;
|
|
2062
|
-
}
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
HRESULT CArchiveExtractCallback::SetLink(
|
|
2067
|
-
const FString &fullProcessedPath_from,
|
|
2068
|
-
const CLinkInfo &link,
|
|
2069
|
-
bool &linkWasSet) // placeholder was created
|
|
2070
|
-
{
|
|
2071
|
-
linkWasSet = false;
|
|
2072
|
-
if (link.LinkPath.IsEmpty())
|
|
2073
|
-
return S_OK;
|
|
2074
|
-
if (!_ntOptions.SymLinks.Val && link.Is_AnySymLink())
|
|
2075
|
-
return S_OK;
|
|
2076
|
-
CPostLink postLink;
|
|
2077
|
-
postLink.Index_in_Arc = _index;
|
|
2078
|
-
postLink.item_IsDir = _item.IsDir;
|
|
2079
|
-
postLink.item_Path = _item.Path;
|
|
2080
|
-
postLink.item_PathParts = _item.PathParts;
|
|
2081
|
-
postLink.item_FileInfo = _fi;
|
|
2082
|
-
postLink.fullProcessedPath_from = fullProcessedPath_from;
|
|
2083
|
-
postLink.LinkInfo = link;
|
|
2084
|
-
_postLinks.Add(postLink);
|
|
2085
|
-
|
|
2086
|
-
// file doesn't exist in most cases. So we don't check for error.
|
|
2087
|
-
DeleteLinkFileAlways_or_RemoveEmptyDir(fullProcessedPath_from, false); // checkThatFileIsEmpty = false
|
|
2088
|
-
|
|
2089
|
-
NIO::COutFile outFile;
|
|
2090
|
-
if (!outFile.Create_NEW(fullProcessedPath_from))
|
|
2091
|
-
return SendMessageError("Cannot create temporary link file", fullProcessedPath_from);
|
|
2092
|
-
#if 0 // 1 for debug
|
|
2093
|
-
// here we can write link path to temporary link file placeholder,
|
|
2094
|
-
// but empty placeholder is better, because we don't want to get any non-eampty data instead of link file.
|
|
2095
|
-
AString s;
|
|
2096
|
-
ConvertUnicodeToUTF8(link.LinkPath, s);
|
|
2097
|
-
outFile.WriteFull(s, s.Len());
|
|
2098
|
-
#endif
|
|
2099
|
-
linkWasSet = true;
|
|
2100
|
-
return S_OK;
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
// if file/dir is symbolic link it will remove only link itself
|
|
2105
|
-
HRESULT CArchiveExtractCallback::DeleteLinkFileAlways_or_RemoveEmptyDir(
|
|
2106
|
-
const FString &path, bool checkThatFileIsEmpty) const
|
|
2107
|
-
{
|
|
2108
|
-
NFile::NFind::CFileInfo fi;
|
|
2109
|
-
if (fi.Find(path)) // followLink = false
|
|
2110
|
-
{
|
|
2111
|
-
if (fi.IsDir())
|
|
2112
|
-
{
|
|
2113
|
-
if (RemoveDirAlways_if_Empty(path))
|
|
2114
|
-
return S_OK;
|
|
2115
|
-
}
|
|
2116
|
-
else
|
|
2117
|
-
{
|
|
2118
|
-
// link file placeholder must be empty
|
|
2119
|
-
if (checkThatFileIsEmpty && !fi.IsOsSymLink() && fi.Size != 0)
|
|
2120
|
-
return SendMessageError("Temporary link file is not empty", path);
|
|
2121
|
-
if (DeleteFileAlways(path))
|
|
2122
|
-
return S_OK;
|
|
2123
|
-
}
|
|
2124
|
-
if (GetLastError() != ERROR_FILE_NOT_FOUND)
|
|
2125
|
-
return SendMessageError_with_LastError(
|
|
2126
|
-
fi.IsDir() ?
|
|
2127
|
-
k_CantDelete_Dir_for_SymLink:
|
|
2128
|
-
k_CantDelete_File_for_SymLink,
|
|
2129
|
-
path);
|
|
2130
|
-
}
|
|
2131
|
-
return S_OK;
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
/*
|
|
2136
|
-
in:
|
|
2137
|
-
link.LinkPath : must be relative (non-absolute) path in any case !!!
|
|
2138
|
-
link.isRelative / target path that must stored as created link:
|
|
2139
|
-
== false / _dirPathPrefix_Full + link.LinkPath
|
|
2140
|
-
== true / link.LinkPath
|
|
2141
|
-
*/
|
|
2142
|
-
static HRESULT SetLink2(const CArchiveExtractCallback &callback,
|
|
2143
|
-
const CPostLink &postLink, bool &linkWasSet)
|
|
2144
|
-
{
|
|
2145
|
-
const CLinkInfo &link = postLink.LinkInfo;
|
|
2146
|
-
const FString &fullProcessedPath_from = postLink.fullProcessedPath_from; // full file path in FS (fullProcessedPath_from)
|
|
2147
|
-
|
|
2148
|
-
const unsigned level = callback._ntOptions.SymLinks_DangerousLevel;
|
|
2149
|
-
if (level < 20)
|
|
2150
|
-
{
|
|
2151
|
-
/*
|
|
2152
|
-
We want to use additional check for links that can link to directory.
|
|
2153
|
-
- linux: all symbolic links are files.
|
|
2154
|
-
- windows: we can have file/directory symbolic link,
|
|
2155
|
-
but file symbolic link works like directory link in windows.
|
|
2156
|
-
So we use additional check for all relative links.
|
|
2157
|
-
|
|
2158
|
-
We don't allow decreasing of final level of link.
|
|
2159
|
-
So if some another extracted file will use this link,
|
|
2160
|
-
then number of real path parts (after link redirection) cannot be
|
|
2161
|
-
smaller than number of requested path parts from archive records.
|
|
2162
|
-
|
|
2163
|
-
here we check only (link.LinkPath) without (_item.PathParts).
|
|
2164
|
-
*/
|
|
2165
|
-
CLinkLevelsInfo li;
|
|
2166
|
-
li.Parse(link.LinkPath, link.Is_WSL());
|
|
2167
|
-
bool isDang;
|
|
2168
|
-
UString relativePathPrefix;
|
|
2169
|
-
if (li.IsAbsolute // unexpected
|
|
2170
|
-
|| li.ParentDirDots_after_NonParent
|
|
2171
|
-
|| (level <= 5 && link.isRelative && li.FinalLevel < 1) // final level lower
|
|
2172
|
-
|| (level <= 5 && link.isRelative && li.LowLevel < 0) // negative temporary levels
|
|
2173
|
-
)
|
|
2174
|
-
isDang = true;
|
|
2175
|
-
else // if (!isDang)
|
|
2176
|
-
{
|
|
2177
|
-
UString path;
|
|
2178
|
-
if (link.isRelative)
|
|
2179
|
-
{
|
|
2180
|
-
// item_PathParts : parts that will be created in output folder.
|
|
2181
|
-
// we want to get directory prefix of link item.
|
|
2182
|
-
// so we remove file name (last non-empty part) from PathParts:
|
|
2183
|
-
UStringVector v = postLink.item_PathParts;
|
|
2184
|
-
while (!v.IsEmpty())
|
|
2185
|
-
{
|
|
2186
|
-
const unsigned len = v.Back().Len();
|
|
2187
|
-
v.DeleteBack();
|
|
2188
|
-
if (len)
|
|
2189
|
-
break;
|
|
2190
|
-
}
|
|
2191
|
-
path = MakePathFromParts(v);
|
|
2192
|
-
NName::NormalizeDirPathPrefix(path);
|
|
2193
|
-
relativePathPrefix = path;
|
|
2194
|
-
}
|
|
2195
|
-
path += link.LinkPath;
|
|
2196
|
-
/*
|
|
2197
|
-
path is calculated virtual target path of link
|
|
2198
|
-
path is relative to root folder of extracted items
|
|
2199
|
-
if (!link.isRelative), then (path == link.LinkPath)
|
|
2200
|
-
*/
|
|
2201
|
-
isDang = false;
|
|
2202
|
-
if (!IsSafePath(path, link.Is_WSL()))
|
|
2203
|
-
isDang = true;
|
|
2204
|
-
}
|
|
2205
|
-
const char *message = NULL;
|
|
2206
|
-
if (isDang)
|
|
2207
|
-
message = "Dangerous link path was ignored";
|
|
2208
|
-
else if (level <= k_DangLevel_MAX_for_Link_over_Link
|
|
2209
|
-
&& !CheckLinkPath_in_FS(callback._dirPathPrefix_Full,
|
|
2210
|
-
postLink, relativePathPrefix))
|
|
2211
|
-
message = "Dangerous link via another link was ignored";
|
|
2212
|
-
if (message)
|
|
2213
|
-
return callback.SendMessageError2(0, // errorCode
|
|
2214
|
-
message, us2fs(postLink.item_Path), us2fs(link.LinkPath));
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
FString target; // target path that will be stored to link field
|
|
2218
|
-
if (link.Is_HardLink() /* || link.IsCopyLink */ || !link.isRelative)
|
|
2219
|
-
{
|
|
2220
|
-
// isRelative == false
|
|
2221
|
-
// all hard links and absolute symbolic links
|
|
2222
|
-
// relatPath == link.LinkPath
|
|
2223
|
-
// we get absolute link path for target:
|
|
2224
|
-
if (!NName::GetFullPath(callback._dirPathPrefix_Full, us2fs(link.LinkPath), target))
|
|
2225
|
-
return callback.SendMessageError("Incorrect link path", us2fs(link.LinkPath));
|
|
2226
|
-
// (target) is (_dirPathPrefix_Full + relatPath)
|
|
2227
|
-
}
|
|
2228
|
-
else
|
|
2229
|
-
{
|
|
2230
|
-
// link.isRelative == true
|
|
2231
|
-
// relative symbolic links only
|
|
2232
|
-
target = us2fs(link.LinkPath);
|
|
2233
|
-
}
|
|
2234
|
-
if (target.IsEmpty())
|
|
2235
|
-
return callback.SendMessageError("Empty link", fullProcessedPath_from);
|
|
2236
|
-
|
|
2237
|
-
if (link.Is_HardLink() /* || link.IsCopyLink */)
|
|
2238
|
-
{
|
|
2239
|
-
// if (link.isHardLink)
|
|
2240
|
-
{
|
|
2241
|
-
RINOK(callback.DeleteLinkFileAlways_or_RemoveEmptyDir(fullProcessedPath_from, true)) // checkThatFileIsEmpty
|
|
2242
|
-
{
|
|
2243
|
-
// RINOK(SendMessageError_with_LastError(k_Cant_DeleteTempLinkFile, fullProcessedPath_from))
|
|
2244
|
-
}
|
|
2245
|
-
return callback.CreateHardLink2(fullProcessedPath_from, target, linkWasSet);
|
|
2246
|
-
/*
|
|
2247
|
-
RINOK(PrepareOperation(NArchive::NExtract::NAskMode::kExtract))
|
|
2248
|
-
_op_WasReported = true;
|
|
2249
|
-
RINOK(SetOperationResult(NArchive::NExtract::NOperationResult::kOK))
|
|
2250
|
-
linkWasSet = true;
|
|
2251
|
-
return S_OK;
|
|
2252
|
-
*/
|
|
2253
|
-
}
|
|
2254
|
-
/*
|
|
2255
|
-
// IsCopyLink
|
|
2256
|
-
{
|
|
2257
|
-
NFind::CFileInfo fi;
|
|
2258
|
-
if (!fi.Find(target))
|
|
2259
|
-
{
|
|
2260
|
-
RINOK(SendMessageError2("Cannot find the file for copying", target, fullProcessedPath));
|
|
2261
|
-
}
|
|
2262
|
-
else
|
|
2263
|
-
{
|
|
2264
|
-
if (_curSize_Defined && _curSize == fi.Size)
|
|
2265
|
-
_copyFile_Path = target;
|
|
2266
|
-
else
|
|
2267
|
-
{
|
|
2268
|
-
RINOK(SendMessageError2("File size collision for file copying", target, fullProcessedPath));
|
|
2269
|
-
}
|
|
2270
|
-
// RINOK(MyCopyFile(target, fullProcessedPath));
|
|
2271
|
-
}
|
|
2272
|
-
}
|
|
2273
|
-
*/
|
|
2274
|
-
}
|
|
2275
|
-
|
|
2276
|
-
// is Symbolic link
|
|
2277
|
-
|
|
2278
|
-
/*
|
|
2279
|
-
if (_item.IsDir && !isRelative)
|
|
2280
|
-
{
|
|
2281
|
-
// Windows before Vista doesn't support symbolic links.
|
|
2282
|
-
// we could convert such symbolic links to Junction Points
|
|
2283
|
-
// isJunction = true;
|
|
2284
|
-
}
|
|
2285
|
-
*/
|
|
2286
|
-
|
|
2287
|
-
#ifdef _WIN32
|
|
2288
|
-
const bool isDir = (postLink.item_IsDir || link.LinkType == k_LinkType_Junction);
|
|
2289
|
-
#endif
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
#ifdef _WIN32
|
|
2293
|
-
CByteBuffer data;
|
|
2294
|
-
// printf("\nFillLinkData(): %s\n", GetOemString(target).Ptr());
|
|
2295
|
-
if (link.Is_WSL())
|
|
2296
|
-
{
|
|
2297
|
-
Convert_WinPath_to_WslLinuxPath(target, !link.isRelative);
|
|
2298
|
-
FillLinkData_WslLink(data, fs2us(target));
|
|
2299
|
-
}
|
|
2300
|
-
else
|
|
2301
|
-
FillLinkData_WinLink(data, fs2us(target), link.LinkType != k_LinkType_Junction);
|
|
2302
|
-
if (data.Size() == 0)
|
|
2303
|
-
return callback.SendMessageError("Cannot fill link data", us2fs(postLink.item_Path));
|
|
2304
|
-
/*
|
|
2305
|
-
if (NtReparse_Size != data.Size() || memcmp(NtReparse_Data, data, data.Size()) != 0)
|
|
2306
|
-
SendMessageError("reconstructed Reparse is different", fs2us(target));
|
|
2307
|
-
*/
|
|
2308
|
-
{
|
|
2309
|
-
// we check that reparse data is correct, but we ignore attr.MinorError.
|
|
2310
|
-
CReparseAttr attr;
|
|
2311
|
-
if (!attr.Parse(data, data.Size()))
|
|
2312
|
-
return callback.SendMessageError("Internal error for symbolic link file", us2fs(postLink.item_Path));
|
|
2313
|
-
}
|
|
2314
|
-
#endif
|
|
2315
|
-
|
|
2316
|
-
RINOK(callback.DeleteLinkFileAlways_or_RemoveEmptyDir(fullProcessedPath_from, true)) // checkThatFileIsEmpty
|
|
2317
|
-
#ifdef _WIN32
|
|
2318
|
-
if (!NFile::NIO::SetReparseData(fullProcessedPath_from, isDir, data, (DWORD)data.Size()))
|
|
2319
|
-
#else // ! _WIN32
|
|
2320
|
-
if (!NFile::NIO::SetSymLink(fullProcessedPath_from, target))
|
|
2321
|
-
#endif // ! _WIN32
|
|
2322
|
-
{
|
|
2323
|
-
return callback.SendMessageError_with_LastError(kCantCreateSymLink, fullProcessedPath_from);
|
|
2324
|
-
}
|
|
2325
|
-
linkWasSet = true;
|
|
2326
|
-
return S_OK;
|
|
2327
|
-
}
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
bool CLinkInfo::Parse_from_WindowsReparseData(const Byte *data, size_t dataSize)
|
|
2332
|
-
{
|
|
2333
|
-
CReparseAttr reparse;
|
|
2334
|
-
if (!reparse.Parse(data, dataSize))
|
|
2335
|
-
return false;
|
|
2336
|
-
// const AString s = GetAnsiString(LinkPath);
|
|
2337
|
-
// printf("\nlinkPath: %s\n", s.Ptr());
|
|
2338
|
-
LinkPath = reparse.GetPath();
|
|
2339
|
-
if (reparse.IsSymLink_WSL())
|
|
2340
|
-
{
|
|
2341
|
-
LinkType = k_LinkType_WSL;
|
|
2342
|
-
isRelative = reparse.IsRelative_WSL(); // detected from LinkPath[0]
|
|
2343
|
-
// LinkPath is original raw name converted to UString from AString
|
|
2344
|
-
// Linux separator '/' is expected here.
|
|
2345
|
-
REPLACE_SLASHES_from_Linux_to_Sys(LinkPath)
|
|
2346
|
-
}
|
|
2347
|
-
else
|
|
2348
|
-
{
|
|
2349
|
-
LinkType = reparse.IsMountPoint() ? k_LinkType_Junction : k_LinkType_PureSymLink;
|
|
2350
|
-
isRelative = reparse.IsRelative_Win(); // detected by (Flags == Z7_WIN_SYMLINK_FLAG_RELATIVE)
|
|
2351
|
-
isWindowsPath = true;
|
|
2352
|
-
// LinkPath is original windows link path from raparse data with \??\ prefix removed.
|
|
2353
|
-
// windows '\\' separator is expected here.
|
|
2354
|
-
// linux '/' separator is not expected here.
|
|
2355
|
-
// we translate both types of separators to system separator.
|
|
2356
|
-
LinkPath.Replace(
|
|
2357
|
-
#if WCHAR_PATH_SEPARATOR == L'\\'
|
|
2358
|
-
L'/'
|
|
2359
|
-
#else
|
|
2360
|
-
L'\\'
|
|
2361
|
-
#endif
|
|
2362
|
-
, WCHAR_PATH_SEPARATOR);
|
|
2363
|
-
}
|
|
2364
|
-
// (LinkPath) uses system path separator.
|
|
2365
|
-
// windows: (LinkPath) doesn't contain linux separator (slash).
|
|
2366
|
-
return true;
|
|
2367
|
-
}
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
bool CLinkInfo::Parse_from_LinuxData(const Byte *data, size_t dataSize)
|
|
2371
|
-
{
|
|
2372
|
-
// Clear(); // *this object was cleared by constructor already.
|
|
2373
|
-
LinkType = k_LinkType_PureSymLink;
|
|
2374
|
-
AString utf;
|
|
2375
|
-
if (dataSize >= k_LinkDataSize_LIMIT)
|
|
2376
|
-
return false;
|
|
2377
|
-
utf.SetFrom_CalcLen((const char *)data, (unsigned)dataSize);
|
|
2378
|
-
UString u;
|
|
2379
|
-
if (!ConvertUTF8ToUnicode(utf, u))
|
|
2380
|
-
return false;
|
|
2381
|
-
if (u.IsEmpty())
|
|
2382
|
-
return false;
|
|
2383
|
-
const wchar_t c = u[0];
|
|
2384
|
-
isRelative = (c != L'/');
|
|
2385
|
-
// linux path separator is expected
|
|
2386
|
-
REPLACE_SLASHES_from_Linux_to_Sys(u)
|
|
2387
|
-
LinkPath = u;
|
|
2388
|
-
// (LinkPath) uses system path separator.
|
|
2389
|
-
// windows: (LinkPath) doesn't contain linux separator (slash).
|
|
2390
|
-
return true;
|
|
2391
|
-
}
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
// in/out: (LinkPath) uses system path separator
|
|
2395
|
-
// in/out: windows: (LinkPath) doesn't contain linux separator (slash).
|
|
2396
|
-
// out: (LinkPath) is relative path, and LinkPath[0] is not path separator
|
|
2397
|
-
// out: isRelative changed to false, if any prefix was removed.
|
|
2398
|
-
// note: absolute windows links "c:\" to root will be reduced to empty string:
|
|
2399
|
-
void CLinkInfo::Remove_AbsPathPrefixes()
|
|
2400
|
-
{
|
|
2401
|
-
while (!LinkPath.IsEmpty())
|
|
2402
|
-
{
|
|
2403
|
-
unsigned n = 0;
|
|
2404
|
-
if (!Is_WSL())
|
|
2405
|
-
{
|
|
2406
|
-
n =
|
|
2407
|
-
#ifndef _WIN32
|
|
2408
|
-
isWindowsPath ?
|
|
2409
|
-
NName::GetRootPrefixSize_WINDOWS(LinkPath) :
|
|
2410
|
-
#endif
|
|
2411
|
-
NName::GetRootPrefixSize(LinkPath);
|
|
2412
|
-
/*
|
|
2413
|
-
// "c:path" will be ignored later as "Dangerous absolute path"
|
|
2414
|
-
// so check is not required
|
|
2415
|
-
if (n == 0
|
|
2416
|
-
#ifndef _WIN32
|
|
2417
|
-
&& isWindowsPath
|
|
2418
|
-
#endif
|
|
2419
|
-
&& NName::IsDrivePath2(LinkPath))
|
|
2420
|
-
n = 2;
|
|
2421
|
-
*/
|
|
2422
|
-
}
|
|
2423
|
-
if (n == 0)
|
|
2424
|
-
{
|
|
2425
|
-
if (!IS_PATH_SEPAR(LinkPath[0]))
|
|
2426
|
-
break;
|
|
2427
|
-
n = 1;
|
|
2428
|
-
}
|
|
2429
|
-
isRelative = false; // (LinkPath) will be treated as relative to root folder of archive
|
|
2430
|
-
LinkPath.DeleteFrontal(n);
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
/*
|
|
2436
|
-
it removes redundant separators, if there are double separators,
|
|
2437
|
-
but it keeps double separators at start of string //name/.
|
|
2438
|
-
in/out: system path separator is used
|
|
2439
|
-
windows: slash character (linux separator) is not treated as separator
|
|
2440
|
-
windows: (path) doesn't contain linux separator (slash).
|
|
2441
|
-
*/
|
|
2442
|
-
static void RemoveRedundantPathSeparators(UString &path)
|
|
2443
|
-
{
|
|
2444
|
-
wchar_t *dest = path.GetBuf();
|
|
2445
|
-
const wchar_t * const start = dest;
|
|
2446
|
-
const wchar_t *src = dest;
|
|
2447
|
-
for (;;)
|
|
2448
|
-
{
|
|
2449
|
-
wchar_t c = *src++;
|
|
2450
|
-
if (c == 0)
|
|
2451
|
-
break;
|
|
2452
|
-
// if (IS_PATH_SEPAR(c)) // for Windows: we can change (/) to (\).
|
|
2453
|
-
if (c == WCHAR_PATH_SEPARATOR)
|
|
2454
|
-
{
|
|
2455
|
-
if (dest - start >= 2 && dest[-1] == WCHAR_PATH_SEPARATOR)
|
|
2456
|
-
continue;
|
|
2457
|
-
// c = WCHAR_PATH_SEPARATOR; // for Windows: we can change (/) to (\).
|
|
2458
|
-
}
|
|
2459
|
-
*dest++ = c;
|
|
2460
|
-
}
|
|
2461
|
-
*dest = 0;
|
|
2462
|
-
path.ReleaseBuf_SetLen((unsigned)(dest - path.Ptr()));
|
|
2463
|
-
}
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
// in/out: (LinkPath) uses system path separator
|
|
2467
|
-
// in/out: windows: (LinkPath) doesn't contain linux separator (slash).
|
|
2468
|
-
// out: (LinkPath) is relative path, and LinkPath[0] is not path separator
|
|
2469
|
-
void CLinkInfo::Normalize_to_RelativeSafe(UStringVector &removePathParts)
|
|
2470
|
-
{
|
|
2471
|
-
// We WILL NOT WRITE original absolute link path from archive to filesystem.
|
|
2472
|
-
// So here we remove all root prefixes from (LinkPath).
|
|
2473
|
-
// If we see any absolute root prefix, then we suppose that this prefix is virtual prefix
|
|
2474
|
-
// that shows that link is relative to root folder of archive
|
|
2475
|
-
RemoveRedundantPathSeparators(LinkPath);
|
|
2476
|
-
// LinkPath = "\\\\?\\r:test\\test2"; // for debug
|
|
2477
|
-
Remove_AbsPathPrefixes();
|
|
2478
|
-
// (LinkPath) now is relative:
|
|
2479
|
-
// if (isRelative == false), then (LinkPath) is relative to root folder of archive
|
|
2480
|
-
// if (isRelative == true ), then (LinkPath) is relative to current item
|
|
2481
|
-
if (LinkPath.IsEmpty() || isRelative || removePathParts.Size() == 0)
|
|
2482
|
-
return;
|
|
2483
|
-
|
|
2484
|
-
// if LinkPath is prefixed by _removePathParts, we remove these paths
|
|
2485
|
-
UStringVector pathParts;
|
|
2486
|
-
SplitPathToParts(LinkPath, pathParts);
|
|
2487
|
-
bool badPrefix = false;
|
|
2488
|
-
{
|
|
2489
|
-
FOR_VECTOR (i, removePathParts)
|
|
2490
|
-
{
|
|
2491
|
-
if (i >= pathParts.Size()
|
|
2492
|
-
|| CompareFileNames(removePathParts[i], pathParts[i]) != 0)
|
|
2493
|
-
{
|
|
2494
|
-
badPrefix = true;
|
|
2495
|
-
break;
|
|
1407
|
+
CIndexToPathPair pair(index, fullProcessedPath);
|
|
1408
|
+
unsigned oldSize = _renamedFiles.Size();
|
|
1409
|
+
unsigned insertIndex = _renamedFiles.AddToUniqueSorted(pair);
|
|
1410
|
+
if (oldSize == _renamedFiles.Size())
|
|
1411
|
+
_renamedFiles[insertIndex].Path = fullProcessedPath;
|
|
1412
|
+
}
|
|
1413
|
+
#endif
|
|
1414
|
+
|
|
1415
|
+
if (_isSplit)
|
|
1416
|
+
{
|
|
1417
|
+
RINOK(_outFileStreamSpec->Seek(_position, STREAM_SEEK_SET, NULL));
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
_outFileStream = outStreamLoc2;
|
|
1421
|
+
}
|
|
2496
1422
|
}
|
|
2497
1423
|
}
|
|
1424
|
+
|
|
1425
|
+
outStreamLoc = _outFileStream;
|
|
2498
1426
|
}
|
|
2499
|
-
if (!badPrefix)
|
|
2500
|
-
pathParts.DeleteFrontal(removePathParts.Size());
|
|
2501
|
-
LinkPath = MakePathFromParts(pathParts);
|
|
2502
|
-
Remove_AbsPathPrefixes();
|
|
2503
1427
|
}
|
|
2504
1428
|
|
|
2505
|
-
#
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
HRESULT CArchiveExtractCallback::CloseReparseAndFile()
|
|
2509
|
-
{
|
|
2510
|
-
HRESULT res = S_OK;
|
|
2511
|
-
|
|
2512
|
-
#ifdef SUPPORT_LINKS
|
|
1429
|
+
#ifndef _SFX
|
|
2513
1430
|
|
|
2514
|
-
|
|
2515
|
-
bool repraseMode = false;
|
|
2516
|
-
bool needSetReparse = false;
|
|
2517
|
-
CLinkInfo link;
|
|
2518
|
-
|
|
2519
|
-
if (_bufPtrSeqOutStream)
|
|
1431
|
+
if (_hashStream)
|
|
2520
1432
|
{
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
if (_curSize_Defined && reparseSize == _outMemBuf.Size())
|
|
2524
|
-
{
|
|
2525
|
-
/*
|
|
2526
|
-
CReparseAttr reparse;
|
|
2527
|
-
DWORD errorCode = 0;
|
|
2528
|
-
needSetReparse = reparse.Parse(_outMemBuf, reparseSize, errorCode);
|
|
2529
|
-
if (needSetReparse)
|
|
2530
|
-
{
|
|
2531
|
-
UString LinkPath = reparse.GetPath();
|
|
2532
|
-
#ifndef _WIN32
|
|
2533
|
-
LinkPath.Replace(L'\\', WCHAR_PATH_SEPARATOR);
|
|
2534
|
-
#endif
|
|
2535
|
-
}
|
|
2536
|
-
*/
|
|
2537
|
-
needSetReparse = _is_SymLink_in_Data_Linux ?
|
|
2538
|
-
link.Parse_from_LinuxData(_outMemBuf, reparseSize) :
|
|
2539
|
-
link.Parse_from_WindowsReparseData(_outMemBuf, reparseSize);
|
|
2540
|
-
if (!needSetReparse)
|
|
2541
|
-
res = SendMessageError_with_LastError("Incorrect reparse stream", us2fs(_item.Path));
|
|
2542
|
-
// (link.LinkPath) uses system path separator.
|
|
2543
|
-
// windows: (link.LinkPath) doesn't contain linux separator (slash).
|
|
2544
|
-
}
|
|
2545
|
-
else
|
|
2546
|
-
{
|
|
2547
|
-
res = SendMessageError_with_LastError("Unknown reparse stream", us2fs(_item.Path));
|
|
2548
|
-
}
|
|
2549
|
-
if (!needSetReparse && _outFileStream)
|
|
1433
|
+
if (askExtractMode == NArchive::NExtract::NAskMode::kExtract ||
|
|
1434
|
+
askExtractMode == NArchive::NExtract::NAskMode::kTest)
|
|
2550
1435
|
{
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
1436
|
+
_hashStreamSpec->SetStream(outStreamLoc);
|
|
1437
|
+
outStreamLoc = _hashStream;
|
|
1438
|
+
_hashStreamSpec->Init(true);
|
|
1439
|
+
_hashStreamWasUsed = true;
|
|
2554
1440
|
}
|
|
2555
|
-
_bufPtrSeqOutStream.Release();
|
|
2556
1441
|
}
|
|
2557
1442
|
|
|
2558
|
-
#endif
|
|
2559
|
-
|
|
2560
|
-
const HRESULT res2 = CloseFile();
|
|
2561
|
-
if (res == S_OK)
|
|
2562
|
-
res = res2;
|
|
2563
|
-
RINOK(res)
|
|
1443
|
+
#endif
|
|
2564
1444
|
|
|
2565
|
-
|
|
2566
|
-
if (
|
|
1445
|
+
|
|
1446
|
+
if (outStreamLoc)
|
|
2567
1447
|
{
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
1448
|
+
/*
|
|
1449
|
+
#ifdef SUPPORT_LINKS
|
|
1450
|
+
|
|
1451
|
+
if (!_CopyFile_Path.IsEmpty())
|
|
2571
1452
|
{
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
if (!DeleteFileAlways(_diskFilePath))
|
|
2576
|
-
{
|
|
2577
|
-
RINOK(SendMessageError_with_LastError("can't delete file", _diskFilePath))
|
|
2578
|
-
}
|
|
2579
|
-
{
|
|
2580
|
-
bool linkWasSet = false;
|
|
2581
|
-
// link.LinkPath = "r:\\1\\2"; // for debug
|
|
2582
|
-
// link.isJunction = true; // for debug
|
|
2583
|
-
link.Normalize_to_RelativeSafe(_removePathParts);
|
|
2584
|
-
RINOK(SetLink(_diskFilePath, link, linkWasSet))
|
|
2585
|
-
/*
|
|
2586
|
-
// we don't set attributes for placeholder.
|
|
2587
|
-
if (linkWasSet)
|
|
2588
|
-
_isSymLinkCreated = true; // link.IsSymLink();
|
|
2589
|
-
else
|
|
2590
|
-
*/
|
|
2591
|
-
_needSetAttrib = false;
|
|
2592
|
-
}
|
|
1453
|
+
RINOK(PrepareOperation(askExtractMode));
|
|
1454
|
+
RINOK(MyCopyFile(outStreamLoc));
|
|
1455
|
+
return SetOperationResult(NArchive::NExtract::NOperationResult::kOK);
|
|
2593
1456
|
}
|
|
2594
|
-
}
|
|
2595
|
-
#endif // SUPPORT_LINKS
|
|
2596
|
-
return res;
|
|
2597
|
-
}
|
|
2598
1457
|
|
|
1458
|
+
if (isCopyLink && _testMode)
|
|
1459
|
+
return S_OK;
|
|
1460
|
+
|
|
1461
|
+
#endif
|
|
1462
|
+
*/
|
|
2599
1463
|
|
|
2600
|
-
|
|
2601
|
-
const CArchiveExtractCallback &callback)
|
|
2602
|
-
{
|
|
2603
|
-
#ifndef _WIN32
|
|
2604
|
-
if (fi.Owner.Id_Defined &&
|
|
2605
|
-
fi.Group.Id_Defined)
|
|
2606
|
-
{
|
|
2607
|
-
if (my_chown(path, fi.Owner.Id, fi.Group.Id) != 0)
|
|
2608
|
-
callback.SendMessageError_with_LastError("Cannot set owner", path);
|
|
1464
|
+
*outStream = outStreamLoc.Detach();
|
|
2609
1465
|
}
|
|
2610
|
-
|
|
1466
|
+
|
|
1467
|
+
return S_OK;
|
|
2611
1468
|
|
|
2612
|
-
|
|
2613
|
-
{
|
|
2614
|
-
// const AString s = GetAnsiString(_diskFilePath);
|
|
2615
|
-
// printf("\nSetFileAttrib_PosixHighDetect: %s: hex:%x\n", s.Ptr(), _fi.Attrib);
|
|
2616
|
-
if (!SetFileAttrib_PosixHighDetect(path, fi.Attrib))
|
|
2617
|
-
{
|
|
2618
|
-
// do we need error message here in Windows and in posix?
|
|
2619
|
-
callback.SendMessageError_with_LastError("Cannot set file attribute", path);
|
|
2620
|
-
}
|
|
2621
|
-
}
|
|
1469
|
+
COM_TRY_END
|
|
2622
1470
|
}
|
|
2623
1471
|
|
|
2624
|
-
void CArchiveExtractCallback::SetAttrib() const
|
|
2625
|
-
{
|
|
2626
|
-
#ifndef _WIN32
|
|
2627
|
-
// Linux now doesn't support permissions for symlinks
|
|
2628
|
-
if (_isSymLinkCreated)
|
|
2629
|
-
return;
|
|
2630
|
-
#endif
|
|
2631
1472
|
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|| !_extractMode)
|
|
2636
|
-
return;
|
|
1473
|
+
STDMETHODIMP CArchiveExtractCallback::PrepareOperation(Int32 askExtractMode)
|
|
1474
|
+
{
|
|
1475
|
+
COM_TRY_BEGIN
|
|
2637
1476
|
|
|
2638
|
-
|
|
1477
|
+
#ifndef _SFX
|
|
1478
|
+
if (ExtractToStreamCallback)
|
|
1479
|
+
return ExtractToStreamCallback->PrepareOperation7(askExtractMode);
|
|
1480
|
+
#endif
|
|
1481
|
+
|
|
1482
|
+
_extractMode = false;
|
|
1483
|
+
|
|
1484
|
+
switch (askExtractMode)
|
|
1485
|
+
{
|
|
1486
|
+
case NArchive::NExtract::NAskMode::kExtract:
|
|
1487
|
+
if (_testMode)
|
|
1488
|
+
askExtractMode = NArchive::NExtract::NAskMode::kTest;
|
|
1489
|
+
else
|
|
1490
|
+
_extractMode = true;
|
|
1491
|
+
break;
|
|
1492
|
+
};
|
|
1493
|
+
|
|
1494
|
+
return _extractCallback2->PrepareOperation(_item.Path, BoolToInt(_item.IsDir),
|
|
1495
|
+
askExtractMode, _isSplit ? &_position: 0);
|
|
1496
|
+
|
|
1497
|
+
COM_TRY_END
|
|
2639
1498
|
}
|
|
2640
1499
|
|
|
2641
1500
|
|
|
2642
|
-
|
|
2643
|
-
HRESULT CArchiveExtractCallback::SetSecurityInfo(UInt32 indexInArc, const FString &path) const
|
|
1501
|
+
HRESULT CArchiveExtractCallback::CloseFile()
|
|
2644
1502
|
{
|
|
2645
|
-
if (!
|
|
1503
|
+
if (!_outFileStream)
|
|
1504
|
+
return S_OK;
|
|
1505
|
+
|
|
1506
|
+
HRESULT hres = S_OK;
|
|
1507
|
+
_outFileStreamSpec->SetTime(
|
|
1508
|
+
(WriteCTime && _fi.CTimeDefined) ? &_fi.CTime : NULL,
|
|
1509
|
+
(WriteATime && _fi.ATimeDefined) ? &_fi.ATime : NULL,
|
|
1510
|
+
(WriteMTime && _fi.MTimeDefined) ? &_fi.MTime : (_arc->MTimeDefined ? &_arc->MTime : NULL));
|
|
1511
|
+
|
|
1512
|
+
const UInt64 processedSize = _outFileStreamSpec->ProcessedSize;
|
|
1513
|
+
if (_fileLengthWasSet && _curSize > processedSize)
|
|
2646
1514
|
{
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
if (dataSize != 0)
|
|
2652
|
-
{
|
|
2653
|
-
if (propType != NPropDataType::kRaw)
|
|
2654
|
-
return E_FAIL;
|
|
2655
|
-
if (CheckNtSecure((const Byte *)data, dataSize))
|
|
2656
|
-
{
|
|
2657
|
-
SECURITY_INFORMATION securInfo = DACL_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION;
|
|
2658
|
-
if (_saclEnabled)
|
|
2659
|
-
securInfo |= SACL_SECURITY_INFORMATION;
|
|
2660
|
-
// if (!
|
|
2661
|
-
::SetFileSecurityW(fs2us(path), securInfo, (PSECURITY_DESCRIPTOR)(void *)(const Byte *)(data));
|
|
2662
|
-
{
|
|
2663
|
-
// RINOK(SendMessageError_with_LastError("SetFileSecurity FAILS", path))
|
|
2664
|
-
}
|
|
2665
|
-
}
|
|
2666
|
-
}
|
|
1515
|
+
bool res = _outFileStreamSpec->File.SetLength(processedSize);
|
|
1516
|
+
_fileLengthWasSet = res;
|
|
1517
|
+
if (!res)
|
|
1518
|
+
hres = SendMessageError_with_LastError(kCantSetFileLen, us2fs(_item.Path));
|
|
2667
1519
|
}
|
|
2668
|
-
|
|
1520
|
+
_curSize = processedSize;
|
|
1521
|
+
_curSizeDefined = true;
|
|
1522
|
+
RINOK(_outFileStreamSpec->Close());
|
|
1523
|
+
_outFileStream.Release();
|
|
1524
|
+
return hres;
|
|
2669
1525
|
}
|
|
2670
|
-
#endif // Z7_USE_SECURITY_CODE
|
|
2671
1526
|
|
|
2672
1527
|
|
|
2673
|
-
|
|
1528
|
+
STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 opRes)
|
|
2674
1529
|
{
|
|
2675
1530
|
COM_TRY_BEGIN
|
|
2676
1531
|
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
#ifndef Z7_SFX
|
|
1532
|
+
#ifndef _SFX
|
|
2680
1533
|
if (ExtractToStreamCallback)
|
|
2681
|
-
|
|
2682
|
-
GetUnpackSize();
|
|
2683
|
-
return ExtractToStreamCallback->SetOperationResult8(opRes, BoolToInt(_encrypted), _curSize);
|
|
2684
|
-
}
|
|
1534
|
+
return ExtractToStreamCallback->SetOperationResult7(opRes, BoolToInt(_encrypted));
|
|
2685
1535
|
#endif
|
|
2686
1536
|
|
|
2687
|
-
#ifndef
|
|
1537
|
+
#ifndef _SFX
|
|
2688
1538
|
|
|
2689
1539
|
if (_hashStreamWasUsed)
|
|
2690
1540
|
{
|
|
@@ -2696,23 +1546,41 @@ Z7_COM7F_IMF(CArchiveExtractCallback::SetOperationResult(Int32 opRes))
|
|
|
2696
1546
|
#endif
|
|
2697
1547
|
, _item.Path);
|
|
2698
1548
|
_curSize = _hashStreamSpec->GetSize();
|
|
2699
|
-
|
|
1549
|
+
_curSizeDefined = true;
|
|
2700
1550
|
_hashStreamSpec->ReleaseStream();
|
|
2701
1551
|
_hashStreamWasUsed = false;
|
|
2702
1552
|
}
|
|
2703
1553
|
|
|
2704
|
-
#endif
|
|
1554
|
+
#endif
|
|
2705
1555
|
|
|
2706
|
-
RINOK(
|
|
1556
|
+
RINOK(CloseFile());
|
|
2707
1557
|
|
|
2708
|
-
#ifdef
|
|
2709
|
-
|
|
2710
|
-
|
|
1558
|
+
#ifdef _USE_SECURITY_CODE
|
|
1559
|
+
if (!_stdOutMode && _extractMode && _ntOptions.NtSecurity.Val && _arc->GetRawProps)
|
|
1560
|
+
{
|
|
1561
|
+
const void *data;
|
|
1562
|
+
UInt32 dataSize;
|
|
1563
|
+
UInt32 propType;
|
|
1564
|
+
_arc->GetRawProps->GetRawProp(_index, kpidNtSecure, &data, &dataSize, &propType);
|
|
1565
|
+
if (dataSize != 0)
|
|
1566
|
+
{
|
|
1567
|
+
if (propType != NPropDataType::kRaw)
|
|
1568
|
+
return E_FAIL;
|
|
1569
|
+
if (CheckNtSecure((const Byte *)data, dataSize))
|
|
1570
|
+
{
|
|
1571
|
+
SECURITY_INFORMATION securInfo = DACL_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION;
|
|
1572
|
+
if (_saclEnabled)
|
|
1573
|
+
securInfo |= SACL_SECURITY_INFORMATION;
|
|
1574
|
+
::SetFileSecurityW(fs2us(_diskFilePath), securInfo, (PSECURITY_DESCRIPTOR)(void *)data);
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
#endif
|
|
2711
1579
|
|
|
2712
|
-
if (!
|
|
1580
|
+
if (!_curSizeDefined)
|
|
2713
1581
|
GetUnpackSize();
|
|
2714
1582
|
|
|
2715
|
-
if (
|
|
1583
|
+
if (_curSizeDefined)
|
|
2716
1584
|
{
|
|
2717
1585
|
#ifdef SUPPORT_ALT_STREAMS
|
|
2718
1586
|
if (_item.IsAltStream)
|
|
@@ -2731,19 +1599,17 @@ Z7_COM7F_IMF(CArchiveExtractCallback::SetOperationResult(Int32 opRes))
|
|
|
2731
1599
|
else
|
|
2732
1600
|
NumFiles++;
|
|
2733
1601
|
|
|
2734
|
-
if (
|
|
2735
|
-
|
|
1602
|
+
if (!_stdOutMode && _extractMode && _fi.AttribDefined)
|
|
1603
|
+
SetFileAttrib_PosixHighDetect(_diskFilePath, _fi.Attrib);
|
|
2736
1604
|
|
|
2737
|
-
RINOK(_extractCallback2->SetOperationResult(opRes, BoolToInt(_encrypted)))
|
|
1605
|
+
RINOK(_extractCallback2->SetOperationResult(opRes, BoolToInt(_encrypted)));
|
|
2738
1606
|
|
|
2739
1607
|
return S_OK;
|
|
2740
1608
|
|
|
2741
1609
|
COM_TRY_END
|
|
2742
1610
|
}
|
|
2743
1611
|
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
Z7_COM7F_IMF(CArchiveExtractCallback::ReportExtractResult(UInt32 indexType, UInt32 index, Int32 opRes))
|
|
1612
|
+
STDMETHODIMP CArchiveExtractCallback::ReportExtractResult(UInt32 indexType, UInt32 index, Int32 opRes)
|
|
2747
1613
|
{
|
|
2748
1614
|
if (_folderArchiveExtractCallback2)
|
|
2749
1615
|
{
|
|
@@ -2753,9 +1619,9 @@ Z7_COM7F_IMF(CArchiveExtractCallback::ReportExtractResult(UInt32 indexType, UInt
|
|
|
2753
1619
|
if (indexType == NArchive::NEventIndexType::kInArcIndex && index != (UInt32)(Int32)-1)
|
|
2754
1620
|
{
|
|
2755
1621
|
CReadArcItem item;
|
|
2756
|
-
RINOK(_arc->GetItem(index, item))
|
|
1622
|
+
RINOK(_arc->GetItem(index, item));
|
|
2757
1623
|
s = item.Path;
|
|
2758
|
-
RINOK(Archive_GetItemBoolProp(_arc->Archive, index, kpidEncrypted, isEncrypted))
|
|
1624
|
+
RINOK(Archive_GetItemBoolProp(_arc->Archive, index, kpidEncrypted, isEncrypted));
|
|
2759
1625
|
}
|
|
2760
1626
|
else
|
|
2761
1627
|
{
|
|
@@ -2771,170 +1637,19 @@ Z7_COM7F_IMF(CArchiveExtractCallback::ReportExtractResult(UInt32 indexType, UInt
|
|
|
2771
1637
|
}
|
|
2772
1638
|
|
|
2773
1639
|
|
|
2774
|
-
|
|
1640
|
+
STDMETHODIMP CArchiveExtractCallback::CryptoGetTextPassword(BSTR *password)
|
|
2775
1641
|
{
|
|
2776
1642
|
COM_TRY_BEGIN
|
|
2777
1643
|
if (!_cryptoGetTextPassword)
|
|
2778
1644
|
{
|
|
2779
1645
|
RINOK(_extractCallback2.QueryInterface(IID_ICryptoGetTextPassword,
|
|
2780
|
-
&_cryptoGetTextPassword))
|
|
1646
|
+
&_cryptoGetTextPassword));
|
|
2781
1647
|
}
|
|
2782
1648
|
return _cryptoGetTextPassword->CryptoGetTextPassword(password);
|
|
2783
1649
|
COM_TRY_END
|
|
2784
1650
|
}
|
|
2785
1651
|
|
|
2786
1652
|
|
|
2787
|
-
#ifndef Z7_SFX
|
|
2788
|
-
|
|
2789
|
-
// ---------- HASH functions ----------
|
|
2790
|
-
|
|
2791
|
-
FString CArchiveExtractCallback::Hash_GetFullFilePath()
|
|
2792
|
-
{
|
|
2793
|
-
// this function changes _item.PathParts.
|
|
2794
|
-
CorrectPathParts();
|
|
2795
|
-
const UStringVector &pathParts = _item.PathParts;
|
|
2796
|
-
const UString processedPath (MakePathFromParts(pathParts));
|
|
2797
|
-
FString fullProcessedPath (us2fs(processedPath));
|
|
2798
|
-
if (_pathMode != NExtract::NPathMode::kAbsPaths
|
|
2799
|
-
|| !NName::IsAbsolutePath(processedPath))
|
|
2800
|
-
{
|
|
2801
|
-
fullProcessedPath = MakePath_from_2_Parts(
|
|
2802
|
-
DirPathPrefix_for_HashFiles,
|
|
2803
|
-
// _dirPathPrefix,
|
|
2804
|
-
fullProcessedPath);
|
|
2805
|
-
}
|
|
2806
|
-
return fullProcessedPath;
|
|
2807
|
-
}
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
Z7_COM7F_IMF(CArchiveExtractCallback::GetDiskProperty(UInt32 index, PROPID propID, PROPVARIANT *value))
|
|
2811
|
-
{
|
|
2812
|
-
COM_TRY_BEGIN
|
|
2813
|
-
NCOM::CPropVariant prop;
|
|
2814
|
-
if (propID == kpidSize)
|
|
2815
|
-
{
|
|
2816
|
-
RINOK(GetItem(index))
|
|
2817
|
-
const FString fullProcessedPath = Hash_GetFullFilePath();
|
|
2818
|
-
NFile::NFind::CFileInfo fi;
|
|
2819
|
-
if (fi.Find_FollowLink(fullProcessedPath))
|
|
2820
|
-
if (!fi.IsDir())
|
|
2821
|
-
prop = (UInt64)fi.Size;
|
|
2822
|
-
}
|
|
2823
|
-
prop.Detach(value);
|
|
2824
|
-
return S_OK;
|
|
2825
|
-
COM_TRY_END
|
|
2826
|
-
}
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
Z7_COM7F_IMF(CArchiveExtractCallback::GetStream2(UInt32 index, ISequentialInStream **inStream, UInt32 mode))
|
|
2830
|
-
{
|
|
2831
|
-
COM_TRY_BEGIN
|
|
2832
|
-
*inStream = NULL;
|
|
2833
|
-
// if (index != _index) return E_FAIL;
|
|
2834
|
-
if (mode != NUpdateNotifyOp::kHashRead)
|
|
2835
|
-
return E_FAIL;
|
|
2836
|
-
|
|
2837
|
-
RINOK(GetItem(index))
|
|
2838
|
-
const FString fullProcessedPath = Hash_GetFullFilePath();
|
|
2839
|
-
|
|
2840
|
-
CInFileStream *inStreamSpec = new CInFileStream;
|
|
2841
|
-
CMyComPtr<ISequentialInStream> inStreamRef = inStreamSpec;
|
|
2842
|
-
inStreamSpec->Set_PreserveATime(_ntOptions.PreserveATime);
|
|
2843
|
-
if (!inStreamSpec->OpenShared(fullProcessedPath, _ntOptions.OpenShareForWrite))
|
|
2844
|
-
{
|
|
2845
|
-
RINOK(SendMessageError_with_LastError(kCantOpenInFile, fullProcessedPath))
|
|
2846
|
-
return S_OK;
|
|
2847
|
-
}
|
|
2848
|
-
*inStream = inStreamRef.Detach();
|
|
2849
|
-
return S_OK;
|
|
2850
|
-
COM_TRY_END
|
|
2851
|
-
}
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
Z7_COM7F_IMF(CArchiveExtractCallback::ReportOperation(
|
|
2855
|
-
UInt32 /* indexType */, UInt32 /* index */, UInt32 /* op */))
|
|
2856
|
-
{
|
|
2857
|
-
// COM_TRY_BEGIN
|
|
2858
|
-
return S_OK;
|
|
2859
|
-
// COM_TRY_END
|
|
2860
|
-
}
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
Z7_COM7F_IMF(CArchiveExtractCallback::RequestMemoryUse(
|
|
2864
|
-
UInt32 flags, UInt32 indexType, UInt32 index, const wchar_t *path,
|
|
2865
|
-
UInt64 requiredSize, UInt64 *allowedSize, UInt32 *answerFlags))
|
|
2866
|
-
{
|
|
2867
|
-
if ((flags & NRequestMemoryUseFlags::k_IsReport) == 0)
|
|
2868
|
-
{
|
|
2869
|
-
const UInt64 memLimit = _ntOptions.MemLimit;
|
|
2870
|
-
if (memLimit != (UInt64)(Int64)-1)
|
|
2871
|
-
{
|
|
2872
|
-
// we overwrite allowedSize
|
|
2873
|
-
*allowedSize = memLimit;
|
|
2874
|
-
if (requiredSize <= memLimit)
|
|
2875
|
-
{
|
|
2876
|
-
*answerFlags = NRequestMemoryAnswerFlags::k_Allow;
|
|
2877
|
-
return S_OK;
|
|
2878
|
-
}
|
|
2879
|
-
*answerFlags = NRequestMemoryAnswerFlags::k_Limit_Exceeded;
|
|
2880
|
-
if (flags & NRequestMemoryUseFlags::k_SkipArc_IsExpected)
|
|
2881
|
-
*answerFlags |= NRequestMemoryAnswerFlags::k_SkipArc;
|
|
2882
|
-
flags |= NRequestMemoryUseFlags::k_SLimit_Exceeded
|
|
2883
|
-
| NRequestMemoryUseFlags::k_AllowedSize_WasForced;
|
|
2884
|
-
}
|
|
2885
|
-
}
|
|
2886
|
-
|
|
2887
|
-
if (!_requestMemoryUseCallback)
|
|
2888
|
-
{
|
|
2889
|
-
_extractCallback2.QueryInterface(IID_IArchiveRequestMemoryUseCallback,
|
|
2890
|
-
&_requestMemoryUseCallback);
|
|
2891
|
-
if (!_requestMemoryUseCallback)
|
|
2892
|
-
{
|
|
2893
|
-
// keep default (answerFlags) from caller or (answerFlags) that was set in this function
|
|
2894
|
-
return S_OK;
|
|
2895
|
-
}
|
|
2896
|
-
}
|
|
2897
|
-
|
|
2898
|
-
#if 0
|
|
2899
|
-
if ((flags & NRequestMemoryUseFlags::k_IsReport) == 0)
|
|
2900
|
-
if (requiredSize <= *allowedSize)
|
|
2901
|
-
{
|
|
2902
|
-
// it's expected, that *answerFlags was set to NRequestMemoryAnswerFlags::k_Allow already,
|
|
2903
|
-
// because it's default answer for (requiredSize <= *allowedSize) case.
|
|
2904
|
-
*answerFlags = NRequestMemoryAnswerFlags::k_Allow; // optional code
|
|
2905
|
-
}
|
|
2906
|
-
else
|
|
2907
|
-
{
|
|
2908
|
-
// we clear *answerFlags, because we want to disable dafault "Allow", if it's set.
|
|
2909
|
-
// *answerFlags = 0;
|
|
2910
|
-
/*
|
|
2911
|
-
NRequestMemoryAnswerFlags::k_SkipArc |
|
|
2912
|
-
NRequestMemoryAnswerFlags::k_Limit_Exceeded;
|
|
2913
|
-
*/
|
|
2914
|
-
}
|
|
2915
|
-
#endif
|
|
2916
|
-
|
|
2917
|
-
UString s;
|
|
2918
|
-
if (!path
|
|
2919
|
-
&& indexType == NArchive::NEventIndexType::kInArcIndex
|
|
2920
|
-
&& index != (UInt32)(Int32)-1
|
|
2921
|
-
&& _arc)
|
|
2922
|
-
{
|
|
2923
|
-
RINOK(_arc->GetItem_Path(index, s))
|
|
2924
|
-
path = s.Ptr();
|
|
2925
|
-
}
|
|
2926
|
-
|
|
2927
|
-
return _requestMemoryUseCallback->RequestMemoryUse(
|
|
2928
|
-
flags, indexType, index, path,
|
|
2929
|
-
requiredSize, allowedSize, answerFlags);
|
|
2930
|
-
}
|
|
2931
|
-
|
|
2932
|
-
#endif // Z7_SFX
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
// ------------ After Extracting functions ------------
|
|
2937
|
-
|
|
2938
1653
|
void CDirPathSortPair::SetNumSlashes(const FChar *s)
|
|
2939
1654
|
{
|
|
2940
1655
|
for (unsigned numSlashes = 0;;)
|
|
@@ -2951,57 +1666,14 @@ void CDirPathSortPair::SetNumSlashes(const FChar *s)
|
|
|
2951
1666
|
}
|
|
2952
1667
|
|
|
2953
1668
|
|
|
2954
|
-
bool
|
|
2955
|
-
{
|
|
2956
|
-
// it's same function for dir and for file
|
|
2957
|
-
return NDir::SetDirTime(path,
|
|
2958
|
-
CTime_Defined ? &CTime : NULL,
|
|
2959
|
-
ATime_Defined ? &ATime : NULL,
|
|
2960
|
-
MTime_Defined ? &MTime : NULL);
|
|
2961
|
-
}
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
#ifdef SUPPORT_LINKS
|
|
2965
|
-
|
|
2966
|
-
bool CFiTimesCAM::SetLinkFileTime_to_FS(CFSTR path) const
|
|
2967
|
-
{
|
|
2968
|
-
// it's same function for dir and for file
|
|
2969
|
-
return NDir::SetLinkFileTime(path,
|
|
2970
|
-
CTime_Defined ? &CTime : NULL,
|
|
2971
|
-
ATime_Defined ? &ATime : NULL,
|
|
2972
|
-
MTime_Defined ? &MTime : NULL);
|
|
2973
|
-
}
|
|
2974
|
-
|
|
2975
|
-
HRESULT CArchiveExtractCallback::SetPostLinks() const
|
|
1669
|
+
bool CDirPathTime::SetDirTime()
|
|
2976
1670
|
{
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
RINOK(SetLink2(*this, link, linkWasSet))
|
|
2982
|
-
if (linkWasSet)
|
|
2983
|
-
{
|
|
2984
|
-
#ifdef _WIN32
|
|
2985
|
-
// Linux now doesn't support permissions for symlinks
|
|
2986
|
-
SetAttrib_Base(link.fullProcessedPath_from, link.item_FileInfo, *this);
|
|
2987
|
-
#endif
|
|
2988
|
-
|
|
2989
|
-
CFiTimesCAM pt;
|
|
2990
|
-
GetFiTimesCAM(link.item_FileInfo, pt, *_arc);
|
|
2991
|
-
if (pt.IsSomeTimeDefined())
|
|
2992
|
-
pt.SetLinkFileTime_to_FS(link.fullProcessedPath_from);
|
|
2993
|
-
|
|
2994
|
-
#ifdef Z7_USE_SECURITY_CODE
|
|
2995
|
-
// we set security information after timestamps setting
|
|
2996
|
-
RINOK(SetSecurityInfo(link.Index_in_Arc, link.fullProcessedPath_from))
|
|
2997
|
-
#endif
|
|
2998
|
-
}
|
|
2999
|
-
}
|
|
3000
|
-
return S_OK;
|
|
1671
|
+
return NDir::SetDirTime(Path,
|
|
1672
|
+
CTimeDefined ? &CTime : NULL,
|
|
1673
|
+
ATimeDefined ? &ATime : NULL,
|
|
1674
|
+
MTimeDefined ? &MTime : NULL);
|
|
3001
1675
|
}
|
|
3002
1676
|
|
|
3003
|
-
#endif
|
|
3004
|
-
|
|
3005
1677
|
|
|
3006
1678
|
HRESULT CArchiveExtractCallback::SetDirsTimes()
|
|
3007
1679
|
{
|
|
@@ -3021,57 +1693,23 @@ HRESULT CArchiveExtractCallback::SetDirsTimes()
|
|
|
3021
1693
|
|
|
3022
1694
|
pairs.Sort2();
|
|
3023
1695
|
|
|
3024
|
-
HRESULT res = S_OK;
|
|
3025
|
-
|
|
3026
1696
|
for (i = 0; i < pairs.Size(); i++)
|
|
3027
1697
|
{
|
|
3028
|
-
|
|
3029
|
-
if (!
|
|
3030
|
-
{
|
|
3031
|
-
// result = E_FAIL;
|
|
3032
|
-
// do we need error message here in Windows and in posix?
|
|
3033
|
-
// SendMessageError_with_LastError("Cannot set directory time", dpt.Path);
|
|
3034
|
-
}
|
|
3035
|
-
}
|
|
3036
|
-
|
|
3037
|
-
/*
|
|
3038
|
-
#ifndef _WIN32
|
|
3039
|
-
for (i = 0; i < _delayedSymLinks.Size(); i++)
|
|
3040
|
-
{
|
|
3041
|
-
const CDelayedSymLink &link = _delayedSymLinks[i];
|
|
3042
|
-
if (!link.Create())
|
|
3043
|
-
{
|
|
3044
|
-
if (res == S_OK)
|
|
3045
|
-
res = GetLastError_noZero_HRESULT();
|
|
3046
|
-
// res = E_FAIL;
|
|
3047
|
-
// do we need error message here in Windows and in posix?
|
|
3048
|
-
SendMessageError_with_LastError("Cannot create Symbolic Link", link._source);
|
|
3049
|
-
}
|
|
1698
|
+
_extractedFolders[pairs[i].Index].SetDirTime();
|
|
1699
|
+
// if (!) return GetLastError();
|
|
3050
1700
|
}
|
|
3051
|
-
#endif // _WIN32
|
|
3052
|
-
*/
|
|
3053
1701
|
|
|
3054
1702
|
ClearExtractedDirsInfo();
|
|
3055
|
-
return
|
|
1703
|
+
return S_OK;
|
|
3056
1704
|
}
|
|
3057
1705
|
|
|
3058
1706
|
|
|
3059
1707
|
HRESULT CArchiveExtractCallback::CloseArc()
|
|
3060
1708
|
{
|
|
3061
|
-
|
|
3062
|
-
HRESULT
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
const HRESULT res2 = SetPostLinks();
|
|
3066
|
-
if (res == S_OK)
|
|
3067
|
-
res = res2;
|
|
3068
|
-
}
|
|
3069
|
-
#endif
|
|
3070
|
-
{
|
|
3071
|
-
const HRESULT res2 = SetDirsTimes();
|
|
3072
|
-
if (res == S_OK)
|
|
3073
|
-
res = res2;
|
|
3074
|
-
}
|
|
1709
|
+
HRESULT res = CloseFile();
|
|
1710
|
+
HRESULT res2 = SetDirsTimes();
|
|
1711
|
+
if (res == S_OK)
|
|
1712
|
+
res = res2;
|
|
3075
1713
|
_arc = NULL;
|
|
3076
1714
|
return res;
|
|
3077
1715
|
}
|