Skip to content

Commit

Permalink
[MASSEMBLY-989] apply 022 umask in RB mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed May 5, 2023
1 parent 5c492d0 commit 2982200
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ under the License.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.6.3</version>
<version>4.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down
8 changes: 7 additions & 1 deletion src/it/projects/reproducible/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,20 @@ effective = sb.toString()
// 2. on *nix, based on umask system configuration, group write mode differs:
// - umask == 002: many Linux distro and MacOS create group writable files/directories:
// => reference result is zip-content-775.txt: directory=40775, file=100664, executable=100775
// - umask == 022: some Linux distros like Fedora is create group read-only files/directories:
// - umask == 022: some Linux distros like recent Fedora create group read-only files/directories:
// => reference result is zip-content-755.txt: directory=40755, file=100644, executable=100755
// with MASSEMBLY-989, umask 022 is forced: 775 is not happening any more, even if the IT check could detect it...
reference = "zip-content-" + ( effective.contains( "644 executable" ) ? "win" : effective.contains( "0775" ) ? "775" : "755" ) + ".txt"
content = new File( basedir, reference ).text.replace( "\r\n", "\n" )

println( 'effective content:' )
println( effective )
println( 'comparing against reference ' + reference )
if ( reference.contains( "775" ) )
{
println( '775 reference is not supposed to happen since MASSEMBLY-989' )
return -1
}

index = content.indexOf( 'resulting sha1:' )
contentMode = content.substring( 0, index )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,16 @@ public FileTime getLastModifiedTime() {
return delegate.getLastModifiedTime();
}

@Override
public void setUmask(int umask) {
delegate.setUmask(umask);
}

@Override
public int getUmask() {
return delegate.getUmask();
}

@Override
public void configureReproducibleBuild(FileTime fileTime) {
delegate.configureReproducibleBuild(fileTime);
Expand Down

0 comments on commit 2982200

Please sign in to comment.