Skip to content

[23.0 backport] apparmor: Check if apparmor_parser is available#44942

Merged
thaJeztah merged 1 commit into
moby:23.0from
vvoland:apparmor-check-binary-23
Feb 7, 2023
Merged

[23.0 backport] apparmor: Check if apparmor_parser is available#44942
thaJeztah merged 1 commit into
moby:23.0from
vvoland:apparmor-check-binary-23

Conversation

@vvoland
Copy link
Copy Markdown
Contributor

@vvoland vvoland commented Feb 7, 2023

hostSupports doesn't check if the apparmor_parser is available. It's possible in some environments that the apparmor will be enabled but the tool to load the profile is not available which will cause the ensureDefaultAppArmorProfile to fail completely.

This patch checks if the apparmor_parser is available. Otherwise the function returns early, but still logs a warning to the daemon log.

Signed-off-by: Paweł Gronowski [email protected]
(cherry picked from commit ab3fa46)

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

`hostSupports` doesn't check if the apparmor_parser is available.
It's possible in some environments that the apparmor will be enabled but
the tool to load the profile is not available which will cause the
ensureDefaultAppArmorProfile to fail completely.

This patch checks if the apparmor_parser is available. Otherwise the
function returns early, but still logs a warning to the daemon log.

Signed-off-by: Paweł Gronowski <[email protected]>
(cherry picked from commit ab3fa46)
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@thaJeztah
Copy link
Copy Markdown
Member

All green; bringing this in 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants