/hg/icedtea7-forest/jdk: 8 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Wed Jul 8 12:19:28 UTC 2015


changeset 2940b1683e22 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=2940b1683e22
author: andrew
date: Tue Jul 07 18:26:59 2015 +0100

	PR2458: Policy JAR files should be timestamped with the date of the policy file they hold
	Summary: Retain timestamps across copies, touch the final JAR file with the date and use last policy change date (2007/12/01)


changeset db440b7618ee in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=db440b7618ee
author: omajid
date: Thu Apr 23 13:48:02 2015 -0400

	8074761, PR2470: Empty optional parameters of LDAP query are not interpreted as empty
	Reviewed-by: vinnie
	Contributed-by: Stanislav Baiduzhyi <sbaiduzh at redhat.com>


changeset 014438c072c8 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=014438c072c8
author: andrew
date: Tue Jul 07 20:05:59 2015 +0100

	PR2482, RH489586, RH1236619: OpenJDK can't handle spaces in zone names in /etc/sysconfig/clock
	Summary: Replace ' ' with '_' in zone name, as RHEL tools do.


changeset ae5765c7b8e2 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=ae5765c7b8e2
author: andrew
date: Wed Jul 08 00:34:55 2015 +0100

	PR1883: Search Debian multiarch paths when looking for pcsclite


changeset e6bb316940e2 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=e6bb316940e2
author: andrew
date: Wed Jul 08 03:14:19 2015 +0100

	PR2446: Support system libsctp
	Summary: Provide SYSTEM_SCTP, SCTP_CFLAGS and SCTP_LIBS so as to allow compiling against the system libsctp.


changeset bcd7128dc1b0 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=bcd7128dc1b0
author: andrew
date: Wed Jul 08 03:17:08 2015 +0100

	PR2496: Enable system PCSC support by default


changeset 444d55ffed65 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=444d55ffed65
author: andrew
date: Wed Jul 08 03:17:48 2015 +0100

	Bump to icedtea-2.6.0pre24


changeset 4497f458e8c1 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=4497f458e8c1
author: andrew
date: Wed Jul 08 13:17:27 2015 +0100

	Added tag icedtea-2.6pre24 for changeset 444d55ffed65


diffstat:

 .hgtags                                                        |   1 +
 make/com/sun/nio/sctp/Makefile                                 |  11 +-
 make/javax/crypto/Makefile                                     |  23 +-
 make/jdk_generic_profile.sh                                    |  14 +-
 src/share/classes/com/sun/jndi/ldap/LdapURL.java               |  64 +++---
 src/solaris/classes/sun/nio/ch/SctpChannelImpl.java            |   2 +-
 src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java       |   2 +-
 src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java      |   2 +-
 src/solaris/classes/sun/security/smartcardio/PlatformPCSC.java |  85 +++++++-
 src/solaris/native/java/util/TimeZone_md.c                     |  88 ++++-----
 src/solaris/native/sun/nio/ch/Sctp.h                           |  25 ++-
 src/solaris/native/sun/nio/ch/SctpNet.c                        |   6 +-
 test/com/sun/jndi/ldap/LdapURLOptionalFields.java              |  62 +++++++
 13 files changed, 270 insertions(+), 115 deletions(-)

diffs (truncated from 682 to 500 lines):

diff -r 38e2f5918816 -r 4497f458e8c1 .hgtags
--- a/.hgtags	Tue Jul 07 16:11:07 2015 +0100
+++ b/.hgtags	Wed Jul 08 13:17:27 2015 +0100
@@ -622,3 +622,4 @@
 daa5092b07a75c17356bb438adba03f83f94ef17 jdk7u80-b15
 a942e0b5247772ea326705c717c5cd0ad1572aaa jdk7u80-b32
 ec336c81a5455ef96a20cff4716603e7f6ca01ad icedtea-2.6pre23
+444d55ffed65907640aad374ce84e7a01ba8dbe7 icedtea-2.6pre24
diff -r 38e2f5918816 -r 4497f458e8c1 make/com/sun/nio/sctp/Makefile
--- a/make/com/sun/nio/sctp/Makefile	Tue Jul 07 16:11:07 2015 +0100
+++ b/make/com/sun/nio/sctp/Makefile	Wed Jul 08 13:17:27 2015 +0100
@@ -29,7 +29,7 @@
 
 BUILDDIR = ../../../..
 PACKAGE = com.sun.nio.sctp
