Fix package-verify false negatives: symlink traversal + prefix collision
Lint / ShellCheck (push) Successful in 13s
Lint / Validate .plg XML (push) Successful in 13s
Lint / EditorConfig (push) Successful in 5s

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:
2026-07-13 22:10:44 +00:00
co-authored by Claude Sonnet 5
parent d931d8e9e9
commit 9d46547ef4
4 changed files with 74 additions and 2 deletions
+16
View File
@@ -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