maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Boyles (Jira)" <j...@apache.org>
Subject [jira] [Commented] (MASSEMBLY-852) <directoryMode> permissions are lost if <include> is present
Date Wed, 23 Sep 2020 16:46:00 GMT

    [ https://issues.apache.org/jira/browse/MASSEMBLY-852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17200948#comment-17200948
] 

Michael Boyles commented on MASSEMBLY-852:
------------------------------------------

The problem is with plexus-archiver, not with the assembly plugin.

I traced it was far as this iterator.

[https://github.com/codehaus-plexus/plexus-archiver/blob/master/src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java#L525] 

Two items go in (AbstractZipArchiver.resources), but three come out:
 * bin-include/testfile
 * bin-no-include
 * bin-no-include/testfile

The bin-include version realises it needs to creates the parent directories, so just uses
the default mode. For the no-include version, since the directory and file are created as
separate entities, the correct mode is preserved. 

I would raise a PR against that repo, but just looking at this iterator started to give me
a headache.

> <directoryMode> permissions are lost if <include> is present
> ------------------------------------------------------------
>
>                 Key: MASSEMBLY-852
>                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-852
>             Project: Maven Assembly Plugin
>          Issue Type: Bug
>          Components: component descriptor, permissions
>    Affects Versions: 3.0.0
>         Environment: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m;
support was removed in 8.0
> Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T00:58:10+03:00)
> Java version: 1.8.0_51, vendor: Oracle Corporation
> Java home: /usr/java/jdk1.8.0_51/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "2.6.32-573.8.1.el6.x86_64", arch: "amd64", family: "unix"
>            Reporter: Anton
>            Priority: Minor
>         Attachments: test.rar
>
>
> Used next descriptor:
> {code:xml}
>     <assembly>
>         <id>test</id>
>         <formats>
>                 <format>zip</format>
>         </formats>
>          <includeBaseDirectory>false</includeBaseDirectory>
>         <fileSets>
>                 <fileSet>
>                         <directory>bin</directory>
>                         <outputDirectory>bin-include</outputDirectory>
>                         <includes>
>                             <include>*</include>
>                         </includes>
>                         <directoryMode>700</directoryMode>
>                         <fileMode>700</fileMode>
>                 </fileSet>
>                 <fileSet>
>                         <directory>bin</directory>
>                         <outputDirectory>bin-no-include</outputDirectory>
>                         <directoryMode>700</directoryMode>
>                         <fileMode>700</fileMode>
>                 </fileSet>
>         </fileSets>
> </assembly>
> {code}
> For both *<filesSets>* same *directoryMode* is set, but for case where *<include>*
pattern is present directory permissions are broken.
> Listing:
> {noformat}
> $ zipinfo target/testpom-1.0.0.zip
> Archive:  target/testpom-1.0.0.zip
> Zip file size: 502 bytes, number of entries: 4
> drwxr-xr-x  2.0 unx        0 b- stor 17-Apr-19 17:48 bin-include/
> drwx------  2.0 unx        0 b- stor 17-Apr-19 15:48 bin-no-include/
> -rwx------  2.0 unx        0 bl defN 17-Apr-19 15:48 bin-include/testfile
> -rwx------  2.0 unx        0 bl defN 17-Apr-19 15:48 bin-no-include/testfile
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message