Merge lp://staging/~jamesh/thumbnailer/aa-access-fix into lp://staging/thumbnailer/devel

Proposed by James Henstridge
Status: Merged
Approved by: Michi Henning
Approved revision: 220
Merged at revision: 219
Proposed branch: lp://staging/~jamesh/thumbnailer/aa-access-fix
Merge into: lp://staging/thumbnailer/devel
Diff against target: 315 lines (+50/-44)
4 files modified
include/internal/thumbnailer.h (+3/-2)
src/service/handler.cpp (+10/-1)
src/thumbnailer.cpp (+19/-18)
tests/thumbnailer/thumbnailer_test.cpp (+18/-23)
To merge this branch: bzr merge lp://staging/~jamesh/thumbnailer/aa-access-fix
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michi Henning (community) Approve
Review via email: mp+262295@code.staging.launchpad.net

Commit message

Move the AppArmor check earlier so it is not skipped for files already in the cache.

Description of the change

With the previous AppArmor changes, I moved the GetThumbnail() security check to the LocalThumbnailRequest::fetch() method. Unfortunately this method is not called if there is a cached version of the thumbnail, giving clients access to data they shouldn't have.

This branch renames the ThumbnailRequest::set_client_credentials() method to check_client_credentials(), and performs the access checks from within this method. This code path is always hit as part of the request, so avoids the problem.

Unfortunately, I can't easily check the AppArmor aspects from within the test suite since (a) AppArmor isn't available within the Jenkins environment, and (b) even if it was, it isn't clear what profiles we can rely on being loaded into the kernel.

Once I'm done with manual testing, I'll try to formulate this as something people can repeat in the test plan. The thumbnailer-admin utility is really useful here.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michi Henning (michihenning) wrote :

Looks good! One comment needs a fix (see inline).

review: Needs Fixing
220. By James Henstridge

Fix stale comment, as per Michi's review.

Revision history for this message
Michi Henning (michihenning) wrote :

Thank you!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: