Bug 1446700

Summary: OpenJDK 7 native2ascii always creates an output file with file permission 600
Product: Red Hat Enterprise Linux 7 Reporter: Masafumi Miura <mmiura>
Component: java-1.7.0-openjdkAssignee: Andrew John Hughes <ahughes>
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: bodavis, dbhole, jkejda, jvanek, lmiksik
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: java-1.7.0-openjdk-1.7.0.141-2.6.10.4.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 07:31:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Masafumi Miura 2017-04-28 15:56:04 UTC
### Description of problem:

OpenJDK 7 native2ascii always creates an output file with file permission 600. It should follow umask setting.

A same issue was reported in JDK bug database and already fixed: 

    https://bugs.openjdk.java.net/browse/JDK-7177216
    http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/819258b5002e
    http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/e50c9a5f001c
    http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/0e34d4326386

Note that this issue does not exist in OpenJDK 6 and OpenJDK on RHEL 7 but it exists in OpenJDK 7 on RHEL 7. As far as I checked source code in src rpm, it looks OpenJDK 7 does not contain the above fix. Please backport the fix.


### Version-Release number of selected component (if applicable):

java-1.7.0-openjdk-1.7.0.131-2.6.9.0.el7_3.x86_64
java-1.7.0-openjdk-devel-1.7.0.131-2.6.9.0.el7_3.x86_64


### How reproducible:

Anytime


### Steps to Reproduce:

1. Create an input file:

    touch inputfile-test.txt

2. Execute OpenJDK 7's native2ascii against the file:

    /usr/lib/jvm/java-1.7.0-openjdk/bin/native2ascii inputfile-test.txt outputfile-test.txt

3. Check the files' permissions:

    ls -l inputfile-test.txt outputfile-test.txt


### Actual results:

The permission of the output file does not follow umask setting. It's always 600.


### Expected results:

The permission of the output file should follow umask setting. For example, if umask is 022, it should be 644.

Comment 1 Masafumi Miura 2017-04-28 15:59:19 UTC
> Note that this issue does not exist in OpenJDK 6 and OpenJDK on RHEL 7 but
> it exists in OpenJDK 7 on RHEL 7. 

Correction. I meant "Note that this issue does not exist in OpenJDK 6 and OpenJDK **8** on RHEL 7 but it exists in OpenJDK 7 on RHEL 7."

Comment 2 Andrew John Hughes 2017-05-04 16:42:33 UTC
Confirmed:

$  ls -l inputfile-test.txt outputfile-test.txt
-rw-r--r-- 1 andrew users 0 May  4 17:41 inputfile-test.txt
-rw------- 1 andrew users 0 May  4 17:41 outputfile-test.txt

Comment 7 errata-xmlrpc 2017-08-01 07:31:55 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://access.redhat.com/errata/RHBA-2017:2287