Bug 1169509 - file: report full java version for 1.7 and 1.8 class files
Summary: file: report full java version for 1.7 and 1.8 class files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: file
Version: 6.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Jan Kaluža
QA Contact: Marek Marusic
URL:
Whiteboard:
Depends On:
Blocks: 1172231 1254457 1269913 1309878
TreeView+ depends on / blocked
 
Reported: 2014-12-01 21:26 UTC by Nathan Galvin
Modified: 2016-05-10 19:47 UTC (History)
4 users (show)

Fixed In Version: file-5.04-22.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1278737 1309878 (view as bug list)
Environment:
Last Closed: 2016-05-10 19:47:16 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:0760 normal SHIPPED_LIVE Moderate: file security, bug fix, and enhancement update 2016-05-10 22:32:51 UTC

Description Nathan Galvin 2014-12-01 21:26:09 UTC
Description of problem:
If you compile using Java SE 6, file will display:
    compiled Java class data, version 48.0 (Java 1.4)
Note the "(Java 1.4)" at the end.

If you compile with Java SE 7, file will display:
    compiled Java class data, version 51.0
Note the missing ("Java 1.7)" at the end.

Version-Release number of selected component (if applicable):
java-1.7.0-ibm-1.7.0.7.1-1jpp.1.el6_5.x86_64

How reproducible:
Very

Steps to Reproduce:
1. install java
2. complile java
3. run 'file' command against class files

Actual results:
No java version reported

Expected results:
Java verion to be reported as part of the output.

Additional info:

Comment 1 Nathan Galvin 2014-12-01 21:28:12 UTC
(In reply to Nathan Galvin from comment #0)
> Description of problem:
> If you compile using Java SE 6, file will display:
>     compiled Java class data, version 48.0 (Java 1.4)
> Note the "(Java 1.4)" at the end.
> 
> If you compile with Java SE 7, file will display:
>     compiled Java class data, version 51.0
> Note the missing ("Java 1.7)" at the end.
> 
> Version-Release number of selected component (if applicable):
> java-1.7.0-ibm-1.7.0.7.1-1jpp.1.el6_5.x86_64
> 
> How reproducible:
> Very
> 
> Steps to Reproduce:
> 1. install java
> 2. complile java
> 3. run 'file' command against class files

Should read

Steps to Reproduce:
1. install java
2. complile using java
3. run 'file' command against class files

> 
> Actual results:
> No java version reported
> 
> Expected results:
> Java verion to be reported as part of the output.
> 
> Additional info:

Comment 3 Tomas Hoger 2014-12-02 19:23:50 UTC
This isn't java bug, but file bug.  The solution is exactly what is described in the initial description of the attached support case.  cafebabe magic file needs the following two rules:

>>4 belong      0x0033      (Java 1.7)
>>4 belong      0x0034      (Java 1.8)

Their addition changes output form:

$ file java{6,7,8}.class
java6.class: compiled Java class data, version 50.0 (Java 1.6)
java7.class: compiled Java class data, version 51.0
java8.class: compiled Java class data, version 52.0

to:

$ file java{6,7,8}.class -m magic 
java6.class: compiled Java class data, version 50.0 (Java 1.6)
java7.class: compiled Java class data, version 51.0 (Java 1.7)
java8.class: compiled Java class data, version 52.0 (Java 1.8)

The issue does not seem to be fixed upstream:

https://github.com/file/file/blob/master/magic/Magdir/cafebabe

I'm sure Jan can get this upstream rather easily.

Comment 4 Jan Kaluža 2015-02-05 07:26:12 UTC
Proposed upstream: http://bugs.gw.com/view.php?id=422

Comment 13 errata-xmlrpc 2016-05-10 19:47:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-0760.html


Note You need to log in before you can comment on or make changes to this bug.