-
Notifications
You must be signed in to change notification settings - Fork 107
Add ~/.local/share/containers/storage/overlay-containers to .fc (bsc#… #424
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
Add ~/.local/share/containers/storage/overlay-containers to .fc (bsc#… #424
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdd SELinux file context entries for Podman/containers-storage overlay-containers paths under users' ~/.local/share directories so restorecon no longer attempts to relabel them to data_home_t. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary of ChangesHello @ca-hu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an SELinux relabeling problem affecting user-specific container storage. By explicitly defining the correct file contexts for Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…1253682) For some reason it is not listed in the file contexts, so it will show up as to be relabelled when running "restorecon": Would relabel /home/foo/.local/share/containers/storage/overlay-containers/f857f27662ab22b7c502a531d61790b7c120dbedc70820962bb45c285aa03cc3/userdata/artifacts from unconfined_u:object_r:container_ro_file_t:s0 to unconfined_u:object_r:data_home_t:s0 Would relabel /home/foo/.local/share/containers/storage/overlay-containers/2b562de7757133521824ac9de932ddd4862d8262695998a4ee02094c14fc1277/userdata/artifacts from unconfined_u:object_r:container_ro_file_t:s0 to unconfined_u:object_r:data_home_t:s0 <driver>-containers is defined here: https://github.com/containers/storage/blame/83cf57466529353aced8f1803f2302698e0b5cb7/store.go#L3633 Signed-off-by: Cathy Hu <[email protected]>
5dae7be to
6e2a14b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly adds the missing file contexts for ~/.local/share/containers/storage/overlay-containers and overlay2-containers, which resolves the issue of incorrect relabeling by restorecon. The change is straightforward and necessary. I've added one comment regarding the sorting of entries in container.fc for future maintainability improvements, but it doesn't block this PR.
| HOME_DIR/\.local/share/containers/storage/overlay-containers(/.*)? gen_context(system_u:object_r:container_ro_file_t,s0) | ||
| HOME_DIR/\.local/share/containers/storage/overlay2-containers(/.*)? gen_context(system_u:object_r:container_ro_file_t,s0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The placement of these new lines follows the existing reverse-alphabetical sorting of suffixes for the entry pairs (layers, images, containers). However, this ordering is inconsistent with other files like container.if (lines 589-593), which use alphabetical order for these suffixes. For better long-term maintainability, it would be ideal to make the sorting consistent across the policy files. Consider creating a follow-up task to reorder this block alphabetically by suffix (containers, images, layers).
lsm5
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@haircommander @rhatdan PTAL
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ca-hu, lsm5, sourcery-ai[bot] The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
…1253682)
For some reason it is not listed in the file contexts, so it will show up as to be relabelled when running "restorecon":
Would relabel /home/foo/.local/share/containers/storage/overlay-containers/f857f27662ab22b7c502a531d61790b7c120dbedc70820962bb45c285aa03cc3/userdata/artifacts from unconfined_u:object_r:container_ro_file_t:s0 to unconfined_u:object_r:data_home_t:s0 Would relabel /home/foo/.local/share/containers/storage/overlay-containers/2b562de7757133521824ac9de932ddd4862d8262695998a4ee02094c14fc1277/userdata/artifacts from unconfined_u:object_r:container_ro_file_t:s0 to unconfined_u:object_r:data_home_t:s0
-containers is defined here:
https://github.com/containers/storage/blame/83cf57466529353aced8f1803f2302698e0b5cb7/store.go#L3633
Summary by Sourcery
Bug Fixes: