Skip to content

Commit 4e615d2

Browse files
committed
Avoid using COPY_ATTRIBUTES when copying the jars of fast jar
We need to respect the umask. This was initially reported here: keycloak/keycloak#43437 Fixes #50556
1 parent ea60ff6 commit 4e615d2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/deployment/src/main/java/io/quarkus/deployment/pkg/jar/FastJarBuilder.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,9 @@ private static void copyDependency(Set<ArtifactKey> parentFirstArtifacts, Output
443443
.setPath(targetPath)
444444
.setResolvedDependency(appDep);
445445
if (removedFromThisArchive.isEmpty()) {
446-
Files.copy(resolvedDep, targetPath, StandardCopyOption.REPLACE_EXISTING,
447-
StandardCopyOption.COPY_ATTRIBUTES);
446+
// let's not use COPY_ATTRIBUTES to make sure we respect the system umask
447+
Files.copy(resolvedDep, targetPath, StandardCopyOption.REPLACE_EXISTING);
448+
Files.setLastModifiedTime(targetPath, Files.getLastModifiedTime(resolvedDep));
448449
} else {
449450
// we copy jars for which we remove entries to the same directory
450451
// which seems a bit odd to me

0 commit comments

Comments
 (0)