-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
add unix permissions to ZipFile #129
Conversation
That's a bit beyond my understanding. |
@jmkerloch Is that linked to #99 ? |
@3nids I just pushed a commit to keep the same flags as done in zipfile module. The 0xFFFF flags comes from a stackoverflow answer : https://stackoverflow.com/a/53008127 but it could be a mistake so I prefer to use the flags of the zipfile module. I'm not an expert on zip file and unix permission; but for me we need to add permission information to zipfile |
@Gustry it's somehow linked because with this PR you will be able to set the correct permission on your git repository and it should keep the permissions in the zip archive. If you want to be sure that your files have correct permission in your repo you could use a pre-commit. |
As discussed with @jmkerloch, I think we should also check how zipped plugins are extracted on the QGIS side, I mean in the plugins manager. Refs:
@Gustry you're involved on this part of QGIS, right? |
Sorry I missed the ping.
In QGIS Desktop, not really. It might be this file : https://github.com/qgis/QGIS/blob/master/python/pyplugin_installer/unzip.py But I'm indeed unzipping in QGIS-Plugin-Manager, for CLI tools on servers : @jmkerloch I made a quick try, indeed, it seems QGIS-plugin-ci is always packaging files with 600, for now. It would be nice if the packaging would keep existing chmod or always apply a default one ? It's a common issue on server when deploying QGIS Server plugins. |
@Gustry with this PR the packaging keep existing chmod. I tried and unzip the file with the ubuntu system file manager and the chmod are identical. @Guts I confirm that when I unzip the archive in QGIS, the permission are lost :
|
Maybe you should add the question from @3nids as a comment in the code ? Can you edit the changelog.md file as well, in the "Unreleased" section. Thanks for this fix. |
@Gustry I just added a comment and updated the changelog. Do you have an idea of when the 2.4.0 version will be released ? |
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.
Ok. I'll publish release later today. |
When extracting .zip archive, file permissions are not available.
It comes from the way we create the file in the .zip archive. We must add the permissions in the
ZipInfo
.This is what is done in the ZipFile module when creating ZipInfo : https://github.com/python/cpython/blob/b885b8f4be9c74ef1ce7923dbf055c31e7f47735/Lib/zipfile.py#L545