-
Notifications
You must be signed in to change notification settings - Fork 343
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
fix: file executable permissions check error on macos in docker conta… #5946
Conversation
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.
Hi @eeslook, your changes LGTM, just squash them into one commit please, there is no need to have commits to fix your initial changes.
Unfortunately, I don't have access to any macOS machines, therefore I can't reproduce your issue, but I am quite curious why os.access()
is not working in such environment. Can you please provide deeper explanation or link documentation about how user context and file system characteristics might affect the behaviour of os.access()
? It would be really helpful, thank you.
Hi @richtja, Regarding why it is recommended to use
These resources can help you understand why it is recommended to use |
fe01a37
to
607d206
Compare
5d41fc9
to
d280212
Compare
Hi @eeslook, thank you very much for provided resources. I have learned a lot today and the |
d280212
to
bc7dfd2
Compare
Hi @richtja, thank you for pointing that out. I have corrected the commit signature to ensure it matches the author information. The commit now includes the correct Signed-off-by line. |
Hi @eeslook, thank you for the update, but it looks like your signature has changed. You have correctly changed the commit message to
You can see that the |
On macOS Sonoma v14.5, it was discovered that when using avocado in a Docker container to run scripts without execute permissions, they are considered to have executable permissions. By directly reading the file's permission bits, the stat method can provide more accurate permission check results, especially in cases where user context and file system characteristics might affect the behavior of os.access. This method is closer to the underlying implementation of the file system, thus providing consistent results across different environments (such as inside and outside Docker containers). After entering the container using docker exec -it container bash, use the stat command to check the file permission bits. Reference: avocado-framework#5945 Signed-off-by: Kui Li <[email protected]>
bc7dfd2
to
8ced2ee
Compare
Hi @richtja, fixed. |
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.
Hi @eeslook, thank you very much, it LGTM.
On macOS Sonoma v14.5, it was discovered that when using avocado in a Docker container to run scripts without execute permissions, they are considered to have executable permissions.
By directly reading the file's permission bits, the
stat
method can provide more accurate permission check results, especially in cases where user context and file system characteristics might affect the behavior ofos.access
. This method is closer to the underlying implementation of the file system, thus providing consistent results across different environments (such as inside and outside Docker containers). After entering the container usingdocker exec -it container bash
, use thestat
command to check the file permission bits.Reference: #5945
Signed-off-by: Kui Li [email protected]