JDK-5010310 : Java2D font code opens font file outside of privileged block
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 5.0
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2004-03-09
  • Updated: 2004-03-10
  • Resolved: 2004-03-10
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
5.0 b42Fixed
Related Reports
Relates :  
Relates :  
Description
The fix for 4995422 can cause font files to be opened outside of the
privileged blocks uses for font initialisation or loading of all fonts.

Thus some webstarted apps or applets may see an exception as follows :

java.security.AccessControlException: access denied (java.io.FilePermission /usr/openwin/lib/X11/fonts/Type1 read)
   at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
   at java.security.AccessController.checkPermission(AccessController.java:425)
   at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
   at java.lang.SecurityManager.checkRead(SecurityManager.java:863)
   at java.io.File.list(File.java:933)
   at java.io.File.list(File.java:966)
   at sun.java2d.SunGraphicsEnvironment.addDirFonts(SunGraphicsEnvironment.java:664)
   at sun.java2d.SunGraphicsEnvironment.registerFontsInDir(SunGraphicsEnvironment.java:595)
   at sun.java2d.SunGraphicsEnvironment.register1dot0Fonts(SunGraphicsEnvironment.java:579)
   at sun.font.FontManager.findFont2D(FontManager.java:1142)
   at java.awt.Font.getFont2D(Font.java:357) 

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b42 tiger-beta2
14-06-2004

EVALUATION As per description. The fix is to use a doPrivileged block. ###@###.### 2004-03-09 ============================ NB: The bug only affects Solaris. ###@###.### 2004-03-09 ============================
09-03-2004