-LIBRARY = sctp
+LIBRARY = javasctp
 PRODUCT = sun
 #OTHER_JAVACFLAGS += -Xmaxwarns 1000 -Xlint
 include $(BUILDDIR)/common/Defs.gmk
@@ -67,6 +67,10 @@
   -I$(PLATFORM_SRC)/native/java/net \
   -I$(CLASSHDRDIR)/../../../../java/java.nio/nio/CClassHeaders
 
+ifeq ($(SYSTEM_SCTP), true)
+  OTHER_INCLUDES += $(SCTP_CFLAGS)
+endif
+
 ifeq ($(PLATFORM), linux)
 ifneq ($(COMPILER_WARNINGS_FATAL),false)
 COMPILER_WARNINGS_FATAL=true
@@ -81,6 +85,11 @@
 endif # macosx
 endif # windows
 
+ifeq ($(SYSTEM_SCTP), true)
+  OTHER_LDLIBS += $(SCTP_LIBS)
+  OTHER_CFLAGS += -DUSE_SYSTEM_SCTP
+endif
+
 clean clobber::
 	$(RM) -r $(CLASSDESTDIR)/com/sun/nio/sctp
 	$(RM) -r $(CLASSDESTDIR)/sun/nio/ch
diff -r 38e2f5918816 -r 4497f458e8c1 make/javax/crypto/Makefile
--- a/make/javax/crypto/Makefile	Tue Jul 07 16:11:07 2015 +0100
+++ b/make/javax/crypto/Makefile	Wed Jul 08 13:17:27 2015 +0100
@@ -274,23 +274,25 @@
 	    policy/unlimited/default_US_export.policy			\
 	    $(TEMPDIR_UNLIMITED)/META-INF/MANIFEST.MF
 	$(prep-target)
-	$(CP) policy/unlimited/default_US_export.policy			\
+	$(CP) -p policy/unlimited/default_US_export.policy		\
 	    $(TEMPDIR_UNLIMITED)
 	$(TOUCH) -r $(TEMPDIR_UNLIMITED)/META-INF			\
 	    $(TEMPDIR_UNLIMITED)/default_US_export.policy
 	( $(CD) $(TEMPDIR_UNLIMITED) && $(ZIPEXE) -Xr $@ META-INF	\
 	    default_US_export.policy )
