-
Notifications
You must be signed in to change notification settings - Fork 121
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
access() reports file on bind mount as executable when it is not #6367
Comments
/cc @fredericdalleau |
Interesting finding, it's confirmed by strace.
I think it's because Docker Desktop uses specific mount options for bind mounts. Now, from the man page : https://man7.org/linux/man-pages/man2/access.2.html :
Hard to say who is right or wrong in this case. |
Thanks, @fredericdalleau. I agree that My manual page and POSIX.1-2001 says:
This means all bets are off for X_OK. However, another sentence specifies that this only applies to superusers:
The "two possibilities" are described elsewhere as cases where either the effective ID or the real ID is the superuser. It suggests that this is undesired behaviour:
The behavior of
This does "indicate success for X_OK even if none of the execute file permission bits are set", as the manual says, so this is not strictly wrong. But that sentence is there to support historical implementations that didn't handle superuser situations correctly, and Docker continous this bug, even outside of superuser situations. So Docker's behavior is "discouraged", if not strictly incorrect. |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
I'm pretty sure this is the same issue as #5509, so I'm going to mark as a duplicate to centralize communication. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. /lifecycle locked |
The access() syscall reports files on bind mounts as executable, when they are not:
The file hello.txt has default 644 permissions, so no executable bit, so I would expect access() to return false.
This is not specific to Python, I also tried it with a C program. It seems to be specific to MacOS:
I could reproduce this on:
But not on:
Output of
docker version
:Output of
docker info
:Diagnostics ID: E1B25F71-3310-4701-8061-DD025CDCAE2E/20220617111756
The text was updated successfully, but these errors were encountered: