-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Revert "Revert "fix: Respect zipped symlinks (#1140)"" #1482
Conversation
Will this also fix #477 ? |
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.
Consider addressing the comment above, but LGTM
samcli/local/lambdafn/zip.py
Outdated
@@ -77,7 +138,7 @@ def _set_permissions(zip_file_info, extracted_path): | |||
""" | |||
|
|||
# Permission information is stored in first two bytes. | |||
permission = zip_file_info.external_attr >> 16 | |||
permission = (zip_file_info.external_attr >> 16) & 511 |
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.
Can we consider adding a comment explaining the & 511
part especially? May be useful to note for posterity/later development.
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.
Since @bubba-h57 wrote the initial pull request he might be able to give some background.
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 think we need to step back and make sure we understand what the & 511
line does to permissions before we can merge.
Current plan is to add integ tests before merging. |
We shift it right to drop off the unnecessary bits (pun included for no charge) leaving naught but the permissions we are interested in setting and then we then do a bitwise AND operation with Note that This is necessary because we really have no idea what sort of However, when run on AWS Lambda, the We also don't know which files need to be executable, so we simply assume all files need to be executable. As for testing, the various test environments can have some strange accounts/permissions setup. So we go ahead and ensure anyon can execute any file. Why? Because in the testing environments, it isn't always clear who the owner/executor is. Group/Other will only have read/write access if that is what the development version of the files has. So, that's what is going on. Take the permission on the development file, overlay that with |
Any news here? It seems that layers with symlinks still don't work with sam cli? |
This reverts commit 360d90a. This commit originally reverted aws#1140 due to os.symlink not being available on windows in Python2.7 stdlib, details here: aws#1315 (comment). We recently removed Python2.7 support in aws#1416, so this commit is a revert of the revert, with some additional black formating to make `make pr` pass.
513d9bb
to
f796a57
Compare
This reverts commit 360d90a.
This commit originally reverted #1140 due to os.symlink not being
available on windows in Python2.7 stdlib, details here: #1315 (comment). We recently removed Python2.7 support in #1416, so this commit
is a revert of the revert, with some additional black formating to make
make pr
pass.
Issue #, if available:
Description of changes:
Checklist:
make pr
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.