-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Improve behaviour for filesystems which don't support ACLs #15
Comments
I don't have centos, can you run strace on both of those and attach the files? Also, what file system are you using? On a non-container, this works for me as non-root, and the getxattr calls are slightly different, but succeed. I wonder what's different in your case. |
CentOS isn't relevant IMHO, you only need a Linux with podman which can run in user mode (my host system is Fedora), and then you can run for example
I tried strace but it is not allowed within a user container:
The container is stored on an ext4 partition (my home directory) but within the container it looks like fuse-overlayfs (given that it works at the command line level, I'm not sure it's relevant).
That I'm in a container run in user mode, but what that means exactly, no clue 😕 What I'm wondering though on my side is what is different between calling getfacl and using your library? |
Aha, I can call strace from outside of the container:
And then I tried (with same error message) to call In the file with PID 48077, I see Then I run:
And the output is: podman_acl_strace3.tar.gz Interestingly enough, in the PID 48562 file, I also see Hope you can do something with it. |
Ah, I see. The getfacl code does this, more or less:
where
So basically: try to read ACL. If it fails because it ACLs are not supported for that filesystem, create a synthetic ACL based purely on the file mode. This makes a lot of sense for a command line tool, I'm not entirely sure that in a library fallback by default makes sense. An option to the constructor to allow switching between raw and processed ACLs might allow whatever behaviour one wants, but at this point, the API is mirroring the C api. |
Thanks for the analysis, I agree with your conclusion. Also in our case (rdiff-backup), it wouldn't make sense as we already save the file mode, so we would back-up something which doesn't really exist and would probably restore ACLs where there were none. |
Cool, so just for the purposes of this bug - your problem is solved, I gather, by catching I'll probably add that that parameter (e.g. |
Well, yes but no :-) We were already catching properly the issue in our code, independent from containers, but I noticed this specific behaviour while I was trying to reproduce an issue in a container, also with the idea to use non-root containers for local testing (which would have been much more secure). It sounds like it'll remain an idea and no reality, unless I find a way to get full POSIX support within it. |
When running
podman run -it registry.centos.org/centos:8 bash
(i.e. podman in non-root mode) and running the following:i.e. basically the same operation which works from the command line, fails within python. I tried different paths, using an ArchLinux image and the result is always the same. The same action works in a container run as root, and I could accept the difference, but given that the same action works from the command line, it doesn't make sense that the library fails. We're talking pylibacl 0.5.4-3. Thanks.
The text was updated successfully, but these errors were encountered: