Merge branch '3.5.x'

Closes gh-46195
This commit is contained in:
Andy Wilkinson 2025-06-24 14:46:46 +01:00
commit 0d13264c81
2 changed files with 10 additions and 6 deletions

View File

@ -256,7 +256,7 @@ class BootZipCopyAction implements CopyAction {
private void processDirectory(FileCopyDetails details) throws IOException { private void processDirectory(FileCopyDetails details) throws IOException {
String name = details.getRelativePath().getPathString(); String name = details.getRelativePath().getPathString();
ZipArchiveEntry entry = new ZipArchiveEntry(name + '/'); ZipArchiveEntry entry = new ZipArchiveEntry(name + '/');
prepareEntry(entry, name, getTime(details), getFileMode(details)); prepareEntry(entry, name, getTime(details), getDirMode(details));
this.out.putArchiveEntry(entry); this.out.putArchiveEntry(entry);
this.out.closeArchiveEntry(); this.out.closeArchiveEntry();
this.writtenDirectories.add(name); this.writtenDirectories.add(name);
@ -476,17 +476,21 @@ class BootZipCopyAction implements CopyAction {
private int getDirMode() { private int getDirMode() {
return (BootZipCopyAction.this.dirMode != null) ? BootZipCopyAction.this.dirMode return (BootZipCopyAction.this.dirMode != null) ? BootZipCopyAction.this.dirMode
: UnixStat.DIR_FLAG | UnixStat.DEFAULT_DIR_PERM; : UnixStat.DEFAULT_DIR_PERM;
} }
private int getFileMode() { private int getFileMode() {
return (BootZipCopyAction.this.fileMode != null) ? BootZipCopyAction.this.fileMode return (BootZipCopyAction.this.fileMode != null) ? BootZipCopyAction.this.fileMode
: UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM; : UnixStat.DEFAULT_FILE_PERM;
}
private int getDirMode(FileCopyDetails details) {
return (BootZipCopyAction.this.fileMode != null) ? BootZipCopyAction.this.dirMode : getPermissions(details);
} }
private int getFileMode(FileCopyDetails details) { private int getFileMode(FileCopyDetails details) {
return (BootZipCopyAction.this.fileMode != null) ? BootZipCopyAction.this.fileMode return (BootZipCopyAction.this.fileMode != null) ? BootZipCopyAction.this.fileMode
: UnixStat.FILE_FLAG | getPermissions(details); : getPermissions(details);
} }
private int getPermissions(FileCopyDetails details) { private int getPermissions(FileCopyDetails details) {

View File

@ -589,10 +589,10 @@ abstract class AbstractBootArchiveIntegrationTests {
continue; continue;
} }
if (entry.isDirectory()) { if (entry.isDirectory()) {
assertEntryMode(entry, UnixStat.DIR_FLAG | UnixStat.DEFAULT_DIR_PERM); assertEntryMode(entry, UnixStat.DEFAULT_DIR_PERM);
} }
else { else {
assertEntryMode(entry, UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM); assertEntryMode(entry, UnixStat.DEFAULT_FILE_PERM);
} }
} }
} }