Skip to content

Commit

Permalink
Merge pull request #175 from canonical/incompatible-AppArmor
Browse files Browse the repository at this point in the history
Allow `authorise-without-apparmor` when `aa_getpeercon()` returns `ENOPROTOOPT`
  • Loading branch information
Saviq authored Apr 12, 2024
2 parents 5a9a082 + ef59c81 commit 9643015
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 9643015

Please sign in to comment.