Skip to content
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

ZipTask stores directories with 777 permission #1817

Open
lea-BMS opened this issue Apr 23, 2024 · 0 comments · May be fixed by #1820
Open

ZipTask stores directories with 777 permission #1817

lea-BMS opened this issue Apr 23, 2024 · 0 comments · May be fixed by #1820
Milestone

Comments

@lea-BMS
Copy link
Contributor

lea-BMS commented Apr 23, 2024

Describe the bug
When creating a zip archive with the Zip task, directory permission is 777 inside the archive.

Steps To Reproduce

<zip includeemptydirs="true" destfile="dist/${package}" basedir="./build">
    <fileset dir="build">
        <include name="**/**"/>
    </fileset>
</zip>

Expected behavior
Store original permissions bits or no extended attributes at all like it can be done with the zip command -X option

Screenshots / terminal output
If applicable, add screenshots or terminal output to help explain your problem.

list of extracted archive made with the ZipTask:

drwxrwxrwx 3 lea lea  4096 Apr 23 15:22 controllers
-rw-r--r-- 1 lea lea   302 Apr 18 16:00 index.php
-rw-r--r-- 1 lea lea   619 Apr 23 15:21 logo.gif
-rw-r--r-- 1 lea lea  1484 Apr 23 15:21 logo.png
drwxrwxrwx 2 lea lea  4096 Apr 23 15:22 sql
drwxrwxrwx 5 lea lea  4096 Apr 23 15:22 src
drwxrwxrwx 2 lea lea  4096 Apr 23 15:22 translations
drwxrwxrwx 5 lea lea  4096 Apr 23 15:22 views

This over permissive dangerous permissions on directory is not wanted at all.

Additional context

creating the very same zip archive with the zip command creates a zip archive that extracts perfectly well as expected:

drwxr-xr-x 3 lea lea  4096 Apr 18 16:00 controllers
-rw-r--r-- 1 lea lea   302 Apr 18 16:00 index.php
-rw-r--r-- 1 lea lea   619 Apr 23 15:21 logo.gif
-rw-r--r-- 1 lea lea  1484 Apr 23 15:21 logo.png
drwxr-xr-x 2 lea lea  4096 Apr 23 16:24 sql
drwxr-xr-x 5 lea lea  4096 Apr 18 16:00 src
drwxr-xr-x 2 lea lea  4096 Apr 23 16:24 translations
drwxr-xr-x 5 lea lea  4096 Apr 18 16:00 views

Workaround with the zip command:

<exec executable="zip" description="Create zip archive" dir="build">
    <arg value="-r9FSX" />
    <arg value="${project.basedir}/dist/${package}" />
    <arg value="${baseName}" />
</exec>
@mrook mrook added this to the 3.1.0 milestone Apr 26, 2024
leagris added a commit to leagris/phing that referenced this issue Apr 27, 2024
Fix phingofficial#1817 Stores directories's original permissions
as `ZipArchive::OPSYS_UNIX` `ExternalAttribute`.
leagris added a commit to leagris/phing that referenced this issue Apr 27, 2024
Fix phingofficial#1817 Stores directories's original permissions
as `ZipArchive::OPSYS_UNIX` `ExternalAttribute`.
leagris added a commit to leagris/phing that referenced this issue Apr 28, 2024
Fix phingofficial#1817 When file permissions are supported, stores directories's original
permissions as `ZipArchive::OPSYS_UNIX` `ExternalAttribute`.
leagris added a commit to leagris/phing that referenced this issue May 2, 2024
Fix phingofficial#1817 When file permissions are supported, stores directories's original
permissions as `ZipArchive::OPSYS_UNIX` `ExternalAttribute`.
leagris added a commit to leagris/guide that referenced this issue May 5, 2024
leagris added a commit to leagris/phing that referenced this issue May 31, 2024
Fix phingofficial#1817 When file permissions are supported, stores directories's original
permissions as `ZipArchive::OPSYS_UNIX` `ExternalAttribute`.
leagris added a commit to leagris/phing that referenced this issue Jul 9, 2024
Fix phingofficial#1817 When file permissions are supported, stores directories's original
permissions as `ZipArchive::OPSYS_UNIX` `ExternalAttribute`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants