United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7177216 native2ascii changes file permissions of input file
JDK-7177216 : native2ascii changes file permissions of input file

Details
Type:
Bug
Submit Date:
2012-06-15
Status:
Closed
Updated Date:
2012-08-14
Project Name:
JDK
Resolved Date:
2012-06-19
Component:
core-libs
OS:
generic,linux_redhat_5.0
Sub-Component:
java.nio.charsets
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u33,7u5
Fixed Versions:
6u33 (b32)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:

Sub Tasks

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

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

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



Hardware and Software, Engineered to Work Together