JDK-7177216 : native2ascii changes file permissions of input file
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 6u33,7u5
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,linux_redhat_5.0
  • CPU: generic,x86
  • Submitted: 2012-06-15
  • Updated: 2012-08-14
  • Resolved: 2012-06-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other Other JDK 6 JDK 7 JDK 8 Other
1.4.2_38,OpenJDK6Fixed 1.4.2_40Fixed 5.0u38Fixed 6u33 b32Fixed 7u6Fixed 8Fixed OpenJDK6Fixed
Related Reports
Relates :  
Relates :  
Description
There is different behavior in native2ascii between 6u32 and 6u33.

CONFIGURATION :
JDK : 6u33
OS :RHEL5/Solaris10

REPRODUCE:
1. run "umask 022"
2. run "native2ascii text-file new-file"
You can see the different permission between  text-file and new-file.
even if the permission of text-file is 644, that of new-file is 600.

EXAMPLE OPERATION:
-----
jle-esxi-redhat:/home/tbaba 142 % ls -l native.txt
-rw-r--r--+ 1 tbaba javasoft 0 Jun 14 16:42 native.txt
jle-esxi-redhat:/home/tbaba 143 % native2ascii native.txt  ascii.txt
jle-esxi-redhat:/home/tbaba 144 % ls -l native.txt ascii.txt
-rw-------+ 1 tbaba javasoft 0 Jun 14 17:03 ascii.txt
-rw-r--r--+ 1 tbaba javasoft 0 Jun 14 16:42 native.txt
jle-esxi-redhat:/home/tbaba 145 % java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)
jle-esxi-redhat:/home/tbaba 146 %
-----

In jdk6u32, the permission of created new text(ascii) file  
is not changed, it is still 644.
-------
jle-esxi-redhat:/home/tbaba 117 % ls -l native.txt
-rw-r--r--+ 1 tbaba javasoft 0 Jun 14 16:42 native.txt
jle-esxi-redhat:/home/tbaba 118 % native2ascii native.txt ascii.txt
jle-esxi-redhat:/home/tbaba 119 % ls -l ascii.txt
-rw-r--r--+ 1 tbaba javasoft 0 Jun 14 17:00 ascii.txt
jle-esxi-redhat:/home/tbaba 120 % java -version
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)
jle-esxi-redhat:/home/tbaba 121 %
------

Comments
EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/jdk/rev/819258b5002e
14-08-2012

EVALUATION same causes as 7175845. The resulting temporary file is "renameTo" the outputfile.
15-06-2012