Skip to content
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

Allow authorise-without-apparmor when aa_getpeercon() returns ENOPROTOOPT #175

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/snap_name_of.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ auto snap_name_of(miral::Application const& app, bool fallback_without_apparmor,
{
mir::log_info("aa_getpeercon() failed for process %d: %s", miral::pid_of(app), strerror(errno));

if ((errno == EINVAL) && fallback_without_apparmor) // EINVAL is what is returned when AppArmor isn't setup
// EINVAL is what is returned when AppArmor isn't setup
// ENOPROTOOPT is what is returned when AppArmor doesn't have some Ubuntu patches (yet)
if (((errno == EINVAL) || errno == ENOPROTOOPT) && fallback_without_apparmor)
{
mir::log_info("Fall back (without AppArmor): Identify client via /proc/%%d/cmdline");

Expand Down
Loading