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

Abierto
#307 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cpp
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
C++
Estrellas
4.6k
Forks
519
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ip7z/7zip

Todos los issues de ip7z/7zip

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.