Skip to content

Commit 07eaf82

Browse files
committed
Merge branch '3.4.x' into 3.5.x
Closes gh-46194
2 parents 42b9468 + 0932c4a commit 07eaf82

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ private boolean skipProcessing(FileCopyDetails details) {
256256
private void processDirectory(FileCopyDetails details) throws IOException {
257257
String name = details.getRelativePath().getPathString();
258258
ZipArchiveEntry entry = new ZipArchiveEntry(name + '/');
259-
prepareEntry(entry, name, getTime(details), getFileMode(details));
259+
prepareEntry(entry, name, getTime(details), getDirMode(details));
260260
this.out.putArchiveEntry(entry);
261261
this.out.closeArchiveEntry();
262262
this.writtenDirectories.add(name);
@@ -476,17 +476,21 @@ private Long getTime(FileCopyDetails details) {
476476

477477
private int getDirMode() {
478478
return (BootZipCopyAction.this.dirMode != null) ? BootZipCopyAction.this.dirMode
479-
: UnixStat.DIR_FLAG | UnixStat.DEFAULT_DIR_PERM;
479+
: UnixStat.DEFAULT_DIR_PERM;
480480
}
481481

482482
private int getFileMode() {
483483
return (BootZipCopyAction.this.fileMode != null) ? BootZipCopyAction.this.fileMode
484-
: UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM;
484+
: UnixStat.DEFAULT_FILE_PERM;
485+
}
486+
487+
private int getDirMode(FileCopyDetails details) {
488+
return (BootZipCopyAction.this.fileMode != null) ? BootZipCopyAction.this.dirMode : getPermissions(details);
485489
}
486490

487491
private int getFileMode(FileCopyDetails details) {
488492
return (BootZipCopyAction.this.fileMode != null) ? BootZipCopyAction.this.fileMode
489-
: UnixStat.FILE_FLAG | getPermissions(details);
493+
: getPermissions(details);
490494
}
491495

492496
private int getPermissions(FileCopyDetails details) {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveIntegrationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,10 @@ void defaultDirAndFileModesAreUsed() throws IOException {
589589
continue;
590590
}
591591
if (entry.isDirectory()) {
592-
assertEntryMode(entry, UnixStat.DIR_FLAG | UnixStat.DEFAULT_DIR_PERM);
592+
assertEntryMode(entry, UnixStat.DEFAULT_DIR_PERM);
593593
}
594594
else {
595-
assertEntryMode(entry, UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM);
595+
assertEntryMode(entry, UnixStat.DEFAULT_FILE_PERM);
596596
}
597597
}
598598
}

0 commit comments

Comments
 (0)