-
Notifications
You must be signed in to change notification settings - Fork 304
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
taskPack modified to correctly set file permissions in ZIP files on Unix and on Windows NTFS #897
Open
MirazMac
wants to merge
1
commit into
consolidation:1.x
Choose a base branch
from
MirazMac:1.x
base: 1.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This would be clearer if expressed in octal (
0100644
).I guess there is no +x bit on Windows? is-executable returns
true
only for.exe
files, which is pointless on Linux. I guess manipulating Linux files on a Windows system just has to be an edge case that we don't / can't support.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.
Using Octal expression doesn't work on Windows, it seems only decimal values work on windows via setExternalAttributesName().
And this is not an edge case, many of the PHP devs develop on windows and may create an archive to distribute on linux servers. It causes a huge problem, like if the index/root file has a permission of 0666, it shows an 403 forbidden error when accessed via HTTP and file compressed via Robo in windows has 0666 permission for all the files(except directories, they have 0755).
So, I guess it would be an essential things to implement, I'm using this locally and it's working for me and someone may face the same issue in future that's why I created the pull request, it's your choice if you want to merge or not.
Thanks.
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.
What do you get when you run this on Windows?
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.
By saying octal expression doesn't work on windows I meant about the setExternalAttributesName(); method's parameter, not the OS entirely.
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.
That seems impossible to me; regardless of whether you represent a number in octal or decimal in the source, the data passed to a method parameter should be the same. Can you explain why
setExternalAttributesName()
fails with an octal parameter? What is at work here?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.
Please provide a test.
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.
It seems it's an internal bug of PHP, besides setExternalAttributesName() isn't properly documented, the only example they provided is for the unix system and while on windows the octal values doesn't change the permission as expected, I'm kinda busy to write the tests, and I'm not sure what to tests against, as extracting the zip on windows to check if the has the permission of 0644 or not won't work on Windows because that's not how windows permissions work at all.
I'm closing this, thanks.