cut fails on uncompressed deb
评估
调研方向
从 internal/deb/extract.go 和 DataReader 入手;issue 指出它们只处理压缩的数据成员。检查归档成员的选择方式,以及现有测试如何覆盖 .gz、.xz 和 .zst 负载。完成标准是:包含未压缩 data.tar 的软件包可以成功解包,并且有针对未压缩情况的测试。
由索引模型根据 Issue 内容生成。
描述
chisel cannot cut a package whose data.tar is not compressed. this is not common (clearly) but it does happen.
deb(5) allows the data of the deb to be plain data.tar, as well as the usual suspects (.gz, .xz, etc etc). DataReader in internal/deb/extract.go only handles data.tar.gz, data.tar.xz and data.tar.zst. it skips every other kind and reports io.EOF as "no data payload".
some packages in the archives are built like this (with dpkg-deb -Znone). e.g. in 26.04 main that is every linux-firmware-*, linux-image-* and linux-modules-*.
$ curl -sO http://archive.ubuntu.com/ubuntu/pool/main/l/linux-firmware-realtek/linux-firmware-realtek_20260319.git217ca6e4-0ubuntu1.2_all.deb
$ ar t linux-firmware-realtek_20260319.git217ca6e4-0ubuntu1.2_all.deb
debian-binary
control.tar
data.tar
none of these packages are sliced, so the repro uses chisel-proxy with a deb built the same way:
$ alias chisel-proxy='go run github.com/lczyk/chisel-proxy/cmd/[email protected]'
$ mkdir -p test-package/DEBIAN test-package/usr/lib/test-package
$ printf 'Package: test-package\nVersion: 1.0\nArchitecture: all\nMaintainer: nobody\nDescription: uncompressed data member\n' > test-package/DEBIAN/control
$ echo data > test-package/usr/lib/test-package/file
$ dpkg-deb -Znone --build test-package test-package_1.0_all.deb
$ ar t test-package_1.0_all.deb
debian-binary
control.tar
data.tar
# test-package.yaml
package: test-package
slices:
all:
contents:
/usr/lib/test-package/file:
$ chisel-proxy cut --arch amd64 ./test-package_1.0_all.deb ./test-package.yaml \
-- --root ./rootfs test-package_all
Extracting files from package "test-package"...
error: cannot extract from package "test-package": no data payload
the same deb built with -Zgzip cuts fine.
- 主要语言
- Go
- 星标
- 434
- 派生
- 74
- 平均合并
- 1 天 30 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
canonical/chisel 的其他 Issue
-
`mode` of a generated directory is random when it has a generated child可能已有人在做 @Amadeus-22 于 24 天前认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 80/100
-
难度 2/5 1-3 小时 新手友好度 42/100
-
`prefer` drops a path when the preferred package lists it `until: mutate`可能已有人在做 @18Abhinav07 于 8 天前认领。 未关闭Bug
难度 3/5 1-2 天 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 42/100
-
难度 4/5 3-5 天 新手友好度 48/100
相似的 Issue
-
mcpx scan: flag unsafe tool names可能已有人在做 @zeyadbadawyy 今天认领。 未关闭area/scan enhancement good first issue priority/medium size/small
难度 2/5 1-3 小时 新手友好度 78/100
rohitgollarahalli/mcpx#45 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 88/100
-
Windows 主机
难度 2/5 1-3 小时 新手友好度 88/100
Lee-xeo/Claude-Cage#1550 ·
维护者通常 1 天内回复
-
(bug) ui: spanPaint can index spans past their end (panic: index out of range)可能已有人在做 @MaxMiksa 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 92/100
维护者通常 1 天内回复