View Issue Details

IDProjectCategoryView StatusLast Update
0000342fileGeneralpublic2022-04-25 06:34
Reporterjayvdb Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version5.41 
Summary0000342: jar files with POSIX shell script header do not mention they are JAR files
Descriptionhttps://github.com/pinterest/ktlint/releases/download/0.45.2/ktlint is an example of a JAR file with a POSIX shell script header, which looks like

---
#!/bin/sh

JV=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1)

X=$( [ "$JV" -ge "16" ] && echo "--add-opens java.base/java.lang=ALL-UNNAMED" || echo "")

exec java $X -Xmx512m -jar "$0" "$@"

PK...
```

The java executable can run it as a jar file directly. i.e. the following prints the help on all platforms

java -jar /path/to/ktlint --help

The file command says it is "POSIX shell script executable (binary data)"

When I manually remove the script header, file then reports it as "Zip archive data, at least v1.0 to extract, compression method=deflate"

It would be great if it could mention that it is a JAR or ZIP file, perhaps like

"POSIX shell script executable (JAR ..)" or "POSIX shell script executable (Zip archive data, ...)"
Steps To Reproduce1. Download https://github.com/pinterest/ktlint/releases/download/0.45.2/ktlint
2. `file ktlint`
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2022-04-25 06:34 jayvdb New Issue