enhancement: read the rpm ndb database backend
- 主要语言
- Rust
- 星标
- 471
- 派生
- 27
- 平均合并
- 22 小时 46 分钟
- 30 天内合并 PR
- 8
描述
Tracked by #247.
## Summary
The rpm cataloger reads only the sqlite backend. A filesystem whose rpm database uses ndb errors out rather than being scanned, which today means SUSE and openSUSE cannot be scanned natively at all. This is a current distribution, not a legacy format.
## Current state
- The three backends are recognised by filename, [src/filesystem/rpm/mod.rs#L38-L44](https://github.com/anistark/feluda/blob/83b4051/src/filesystem/rpm/mod.rs#L38-L44).
- Anything other than sqlite returns an error pointing at `syft` and `--sbom-input`, [src/filesystem/rpm/mod.rs#L61-L68](https://github.com/anistark/feluda/blob/83b4051/src/filesystem/rpm/mod.rs#L61-L68). The failure mode is right, it is still a failure.
- `src/filesystem/rpm/` holds `sqlite.rs` with no reader for the other two.
## Proposed change
- Add an ndb reader beside `sqlite.rs`, producing the same header blobs the existing [`header`](https://github.com/anistark/feluda/blob/83b4051/src/filesystem/rpm/header.rs) parser already consumes, so only the storage layer is new.
- Leave Berkeley DB unsupported and keep erroring on it. rpm uses it as a plain key value store of headers, so walking the hash pages is enough and linking libdb is not required, but it is a few hundred lines of format work for CentOS 7 and RHEL 8 era images that are going out of support. File it separately if someone asks by name.
## Acceptance criteria
- `feluda --filesystem ` catalogs installed packages instead of erroring.
- Berkeley DB still errors with a message naming the backend.
- Header parsing, license extraction and purl construction are shared with the sqlite path rather than duplicated.
## References
- rpm ndb format, https://github.com/rpm-software-management/rpm/blob/master/lib/backend/ndb/rpmpkg.c
贡献指南
调研方向
Start with src/filesystem/rpm/mod.rs and sqlite.rs, then read src/filesystem/rpm/header.rs and the linked rpm ndb format reference. Use an openSUSE rootfs with feluda --filesystem to check that installed packages are cataloged, and verify Berkeley DB still errors with its backend named; shared header parsing, license extraction, and purl construction should remain intact.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust
- 领域
- backend
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100