-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
snapdtool: check for binary existence in InternalToolPath() #13227
Conversation
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.
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #13227 +/- ##
=======================================
Coverage 78.81% 78.81%
=======================================
Files 1014 1014
Lines 126399 126401 +2
=======================================
+ Hits 99621 99623 +2
Misses 20539 20539
Partials 6239 6239
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, did a pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
…l#13227) * 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)
…l#13227) * 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)
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 toolapparmor_parser
that is only available in thesnapd
snap but not in thecore
snap. This means that on systems that have the snapd deb and only coreInternalToolPath
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.