`u`/`a`/`d`/`rn` on a multi-volume archive (`.001`) print only `System ERROR: E_NOTIMPL`; the existing "multivolume" message is never shown

Open
#307 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
backend

Research direction

Read CPP/7zip/UI/Common/Update.cpp around InitFormatIndex(), SetArcPath(), and the early return near line 1201; the report identifies why errorInfo.Message is not set. Compare that path with the existing multivolume message setup later in the file and check how SplitHandler.cpp registers the .001 format. Done when u, a, d, and rn on a split archive produce a readable, appropriate error and regression coverage verifies the behavior.

Written by the indexing model from the issue text.

Description

Environment
  • 7-Zip (z) 26.06 (arm64), ip7z/7zip @ d3296e3
  • macOS 26.4.1 arm64, Apple clang 21.0.0
Description

Updating a split archive is not supported, which is fine. The user is only told E_NOTIMPL : Not implemented. The source contains a clear message for this case, but the code path that would print it is not reached when the archive is addressed as name.7z.001.

Steps to reproduce
Z=7zz
d=$(mktemp -d) && cd "$d"
head -c 300 /dev/urandom > f.bin; printf second > g.txt
$Z a -bd -v100b -mx0 arc.7z f.bin >/dev/null          # arc.7z.001 ... arc.7z.005
for c in "u arc.7z.001 g.txt" "a arc.7z.001 g.txt" "d arc.7z.001 f.bin" "rn arc.7z.001 f.bin h.bin"; do
  $Z $c -bd </dev/null; echo "[$c] rc=$?"
done
# every command: "System ERROR:" / "E_NOTIMPL : Not implemented", rc=2; volumes unchanged
$Z l -bd arc.7z.001    # works: "Volumes: 5"

# same message for a normal archive whose name is just *.001
$Z a -bd s.7z f.bin >/dev/null; cp s.7z s.001
$Z u -bd s.001 g.txt   # System ERROR: E_NOTIMPL : Not implemented
Expected

l, t, x accept .001 volume sets. The command-line pages for u, d, rn list no restriction for multi-volume archives, and -v is documented only for a. Expected: the existing text "Updating for multivolume archives is not implemented" (Update.cpp:40), or another readable error with a command-line-error style exit code.

Actual

System ERROR: E_NOTIMPL : Not implemented, rc=2, no mention of volumes or of the format.

Root cause (analysis on d3296e3)
  1. CPP/7zip/Archive/SplitHandler.cpp:327 registers the format "Split", "001" as read-only (no update).
  2. CPP/7zip/UI/Common/Update.cpp:209: InitFormatIndex() picks that format from the .001 extension.
  3. Update.cpp:224-225 SetArcPath() returns false because !arcInfo.UpdateEnabled.
  4. Update.cpp:1199-1201: if (!options.InitFormatIndex(...) || !options.SetArcPath(...)) return E_NOTIMPL; with no errorInfo.Message.
  5. The intended text is only set at Update.cpp:1262-1263 and 1299-1303, after this early return.
Suggested fix

Set errorInfo.Message at Update.cpp:1201 (for example "update is not supported for this archive format/extension"), and detect Split / VolumePaths.Size() > 1 there so the multivolume message is used. Mention in the u/d/rn documentation that multi-volume archives are read-only.


Found with a differential test setup (a model of the documented behavior, and for some reports an independent tool such as libarchive/bsdtar, 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).

Dominant language
C++
Stars
4.6k
Forks
519
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ip7z/7zip

All issues in ip7z/7zip

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.