Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,21 @@ public static void extractArchive(Path archiveFile, Path destPath, String folder
new File(newFile.getParent()).mkdirs();

if (entry.isDirectory()) {
// codeql[java/zipslip] justification: ZipSlipGuard + canonical startsWith; re-review by 2027-07-31
// codeql[java/zipslip] justification: ZipSlipGuard + canonical startsWith; re-review by
// 2027-07-31
Files.createDirectory(newFile.toPath());
continue;
}

System.out.println("Creating file " + newFile);

// codeql[java/zipslip] justification: ZipSlipGuard + canonical startsWith; re-review by 2027-07-31
// codeql[java/zipslip] justification: ZipSlipGuard + canonical startsWith; re-review by
// 2027-07-31
Files.copy(archive.getInputStream(entry), newFile.toPath());

// Preserve executable permissions for shell scripts
if (entryName.endsWith(".sh")) {
File file = entryDest.toFile();
File file = newFile;
file.setExecutable(true, false); // Set executable for owner, group, and others
}
}
Expand Down
Loading