-
Notifications
You must be signed in to change notification settings - Fork 251
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
archive: honor ignoreChownErrors with ForceMode #2175
archive: honor ignoreChownErrors with ForceMode #2175
Conversation
when ignore_chown_errors is set, ignore also failures from setting the override mode xattr. Closes: containers#2174 Signed-off-by: Giuseppe Scrivano <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe 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 |
@mtrmac PTAL |
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.
I don’t see why this makes sense.
- Just formally, this PR is underdocumented:
ignore_chown_errors
is documented to only affect file ownership. Nothing says it interacts withContainersOverrideXattr
, and it hasn’t behaved that way so far.ContainersOverrideXattr
is documented for theforce_mask
option, and nothing says thatignore_chown_errors
should affect that behavior.
- What is the use case? With
force_mask
, AFAICSContainersOverrideXattr
must be set for the container to behave as expected. The documentation explicitly talks about sharing stores with other users, or using private stores by unprivileged users — in both cases I think the users must be told if settingContainersOverrideXattr
fails, at least by default.- I can imagine a hypothetical option that means “I don’t care about any attributes at all, don’t set UIDs, don’t set modes, don’t bother with the extended attribute either” … but, what for? It isn’t useful for running containers in general (ownership and permissions matter), it isn’t necessary for specially-restricted containers that don’t care (they can be specially built to only be root:root 700:700). My best guess is that this would be useful for some kind of “inspect the filesystem” operation, but then that can be done by extracting the tarball without any privileges at all, and possibly without writing to the filesystem, so I don’t think an extra option is warranted.
- Investigating further, per Setting shared xattr fails on images with named pipes #2174 (comment) , this has nothing to do with
ignore_chown_errors
: settinguser.…
extended attributes on devices/pipes/symlinks never works, even if the user hasCAP_SYS_ADMIN
. This is a fundamental limitation of the currentforce_mask
design. I don’t know what we want to do here.- Hypothetically, we could have an option that means “I want to use
force_mask
with images that contain devices/pipes and I’m fine with those objects having incorrect ownership and permissions”. That option has different meaning fromignore_chown_errors
, so it should be a new option — but, anyway, I don’t know why anyone should set this option. Users who have these objects in their container filesystems, presumably, need them; if not, they can always build (squashed?) images with the objects removed.
- Hypothetically, we could have an option that means “I want to use
from an user PoV, with That situation is similar to using Ideally, images should not have special files, but still there are images using them and we need to handle them in some way, I don't think this should be done transparently but must be an explicit setting. Sure we could add yet another option to make it clearer, but the semantic would be identical and it will just cover what seems to be a corner case. |
Hum, having But #2174 (comment) seems much nicer to me — that makes things work correctly and then we won’t have to worry users about choosing between non-ideal options. |
closed in favor of: #2183 I am still working on it, but opened to get some early feedback |
#2183 is ready for review |
when ignore_chown_errors is set, ignore also failures from setting the override mode xattr.
Closes: #2174