+	$(TOUCH) -r $(TEMPDIR_UNLIMITED)/META-INF $@
 
 $(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar:			\
 	    policy/unlimited/default_local.policy			\
 	    $(TEMPDIR_UNLIMITED)/META-INF/MANIFEST.MF
 	$(prep-target)
-	$(CP) policy/unlimited/default_local.policy			\
+	$(CP) -p policy/unlimited/default_local.policy			\
 	    $(TEMPDIR_UNLIMITED)
 	$(TOUCH) -r $(TEMPDIR_UNLIMITED)/META-INF			\
 	    $(TEMPDIR_UNLIMITED)/default_local.policy
 	( $(CD) $(TEMPDIR_UNLIMITED) && $(ZIPEXE) -Xr $@ META-INF	\
 	    default_local.policy )
+	$(TOUCH) -r $(TEMPDIR_UNLIMITED)/META-INF $@
 
 $(TEMPDIR_UNLIMITED)/META-INF/MANIFEST.MF:				\
 	    policy/unlimited/UNLIMITED
@@ -300,7 +302,7 @@
 	    $(TEMPDIR_UNLIMITED)/META-INF/MANIFEST.MF
 	$(CAT) policy/unlimited/UNLIMITED >> 				\
 	    $(TEMPDIR_UNLIMITED)/META-INF/MANIFEST.MF
-	$(TOUCH) -t 198001010000 $(TEMPDIR_UNLIMITED)/META-INF
+	$(TOUCH) -t 200712010000 $(TEMPDIR_UNLIMITED)/META-INF
 	$(TOUCH) -r $(TEMPDIR_UNLIMITED)/META-INF			\
 	    $(TEMPDIR_UNLIMITED)/META-INF/MANIFEST.MF
 
@@ -316,16 +318,17 @@
 
 $(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar:		\
 	    $(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar
-	$(install-file)
+	$(prep-target)
+	$(CP) -p $< $@
 
 $(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar:			\
 	    policy/limited/default_local.policy				\
 	    policy/limited/exempt_local.policy				\
 	    $(TEMPDIR_LIMITED)/META-INF/MANIFEST.MF
 	$(prep-target)
-	$(CP) policy/limited/default_local.policy			\
+	$(CP) -p policy/limited/default_local.policy			\
 	    $(TEMPDIR_LIMITED)
-	$(CP) policy/limited/exempt_local.policy			\
+	$(CP) -p policy/limited/exempt_local.policy			\
 	    $(TEMPDIR_LIMITED)
 	$(TOUCH) -r $(TEMPDIR_LIMITED)/META-INF				\
 	    $(TEMPDIR_LIMITED)/default_local.policy
@@ -333,6 +336,7 @@
 	    $(TEMPDIR_LIMITED)/exempt_local.policy
 	( $(CD) $(TEMPDIR_UNLIMITED) && $(ZIPEXE) -Xr $@ META-INF	\
 	    default_local.policy exempt_local.policy )
+	$(TOUCH) -r $(TEMPDIR_UNLIMITED)/META-INF $@
 
 $(TEMPDIR_LIMITED)/META-INF/MANIFEST.MF:				\
 	    policy/limited/LIMITED
@@ -342,9 +346,10 @@
 	    $(TEMPDIR_LIMITED)/META-INF/MANIFEST.MF
 	$(CAT) policy/limited/LIMITED >> 				\
 	    $(TEMPDIR_LIMITED)/META-INF/MANIFEST.MF
-	$(TOUCH) -t 198001010000 $(TEMPDIR_LIMITED)/META-INF
+	$(TOUCH) -t 200712010000 $(TEMPDIR_LIMITED)/META-INF
 	$(TOUCH) -r $(TEMPDIR_LIMITED)/META-INF 			\
 	    $(TEMPDIR_LIMITED)/META-INF/MANIFEST.MF
+	$(TOUCH) -r $(TEMPDIR_UNLIMITED)/META-INF $@
 
 UNSIGNED_POLICY_FILES = \
     $(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar		\
@@ -470,7 +475,7 @@
 	$(RM) \
 	    $(POLICY_DESTDIR)/US_export_policy.jar		\
 	    $(POLICY_DESTDIR)/local_policy.jar
-	$(CP) $^ $(POLICY_DESTDIR)
+	$(CP) -p $^ $(POLICY_DESTDIR)
 
 install-limited: install-limited-jars
 ifndef OPENJDK
@@ -484,7 +489,7 @@
 	$(RM) \
 	    $(POLICY_DESTDIR)/US_export_policy.jar		\
 	    $(POLICY_DESTDIR)/local_policy.jar
-	$(CP) $^ $(POLICY_DESTDIR)
+	$(CP) -p $^ $(POLICY_DESTDIR)
 
 install-unlimited: install-unlimited-jars
 ifndef OPENJDK
diff -r 38e2f5918816 -r 4497f458e8c1 make/jdk_generic_profile.sh
--- a/make/jdk_generic_profile.sh	Tue Jul 07 16:11:07 2015 +0100
+++ b/make/jdk_generic_profile.sh	Wed Jul 08 13:17:27 2015 +0100
@@ -608,6 +608,15 @@
 echo "Using GOBJECT_CFLAGS=${GOBJECT_CFLAGS}"
 echo "Using GOBJECT_LIBS=${GOBJECT_LIBS}"
 
+# Export variables for system sctp
+# SCTP_CFLAGS and SCTP_LIBS tell the compiler how to compile and
+# link against libsctp
+if [ "${SCTP_LIBS}" = "" ] ; then
+    SCTP_LIBS="-lsctp"
+fi
+export SCTP_LIBS
+echo "Using SCTP_LIBS=${SCTP_LIBS}"
+
 # Setup nss.cfg using location of NSS libraries
 if [ -x "${pkgconfig}" ] ; then
   if [ "${NSS_LIBDIR}" = "" ] ; then
@@ -632,7 +641,8 @@
 export SYSTEM_KRB5=true
 export SYSTEM_CUPS=true
 export SYSTEM_FONTCONFIG=true
-export SYSTEM_PCSC=false
+export SYSTEM_PCSC=true
+export SYSTEM_SCTP=true
 export COMPILE_AGAINST_SYSCALLS=true
 
 if [ "x${GTK_LIBS}" != "x" ] ; then
@@ -655,7 +665,7 @@
 
 # IcedTea versioning
 export ICEDTEA_NAME="IcedTea"
-export PACKAGE_VERSION="2.6.0pre23"
+export PACKAGE_VERSION="2.6.0pre24"
 export DERIVATIVE_ID="${ICEDTEA_NAME} ${PACKAGE_VERSION}"
 echo "Building ${DERIVATIVE_ID}"
 
diff -r 38e2f5918816 -r 4497f458e8c1 src/share/classes/com/sun/jndi/ldap/LdapURL.java
--- a/src/share/classes/com/sun/jndi/ldap/LdapURL.java	Tue Jul 07 16:11:07 2015 +0100
+++ b/src/share/classes/com/sun/jndi/ldap/LdapURL.java	Wed Jul 08 13:17:27 2015 +0100
@@ -26,9 +26,6 @@
 package com.sun.jndi.ldap;
 
 import javax.naming.*;
-import javax.naming.directory.*;
-import javax.naming.spi.*;
-import java.net.URL;
 import java.net.MalformedURLException;
 import java.io.UnsupportedEncodingException;
 import java.util.StringTokenizer;
@@ -211,43 +208,52 @@
 
         // query begins with a '?' or is null
 
-        if (query == null) {
+        if (query == null || query.length() < 2) {
             return;
         }
 
-        int qmark2 = query.indexOf('?', 1);
+        int currentIndex = 1;
+        int nextQmark;
+        int endIndex;
 
-        if (qmark2 < 0) {
-            attributes = query.substring(1);
+        // attributes:
+        nextQmark = query.indexOf('?', currentIndex);
+        endIndex = nextQmark == -1 ? query.length() : nextQmark;
+        if (endIndex - currentIndex > 0) {
+            attributes = query.substring(currentIndex, endIndex);
+        }
+        currentIndex = endIndex + 1;
+        if (currentIndex >= query.length()) {
             return;
-        } else if (qmark2 != 1) {
-            attributes = query.substring(1, qmark2);
         }
 
-        int qmark3 = query.indexOf('?', qmark2 + 1);
-
-        if (qmark3 < 0) {
-            scope = query.substring(qmark2 + 1);
+        // scope:
+        nextQmark = query.indexOf('?', currentIndex);
+        endIndex = nextQmark == -1 ? query.length() : nextQmark;
+        if (endIndex - currentIndex > 0) {
+            scope = query.substring(currentIndex, endIndex);
+        }
+        currentIndex = endIndex + 1;
+        if (currentIndex >= query.length()) {
             return;
-        } else if (qmark3 != qmark2 + 1) {
-            scope = query.substring(qmark2 + 1, qmark3);
         }
 
-        int qmark4 = query.indexOf('?', qmark3 + 1);
+        // filter:
+        nextQmark = query.indexOf('?', currentIndex);
+        endIndex = nextQmark == -1 ? query.length() : nextQmark;
+        if (endIndex - currentIndex > 0) {
+            filter = query.substring(currentIndex, endIndex);
+            filter = UrlUtil.decode(filter, "UTF8");
+        }
+        currentIndex = endIndex + 1;
+        if (currentIndex >= query.length()) {
+            return;
+        }
 
-        if (qmark4 < 0) {
-            filter = query.substring(qmark3 + 1);
-        } else {
-            if (qmark4 != qmark3 + 1) {
-                filter = query.substring(qmark3 + 1, qmark4);
-            }
-            extensions = query.substring(qmark4 + 1);
-            if (extensions.length() > 0) {
-                extensions = UrlUtil.decode(extensions, "UTF8");
-            }
-        }
-        if (filter != null && filter.length() > 0) {
-            filter = UrlUtil.decode(filter, "UTF8");
+        // extensions:
+        if (query.length() - currentIndex > 0) {
+            extensions = query.substring(currentIndex);
+            extensions = UrlUtil.decode(extensions, "UTF8");
         }
     }
 
diff -r 38e2f5918816 -r 4497f458e8c1 src/solaris/classes/sun/nio/ch/SctpChannelImpl.java
--- a/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java	Tue Jul 07 16:11:07 2015 +0100
+++ b/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java	Wed Jul 08 13:17:27 2015 +0100
@@ -1105,7 +1105,7 @@
     static {
         Util.load();   /* loads nio & net native libraries */
         java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("sctp"));
+                new sun.security.action.LoadLibraryAction("javasctp"));
         initIDs();
     }
 }
diff -r 38e2f5918816 -r 4497f458e8c1 src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java
--- a/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java	Tue Jul 07 16:11:07 2015 +0100
+++ b/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java	Wed Jul 08 13:17:27 2015 +0100
@@ -988,6 +988,6 @@
     static {
         Util.load();   /* loads nio & net native libraries */
         java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("sctp"));
+                new sun.security.action.LoadLibraryAction("javasctp"));
     }
 }
diff -r 38e2f5918816 -r 4497f458e8c1 src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java
--- a/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java	Tue Jul 07 16:11:07 2015 +0100
+++ b/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java	Wed Jul 08 13:17:27 2015 +0100
@@ -418,7 +418,7 @@
     static {
         Util.load();   // loads nio & net native libraries
         java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("sctp"));
+                new sun.security.action.LoadLibraryAction("javasctp"));
         initIDs();
     }
 }
