JDK-4667175 : Cannot parsing java.policy which includes some 2 bytes char
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 1.4.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-04-12
  • Updated: 2019-04-03
  • Resolved: 2002-10-11
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
1.4.2 mantisFixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Merlin(JRE) can not parse correctly the policy file that includes some
2 bytes code character string.

1. Reproduce

 1) Download and install j2re-1_4_0-win-i.exe 
 2) Edit java.policy file 
    -> Please use the attacehd java.policy file 

 3) Open the java plug-in Control panel and set as follows.
     - Check "Enable Java Plug-in"
     - Check "Show Console"
     - Chech "Show Exception Dialog Box"

 4) Open the Internet Explorer and specify the URL which downloads an applet
    like "http://java.sun.com"

    -> You will see the Java Console show up

 5) The message,
       java.security.policy: error parsing
         file:D:/PROGRA~1/Java/J2RE14~1.0/lib/security/java.policy:
        line 12: expected [;], found [s]
    will appear at the end of the Java console.
    (Under Japanese Windows, the message is wrtten in Japanese.)


2. Configration

   MPU : Pentium IV 1.4 [GHz]
   Mem : 384 [MB]
   OS  : Windows 2000 SP2 (Japanese)
   Browser : Internet Explorer 5.5 SP2

3. Attached files
   - java.policy : policy file as an sample
   - message-jp.txt : actual message under the Japanese Windows

4. Note
   - We know only the String "Jikkou"(Japanese kanji) causes this issue 
     so far.
     Even if this String is in a comment line, the above message appears.
  
2002-04-12
=============================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b04 VERIFIED IN: mantis-beta
14-06-2004

EVALUATION ###@###.### 2002-04-18 got CCC approval to mandate policy files must be UTF-8, so will close this as will not fix. we will be updating the security docs at: http://java.sun.com/j2se/1.4/docs/guide/security to specify that policy files must be UTF-8. we will also update the merlin compatibility page to document this new restriction. ###@###.### 2002-09-24 just got feedback from the CCC. it is ok to simply add a system property: sun.security.policy.utf8 see the public summary for details on the property. since the property does not start with 'java.', it is not standard and not part of the specification. we can therefore just tell fujitsu of its existence, and don't have to document it publically. we had originally planned to provide an additional security property as well, but CCC frowned on this since new security properties are borderline spec changes.
11-06-2004

PUBLIC COMMENTS prior to 1.4, the encoding scheme for the security policy file was unspecified, and the policy implementation relied on the default encoding. this caused problems in certain locales which had default encodings other than UTF-8. therefore in 1.4 the policy implementation was modified to require policy files to be encoded in UTF-8. while this does allow the policy to be used across different locales, it breaks policies that contain characters in the default encoding. to overcome this, administrators will have to convert their policy over to UTF-8. the native2ascii tool may be used to help with the conversion. the security policy documents at: http://java.sun.com/j2se/1.4/docs/guide/security and the 1.4 compatibility page at: http://java.sun.com/j2se/1.4/compatibility.html will be updated to document this new restriction. ------------------------------------ a new system property will be made available: sun.security.policy.utf8 if the system property is set to 'true', the policy file will be read in using UTF8 (JDK 1.4 and JDK 1.4.1 behavior). if the system property is set to 'false', the policy file will be read in using the default encoding (pre-JDK 1.4 behavior). when the system property is not set (it is NULL), its default value is 'true'.
10-06-2004