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

Aperta
#307 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
C++
Stelle
4.6k
Fork
519
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ip7z/7zip

Tutte le issue di ip7z/7zip

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.