mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
* snapdtool: check for binary existance in InternalToolPath() The current version of `InternalToolPath()` does not actually checks in all cases if the binary is actually there. Historically this was not a problem but with recent snapd releases we have the internal tool `apparmor_parser` that is only available in the `snapd` snap but not in the `core` snap. This means that on systems that have the snapd deb and only core `InternalToolPath` may return `/snap/core/123/usr/lib/snapd/apparmor_parser` even if this tool in not available inside the core snap. This commit fixes this by checking if the actual executable is available. * snapdtool: add test for non-executable internal tool path * snapdtool: simplify InternalToolPath() (thanks to Samuele)