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

i/prompting: do not error when converting empty abstract perms to AA perms #14975

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

olivercalder
Copy link
Member

It's reasonable that one might wish to convert an empty list of abstract permissions to AppArmor permissions, such as when one is constructing an allowed permissions set where all permissions are denied.

It was incorrect to treat this as an error, and furthermore, the only current caller of AbstractPermissionsToAppArmorPermissions which actually uses the error value is in requestprompts, which logs a logger notice on an error. So we were getting false-positive errors in the journalctl log. This commit fixes that issue.

This addresses https://warthogs.atlassian.net/browse/SNAPDENG-31322

…perms

It's reasonable that one might wish to convert an empty list of abstract
permissions to AppArmor permissions, such as when one is constructing an
allowed permissions set where all permissions are denied.

It was incorrect to treat this as an error, and furthermore, the only
current caller of `AbstractPermissionsToAppArmorPermissions` which
actually uses the error value is in `requestprompts`, which logs a
logger notice on an error. So we were getting false-positive errors in
the journalctl log. This commit fixes that issue.

Signed-off-by: Oliver Calder <[email protected]>
@olivercalder olivercalder added the Simple 😃 A small PR which can be reviewed quickly label Jan 23, 2025
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@b85fde1). Learn more about missing BASE report.
Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #14975   +/-   ##
=========================================
  Coverage          ?   78.26%           
=========================================
  Files             ?     1156           
  Lines             ?   153565           
  Branches          ?        0           
=========================================
  Hits              ?   120194           
  Misses            ?    25960           
  Partials          ?     7411           
Flag Coverage Δ
unittests 78.26% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jan 24, 2025

Fri Jan 24 02:52:56 UTC 2025
The following results are from: https://github.com/canonical/snapd/actions/runs/12939805623

Failures:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple 😃 A small PR which can be reviewed quickly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant