Mercurial > hg > release > icedtea6-1.2
view patches/icedtea-use-system-tzdata.patch @ 856:d86e9eb1fa7d
2008-05-08 Lillian Angel <langel@redhat.com>
Fixes Bug #150
* patches/icedtea-certbundle.patch: Moved system properties defined in
hotspot to TrustManagerFactoryImpl.
* icedtea-use-system-tzdata.patch: Updated to patch cleanly.
author | Lillian Angel <langel@redhat.com> |
---|---|
date | Thu, 08 May 2008 11:04:53 -0400 |
parents | d9b2c16cb3a8 |
children | d9fa5282ccde |
line wrap: on
line source
--- ../openjdkb23/openjdk/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java 2007-10-30 04:38:28.000000000 -0400 +++ openjdk/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java 2007-11-13 13:16:52.000000000 -0500 @@ -28,6 +28,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.security.AccessControlException; import java.io.IOException; import java.lang.ref.SoftReference; import java.security.AccessController; @@ -1021,11 +1022,29 @@ byte[] buffer = null; try { - String homeDir = AccessController.doPrivileged( - new sun.security.action.GetPropertyAction("java.home")); - final String fname = homeDir + File.separator + "lib" + File.separator - + "zi" + File.separator + fileName; - buffer = (byte[]) AccessController.doPrivileged(new PrivilegedExceptionAction() { + String zi_dir = (String) AccessController.doPrivileged(new sun.security.action.GetPropertyAction("user.zoneinfo.dir")); + File dir = null; + if (zi_dir != null) + dir = new File(zi_dir); + + // Some minimal sanity checking + if (dir != null) { + try { + File f = new File(dir, "ZoneInfoMappings"); + if (!f.exists()) + dir = null; + } catch (AccessControlException ace) { + dir = null; + } + } + + if (dir == null) { + String homeDir = (String) AccessController.doPrivileged(new sun.security.action.GetPropertyAction("java.home")); + zi_dir = homeDir + File.separator + "lib" + File.separator + + "zi"; + } + final String fname = zi_dir + File.separator + fileName; + buffer = (byte[]) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws IOException { File file = new File(fname); if (!file.canRead()) { --- oldopenjdk6/hotspot/src/os/linux/vm/os_linux.cpp 2008-03-26 05:07:22.000000000 -0400 +++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2008-05-08 11:03:17.000000000 -0400 @@ -376,6 +376,10 @@ } } +// Use the system zoneinfo files, if present +Arguments::PropertyList_add (&sp, + "user.zoneinfo.dir", "/usr/share/javazi"); + #undef malloc #undef getenv #undef EXTENSIONS_DIR