Fix package-verify false negatives: symlink traversal + prefix collision
podman-verify-packages.sh/podman-update-packages.sh reported every package as "not installed" right after a genuinely successful install. Root cause: /var/log/packages is itself a symlink on Unraid (-> ../lib/pkgtools/packages), and GNU find's default -P mode doesn't descend into a symlinked starting path at all without -L — confirmed live by running the exact same find both with and without -L against a host where the packages had just installed successfully. Fixing that alone surfaced a second, previously-masked bug: "podman"'s own glob also matches podman-compose's file (a literal prefix collision), and find's unsorted output let podman-compose's record silently win podman's own check. Both fixed once via a new shared podman_find_installed_package_record() helper in podman-common.sh, rather than separately in each caller. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,22 @@ see [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md#52-build-strategie)).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
- `podman-verify-packages.sh`/`podman-update-packages.sh` reported every
|
||||
single package as "not installed" right after a genuinely successful
|
||||
install (confirmed live on a real v0.1.5 install: `/var/log/packages/`
|
||||
had the correct records the whole time). Root cause:
|
||||
`/var/log/packages` is itself a symlink on Unraid
|
||||
(`-> ../lib/pkgtools/packages`), and GNU `find`'s default `-P` mode
|
||||
doesn't descend into a symlinked starting path at all without `-L` —
|
||||
it just returns the symlink itself and nothing below it. Fixed via a
|
||||
new shared `podman_find_installed_package_record()` helper in
|
||||
`podman-common.sh`, which also fixes a second bug found while testing
|
||||
the first fix: "podman"'s own glob also matched podman-compose's file
|
||||
(a literal prefix collision), and `find`'s unsorted output let
|
||||
podman-compose's record silently win podman's own check on the same
|
||||
real host.
|
||||
|
||||
## [0.1.5] - 2026-07-13
|
||||
|
||||
### Added
|
||||
|
||||
Reference in New Issue
Block a user