diff -r 38e2f5918816 -r 4497f458e8c1 src/solaris/classes/sun/security/smartcardio/PlatformPCSC.java
--- a/src/solaris/classes/sun/security/smartcardio/PlatformPCSC.java	Tue Jul 07 16:11:07 2015 +0100
+++ b/src/solaris/classes/sun/security/smartcardio/PlatformPCSC.java	Wed Jul 08 13:17:27 2015 +0100
@@ -50,6 +50,10 @@
 
     private final static String LIB1 = "/usr/$LIBISA/libpcsclite.so.1";
     private final static String LIB2 = "/usr/local/$LIBISA/libpcsclite.so.1";
+    private final static String LIB3 = "/usr/lib/$ARCH-linux-gnu/libpcsclite.so.1";
+    private final static String LIB4 = "/usr/lib/arm-linux-gnueabi/libpcsclite.so.1";
+    private final static String LIB5 = "/usr/lib/arm-linux-gnueabihf/libpcsclite.so.1";
+    private final static String LIB6 = "/usr/lib/$ARCH-kfreebsd-gnu/libpcsclite.so.1";
     private final static String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC";
 
     PlatformPCSC() {
@@ -76,26 +80,55 @@
 
     // expand $LIBISA to the system specific directory name for libraries
     private static String expand(String lib) {
+        String s1, s2;
         int k = lib.indexOf("$LIBISA");
-        if (k == -1) {
-            return lib;
+        if (k != -1) {
+            String libDir;
+            if ("64".equals(System.getProperty("sun.arch.data.model"))) {
+                if ("SunOS".equals(System.getProperty("os.name"))) {
+                    libDir = "lib/64";
+                } else {
+                    // assume Linux convention
+                    libDir = "lib64";
+                }
+            } else {
+                // must be 32-bit
+                libDir = "lib";
+            }
+            lib = replace(k, lib, "$LIBISA", libDir);
         }
-        String s1 = lib.substring(0, k);
-        String s2 = lib.substring(k + 7);
-        String libDir;
-        if ("64".equals(System.getProperty("sun.arch.data.model"))) {
-            if ("SunOS".equals(System.getProperty("os.name"))) {
-                libDir = "lib/64";
-            } else {
-                // assume Linux convention
-                libDir = "lib64";
+
+        k = lib.indexOf("$ARCH");
+        if (k != -1) {
+            String arch = System.getProperty("os.arch");
+            switch (arch) {
+            case "amd64":
+                arch = "x86_64";
+                break;
+            case "ppc":
+                arch = "powerpc";
+                break;
+            case "ppc64":
+                arch = "powerpc64";
+                break;
+            case "ppc64le":
+                arch = "powerpc64le";
+                break;
             }
-        } else {
-            // must be 32-bit
-            libDir = "lib";
+            lib = replace(k, lib, "$ARCH", arch);
         }
-        String s = s1 + libDir + s2;
-        return s;
+
+        return lib;
+    }
+
+    private static String replace(int k, String text,
+                                  String template, String replacement) {
+        String s1, s2;
+
+        s1 = text.substring(0, k);
+        s2 = text.substring(k + template.length());
+
+        return s1 + replacement + s2;
     }
 
     private static String getLibraryName() throws IOException {
@@ -114,6 +147,26 @@
             // if LIB2 exists, use that
             return lib;
         }
+        lib = expand(LIB3);
+        if (new File(lib).isFile()) {
+            // if LIB3 exists, use that
+            return lib;
+        }
+        lib = LIB4; // Debian armel special case
+        if (new File(lib).isFile()) {
+            // if LIB4 exists, use that
+            return lib;
+        }
+        lib = LIB5; // Debian armhf special case
+        if (new File(lib).isFile()) {
+            // if LIB5 exists, use that
+            return lib;
+        }
+        lib = expand(LIB6);
+        if (new File(lib).isFile()) {
+            // if LIB6 exists, use that
+            return lib;
+        }
         lib = PCSC_FRAMEWORK;
         if (new File(lib).isFile()) {
             // if PCSC.framework exists, use that
diff -r 38e2f5918816 -r 4497f458e8c1 src/solaris/native/java/util/TimeZone_md.c
--- a/src/solaris/native/java/util/TimeZone_md.c	Tue Jul 07 16:11:07 2015 +0100
+++ b/src/solaris/native/java/util/TimeZone_md.c	Wed Jul 08 13:17:27 2015 +0100
@@ -53,7 +53,6 @@
 
 
 static const char *ETC_TIMEZONE_FILE = "/etc/timezone";
-static const char *REDHAT_RELEASE_FILE = "/etc/redhat-release";
 static const char *SYSCONFIG_CLOCK_FILE = "/etc/sysconfig/clock";
 static const char *ZONEINFO_DIR = "/usr/share/zoneinfo";
 static const char *DEFAULT_ZONEINFO_FILE = "/etc/localtime";
@@ -259,55 +258,50 @@
     /*
      * Next, try the ZONE entry in /etc/sysconfig/clock.
      */
-    if ((fp = fopen(REDHAT_RELEASE_FILE, "r")) != NULL) {
-	char id[7];
-
-	/* Avoid this file on Fedora as may be buggy; RH489586 */
-	if (fgets(id, sizeof (id), fp) != NULL && 
-	  strncmp(id, "Fedora", 6) != 0) {
-	    (void) fclose(fp);
-	    if ((fp = fopen(SYSCONFIG_CLOCK_FILE, "r")) != NULL) {
-		char line[256];
-		
-		while (fgets(line, sizeof(line), fp) != NULL) {
-		    char *p = line;
-		    char *s;
-		    
-		    SKIP_SPACE(p);
-		    if (*p != 'Z') {
-			continue;
-		    }
-		    if (strncmp(p, "ZONE=\"", 6) == 0) {
-			p += 6;
-		    } else {
-			/*
-			 * In case we need to parse it token by token.
-			 */
-			if (strncmp(p, "ZONE", 4) != 0) {
-			    continue;
-			}
-			p += 4;
-			SKIP_SPACE(p);
-			if (*p++ != '=') {
-			    break;
-			}
-			SKIP_SPACE(p);
-			if (*p++ != '"') {
-			    break;
-			}
-		    }
-		    for (s = p; *s && *s != '"'; s++)
-			;
-		    if (*s != '"') {
-			/* this ZONE entry is broken. */
-			break;
-		    }
-		    *s = '\0';
-		    tz = strdup(p);
-		    break; 
+    if ((fp = fopen(SYSCONFIG_CLOCK_FILE, "r")) != NULL) {
+	char line[256];
+	
+	while (fgets(line, sizeof(line), fp) != NULL) {
+	    char *p = line;
+	    char *s;
+	    
+	    SKIP_SPACE(p);
+	    if (*p != 'Z') {
+		continue;
+	    }
+	    if (strncmp(p, "ZONE=\"", 6) == 0) {
+		p += 6;
+	    } else {
+		/*
+		 * In case we need to parse it token by token.
+		 */
+		if (strncmp(p, "ZONE", 4) != 0) {
+		    continue;


More information about the distro-pkg-dev mailing list