`u -uq3` (anti-item action) on zip and tar silently stores the deleted file as an empty regular file; 7z stores a real anti-item
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with UpdateCallback.cpp:483-494 and :601-621 to see how anti items reach the format handlers, then compare Archive/7z/7zHandlerOut.cpp:555 with the zip and tar handlers. Reproduce with the supplied commands for zip and tar. Done when the update no longer stores or extracts a deleted item as a zero-byte file, while 7z behavior remains as documented.
索引モデルが issue の本文から書いたものです。
説明
Environment
7-Zip (z) 26.06 (arm64), ip7z/7zip @ d3296e3, macOS 26.4.1 arm64
Steps to reproduce
d=$(mktemp -d) && cd "$d"
for t in 7z zip tar; do
rm -rf w xo; mkdir w; cd w
printf aaa > keep.txt; printf bbb > gone.txt
7zz a -bd -t$t ../x.$t keep.txt gone.txt > /dev/null
rm gone.txt # file disappears from disk
7zz u -bd -uq3 ../x.$t keep.txt gone.txt > /dev/null 2>&1 # q3: item only in archive -> anti-item
cd ..
echo "== $t"; 7zz l -slt x.$t | grep -E '^(Path|Size|Anti) =' | tail -n +2 | tr '\n' ' '; echo
7zz x -y -bd -oxo x.$t > /dev/null 2>&1; echo "extracted: $(ls xo | tr '\n' ' ')"
rm -f x.$t
done
Output:
== 7z gone.txt Size=0 Anti=+ keep.txt Size=3 Anti=- extracted: keep.txt
== zip gone.txt Size=0 keep.txt Size=3 extracted: gone.txt keep.txt
== tar gone.txt Size=0 keep.txt Size=3 extracted: gone.txt keep.txt
(The u command itself returns 1 because gone.txt is missing on disk; the same happens for 7z.)
Expected
The -u documentation says of action 3 ("Create Anti-item"): "This feature is supported only in 7z format." So for zip and tar the update action should be rejected with an error (or ignored). Either the update action is rejected for formats that cannot represent anti-items, or the archive does not contain gone.txt at all. The archive should not contain a 0-byte file that was never on disk, and extraction should not create it.
Actual
For zip and tar, gone.txt becomes a regular 0-byte entry and is created by extraction. 7z keeps a real anti-item (Anti = +) that is not extracted.
Root cause (analysis on d3296e3)
UpdateCallback.cpp:483-494 and :601-621 report such items to the format handler with size 0 and kpidIsAnti. Only Archive/7z/7zHandlerOut.cpp:555 queries kpidIsAnti. The zip and tar handlers never read it and write the item as a normal empty file.
Suggested fix
In the zip and tar handlers, skip anti items (or fail the update with a clear message) instead of writing an empty file.
Found with a differential test setup (a model of the documented behavior compared against the real binary) and then checked by hand: every command above was re-run verbatim on the tested build, and the root cause was read in the source. Tested commit: d3296e3 (26.06).
- 主要言語
- C++
- スター
- 4.6k
- フォーク
- 519
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ip7z/7zip のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
area::installer documentation engine::sd enhancement wg::platform-core
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
lemonade-sdk/lemonade#4349 ·
メンテナーはふだん 1 日以内に返信
-
Python example: list a model's scenes and their cameras対応中かも @rudraparmar76 が今日担当しました。 オープンdocumentation good first issue python
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
iamahsanmehmood/openskp#796 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tenstorrent/tt-umd#4183 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
odelaneau/GLIMPSE#353 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信