Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fileMode and dirMode are not applied to all entries in an archive produced by BootJar #37496

Closed
wilkinsona opened this issue Sep 20, 2023 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@wilkinsona
Copy link
Member

tasks.named("bootJar") {
    fileMode = 0400
    dirMode = 0500
}

The configuration above applies the expected permissions to files and directories in BOOT-INF/lib and BOOT-INF/classes but not, for example, to the files and directories added to the root of the jar for the launcher:

Archive:  build/libs/entry-permissions-0.0.1-SNAPSHOT.jar
Zip file size: 19410183 bytes, number of entries: 143
-rwxr-xr-x  2.0 unx        0 bl defN 23-Sep-20 14:57 META-INF/
-rw-r--r--  2.0 unx      489 bl defN 23-Sep-20 14:57 META-INF/MANIFEST.MF
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/
-rw-r--r--  2.0 unx     1623 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/ManifestInfo.class
-rw-r--r--  2.0 unx     4384 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/MetaInfVersionsInfo.class
-rw-r--r--  2.0 unx     3079 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/NestedJarFile$JarEntriesEnumeration.class
-rw-r--r--  2.0 unx     2584 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/NestedJarFile$JarEntryInflaterInputStream.class
-rw-r--r--  2.0 unx     3621 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/NestedJarFile$JarEntryInputStream.class
-rw-r--r--  2.0 unx     3615 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/NestedJarFile$NestedJarEntry.class
-rw-r--r--  2.0 unx     2138 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/NestedJarFile$ZipContentEntriesSpliterator.class
-rw-r--r--  2.0 unx    15320 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/NestedJarFile.class
-rw-r--r--  2.0 unx     5791 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/NestedJarFileResources.class
-rw-r--r--  2.0 unx     3801 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/SecurityInfo.class
-rw-r--r--  2.0 unx     1663 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jar/ZipInflaterInputStream.class
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jarmode/
-rw-r--r--  2.0 unx      293 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/jarmode/JarMode.class
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/
-rw-r--r--  2.0 unx      319 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/Archive$Entry.class
-rw-r--r--  2.0 unx     4457 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/Archive.class
-rw-r--r--  2.0 unx     4342 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/ClassPathIndexFile.class
-rw-r--r--  2.0 unx     5561 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/ExecutableArchiveLauncher.class
-rw-r--r--  2.0 unx     1047 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/ExplodedArchive$FileArchiveEntry.class
-rw-r--r--  2.0 unx     5819 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/ExplodedArchive.class
-rw-r--r--  2.0 unx     1104 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/JarFileArchive$JarArchiveEntry.class
-rw-r--r--  2.0 unx    10027 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/JarFileArchive.class
-rw-r--r--  2.0 unx     1662 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/JarLauncher.class
-rw-r--r--  2.0 unx     2440 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/JarModeRunner.class
-rw-r--r--  2.0 unx     1586 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/LaunchedClassLoader$DefinePackageCallType.class
-rw-r--r--  2.0 unx     1573 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/LaunchedClassLoader$UseFastConnectionExceptionsEnumeration.class
-rw-r--r--  2.0 unx    11391 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/LaunchedClassLoader.class
-rw-r--r--  2.0 unx     3894 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/Launcher.class
-rw-r--r--  2.0 unx     3688 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/PropertiesLauncher$Instantiator$Using.class
-rw-r--r--  2.0 unx     3650 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/PropertiesLauncher$Instantiator.class
-rw-r--r--  2.0 unx    20847 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/PropertiesLauncher.class
-rw-r--r--  2.0 unx     5277 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/SystemPropertyUtils.class
-rw-r--r--  2.0 unx     1707 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/launch/WarLauncher.class
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/log/
-rw-r--r--  2.0 unx     1408 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/log/DebugLogger$DisabledDebugLogger.class
-rw-r--r--  2.0 unx     2610 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/log/DebugLogger$SystemErrDebugLogger.class
-rw-r--r--  2.0 unx     1823 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/log/DebugLogger.class
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/
-rw-r--r--  2.0 unx     1676 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/Handlers.class
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/
-rw-r--r--  2.0 unx     2612 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/Canonicalizer.class
-rw-r--r--  2.0 unx     1928 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/Handler$SpecFormat$1.class
-rw-r--r--  2.0 unx     2507 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/Handler$SpecFormat$2.class
-rw-r--r--  2.0 unx      993 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/Handler$SpecFormat$3.class
-rw-r--r--  2.0 unx     2372 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/Handler$SpecFormat.class
-rw-r--r--  2.0 unx     4344 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/Handler.class
-rw-r--r--  2.0 unx     3292 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/JarFileUrlKey.class
-rw-r--r--  2.0 unx     2668 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/JarUrl.class
-rw-r--r--  2.0 unx     1260 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/JarUrlConnection$ConnectionInputStream.class
-rw-r--r--  2.0 unx     7936 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/JarUrlConnection.class
-rw-r--r--  2.0 unx     1325 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/UrlJarEntry.class
-rw-r--r--  2.0 unx     2911 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/UrlJarFile.class
-rw-r--r--  2.0 unx     5740 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/UrlJarFileFactory.class
-rw-r--r--  2.0 unx     2427 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/UrlJarFiles$Cache.class
-rw-r--r--  2.0 unx     3651 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/UrlJarFiles.class
-rw-r--r--  2.0 unx      486 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/UrlJarManifest$ManifestSupplier.class
-rw-r--r--  2.0 unx     3371 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/UrlJarManifest.class
-rw-r--r--  2.0 unx     3145 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/jar/UrlNestedJarFile.class
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/nested/
-rw-r--r--  2.0 unx      845 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/nested/Handler.class
-rw-r--r--  2.0 unx     4383 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/nested/NestedLocation.class
-rw-r--r--  2.0 unx     1590 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/nested/NestedUrlConnection$ConnectionInputStream.class
-rw-r--r--  2.0 unx     4638 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/nested/NestedUrlConnection.class
-rw-r--r--  2.0 unx     3951 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/protocol/nested/NestedUrlConnectionResources.class
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/util/
-rw-r--r--  2.0 unx     3508 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/net/util/UrlDecoder.class
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/ref/
-rw-r--r--  2.0 unx      667 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/ref/Cleaner.class
-rw-r--r--  2.0 unx     1319 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/ref/DefaultCleaner.class
drwxr-xr-x  2.0 unx        0 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/
-rw-r--r--  2.0 unx     1155 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ByteArrayDataBlock.class
-rw-r--r--  2.0 unx      231 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/CloseableDataBlock.class
-rw-r--r--  2.0 unx     1032 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/DataBlock.class
-rw-r--r--  2.0 unx     2521 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/DataBlockInputStream.class
-rw-r--r--  2.0 unx     4026 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/FileChannelDataBlock$ManagedFileChannel.class
-rw-r--r--  2.0 unx      470 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/FileChannelDataBlock$Tracker.class
-rw-r--r--  2.0 unx     4395 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/FileChannelDataBlock.class
-rw-r--r--  2.0 unx     1678 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/NameOffsetLookups.class
-rw-r--r--  2.0 unx     2236 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/VirtualDataBlock.class
-rw-r--r--  2.0 unx     1644 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/VirtualZipDataBlock$DataPart.class
-rw-r--r--  2.0 unx     5379 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/VirtualZipDataBlock.class
-rw-r--r--  2.0 unx     4033 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/Zip64EndOfCentralDirectoryLocator.class
-rw-r--r--  2.0 unx     5724 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/Zip64EndOfCentralDirectoryRecord.class
-rw-r--r--  2.0 unx     9765 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ZipCentralDirectoryFileHeaderRecord.class
-rw-r--r--  2.0 unx     6355 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ZipContent$Entry.class
-rw-r--r--  2.0 unx    12393 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ZipContent$Loader.class
-rw-r--r--  2.0 unx     2295 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ZipContent$Source.class
-rw-r--r--  2.0 unx    11696 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ZipContent.class
-rw-r--r--  2.0 unx     2105 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ZipEndOfCentralDirectoryRecord$Located.class
-rw-r--r--  2.0 unx     6496 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ZipEndOfCentralDirectoryRecord.class
-rw-r--r--  2.0 unx     5545 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ZipLocalFileHeaderRecord.class
-rw-r--r--  2.0 unx     1474 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ZipString$CompareType.class
-rw-r--r--  2.0 unx     7417 bl defN 80-Feb-01 00:00 org/springframework/boot/loader/zip/ZipString.class
-rwxr-xr-x  2.0 unx        0 bl defN 23-Sep-20 14:57 BOOT-INF/
-rwxr-xr-x  2.0 unx        0 bl defN 23-Sep-20 14:57 BOOT-INF/classes/
-r-x------  2.0 unx        0 bl defN 23-Sep-19 11:07 BOOT-INF/classes/com/
-r-x------  2.0 unx        0 bl defN 23-Sep-19 11:07 BOOT-INF/classes/com/example/
-r-x------  2.0 unx        0 bl defN 23-Sep-19 11:07 BOOT-INF/classes/com/example/entrypermissions/
-r--------  2.0 unx      818 bl defN 23-Sep-19 11:07 BOOT-INF/classes/com/example/entrypermissions/EntryPermissionsApplication.class
-r--------  2.0 unx        1 bl defN 23-Sep-19 09:52 BOOT-INF/classes/application.properties
-rwxr-xr-x  2.0 unx        0 bl defN 23-Sep-20 14:57 BOOT-INF/lib/
-r--------  2.0 unx  1023155 b- stor 23-Sep-15 10:45 BOOT-INF/lib/spring-webmvc-6.1.0-M5.jar
-r--------  2.0 unx  1845907 b- stor 23-Sep-15 10:45 BOOT-INF/lib/spring-web-6.1.0-M5.jar
-r--------  2.0 unx  1877948 b- stor 23-Sep-19 11:07 BOOT-INF/lib/spring-boot-autoconfigure-3.2.0-SNAPSHOT.jar
-r--------  2.0 unx  1576522 b- stor 23-Sep-19 11:07 BOOT-INF/lib/spring-boot-3.2.0-SNAPSHOT.jar
-r--------  2.0 unx    26141 b- stor 22-Sep-22 12:31 BOOT-INF/lib/jakarta.annotation-api-2.1.1.jar
-r--------  2.0 unx  1269849 b- stor 23-Sep-15 10:45 BOOT-INF/lib/spring-context-6.1.0-M5.jar
-r--------  2.0 unx   410507 b- stor 23-Sep-15 10:45 BOOT-INF/lib/spring-aop-6.1.0-M5.jar
-r--------  2.0 unx   863388 b- stor 23-Sep-15 10:45 BOOT-INF/lib/spring-beans-6.1.0-M5.jar
-r--------  2.0 unx   299834 b- stor 23-Sep-15 10:45 BOOT-INF/lib/spring-expression-6.1.0-M5.jar
-r--------  2.0 unx  1842605 b- stor 23-Sep-15 10:45 BOOT-INF/lib/spring-core-6.1.0-M5.jar
-r--------  2.0 unx   334352 b- stor 23-Sep-12 07:23 BOOT-INF/lib/snakeyaml-2.2.jar
-r--------  2.0 unx   122937 b- stor 23-Jun-13 08:17 BOOT-INF/lib/jackson-datatype-jsr310-2.15.2.jar
-r--------  2.0 unx    10346 b- stor 23-Jun-13 08:16 BOOT-INF/lib/jackson-module-parameter-names-2.15.2.jar
-r--------  2.0 unx    75567 b- stor 23-Jun-13 08:16 BOOT-INF/lib/jackson-annotations-2.15.2.jar
-r--------  2.0 unx   549207 b- stor 23-Jun-13 08:16 BOOT-INF/lib/jackson-core-2.15.2.jar
-r--------  2.0 unx    36110 b- stor 23-Jun-13 08:17 BOOT-INF/lib/jackson-datatype-jdk8-2.15.2.jar
-r--------  2.0 unx  1620088 b- stor 23-Jun-13 08:16 BOOT-INF/lib/jackson-databind-2.15.2.jar
-r--------  2.0 unx   277510 b- stor 23-Sep-12 07:23 BOOT-INF/lib/tomcat-embed-websocket-10.1.13.jar
-r--------  2.0 unx  3460019 b- stor 23-Sep-12 07:23 BOOT-INF/lib/tomcat-embed-core-10.1.13.jar
-r--------  2.0 unx   258360 b- stor 23-Sep-12 07:23 BOOT-INF/lib/tomcat-embed-el-10.1.13.jar
-r--------  2.0 unx    71264 b- stor 23-Sep-12 11:05 BOOT-INF/lib/micrometer-observation-1.12.0-M3.jar
-r--------  2.0 unx   282793 b- stor 23-Aug-30 06:58 BOOT-INF/lib/logback-classic-1.4.11.jar
-r--------  2.0 unx    21777 b- stor 23-Feb-23 14:44 BOOT-INF/lib/log4j-to-slf4j-2.20.0.jar
-r--------  2.0 unx     6345 b- stor 23-Sep-12 07:23 BOOT-INF/lib/jul-to-slf4j-2.0.9.jar
-r--------  2.0 unx    24468 b- stor 23-Sep-15 10:45 BOOT-INF/lib/spring-jcl-6.1.0-M5.jar
-r--------  2.0 unx    47218 b- stor 23-Sep-12 11:05 BOOT-INF/lib/micrometer-commons-1.12.0-M3.jar
-r--------  2.0 unx   597931 b- stor 23-Aug-30 06:58 BOOT-INF/lib/logback-core-1.4.11.jar
-r--------  2.0 unx    64579 b- stor 23-Sep-12 07:23 BOOT-INF/lib/slf4j-api-2.0.9.jar
-r--------  2.0 unx   313296 b- stor 23-Feb-23 14:44 BOOT-INF/lib/log4j-api-2.20.0.jar
-r-x------  2.0 unx        0 bl defN 23-Sep-19 09:52 BOOT-INF/classes/static/
-r-x------  2.0 unx        0 bl defN 23-Sep-19 09:52 BOOT-INF/classes/templates/
-rw-r--r--  2.0 unx    29918 b- stor 23-Sep-20 15:57 BOOT-INF/lib/spring-boot-jarmode-layertools-3.2.0-SNAPSHOT.jar
-rw-r--r--  2.0 unx     1326 bl defN 23-Sep-20 15:57 BOOT-INF/classpath.idx
-rw-r--r--  2.0 unx     1645 bl defN 23-Sep-20 15:57 BOOT-INF/layers.idx
143 files, 19563974 bytes uncompressed, 19381853 bytes compressed:  0.9%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants