`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
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
- 65/100
Línea de trabajo
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.
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
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).
- 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ip7z/7zip
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
area::installer documentation engine::sd enhancement wg::platform-core
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
lemonade-sdk/lemonade#4349 ·
Los mantenedores suelen responder en 1 día
-
Python example: list a model's scenes and their camerasPosiblemente ocupada @rudraparmar76 la tomó hoy. Abiertodocumentation good first issue python
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
iamahsanmehmood/openskp#796 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
tenstorrent/tt-umd#4183 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
odelaneau/GLIMPSE#353 · 1 comentario ·
Los mantenedores suelen responder en 4 días