Create an invalid tzdata.conf, such as wrong TzdataVersion
bash-2.05# $JAVA_HOME/bin/jar xvf tzupdater.jar data/tzdata.conf
inflated: data/tzdata.conf
bash-2.05#
bash-2.05# cat data/tzdata.conf
Sun Microsystems Inc\. 1\.4(\.[012](_\d\d[a-z]?)?)?|1\.5(\.0(_0[0-3][a-z]?)?)? tzdata2007i /data/tzdata2007i.oldformat
Sun Microsystems Inc\. .+ tzdata2007i /data/tzdata2007i
The only values which were changed are:
tzdata2007e from tzdata2007i and /data/tzdata2007e from /data/tzdata2007i.
bash-2.05# cat data/tzdata.conf
Sun Microsystems Inc\. 1\.4(\.[012](_\d\d[a-z]?)?)?|1\.5(\.0(_0[0-3][a-z]?)?)? tzdata2007e /data/tzdata2007i.oldformat
Sun Microsystems Inc\. .+ tzdata2007e /data/tzdata2007e
bash-2.05#
bash-2.05# $JAVA_HOME/bin/jar uvf tzupdater.jar data/tzdata.conf
adding: data/tzdata.conf(in = 175) (out= 108)(deflated 38%)
bash-2.05# $JAVA_HOME/bin/java -jar tzupdater.jar -V
tzupdater version 1.3.1-b01
JRE time zone data version: tzdata2003d
Embedded time zone data version: tzdata2007e
bash-2.05#
bash-2.05#
bash-2.05# $JAVA_HOME/bin/java -jar tzupdater.jar -u -v
java.home: /usr/jdk/instances/jdk1.5.0/jre
java.vendor: Sun Microsystems Inc.
java.version: 1.5.0_03
JRE time zone data version: tzdata2003d
Embedded time zone data version: tzdata2007e
Extracting files... done.
Renaming directories... done.
Validating the new time zone data... Extracting files... Creating: /usr/jdk/instances/jdk1.5.0/jre/lib/tz.tmp/: /pkg_resolve.sh
done.
Updating package SUNWj5rt with timezone base directory /usr/jdk/instances/jdk1.5.0/jre/lib/zi
(update time is variable, but can take several minutes)
Removing previous package entries...
Installing new package entries...
Completed resolving Solaris package information.
done.
Time zone data update is complete.
bash-2.05#
bash-2.05#
bash-2.05# $JAVA_HOME/bin/java -jar tzupdater.jar -V
tzupdater version 1.3.1-b01
JRE time zone data version: tzdata2007i
Embedded time zone data version: tzdata2007e
bash-2.05#
When -u -v or -f -v option is used the jdk is updated with the misconfigured tzdata.conf. A TzupdaterException should have been thrown.
bash-2.05# $JAVA_HOME/bin/jar xvf tzupdater.jar data/tzdata.conf
inflated: data/tzdata.conf
bash-2.05#
bash-2.05# cat data/tzdata.conf
Sun Microsystems Inc\. 1\.4(\.[012](_\d\d[a-z]?)?)?|1\.5(\.0(_0[0-3][a-z]?)?)? tzdata2007i /data/tzdata2007i.oldformat
Sun Microsystems Inc\. .+ tzdata2007i /data/tzdata2007i
The only values which were changed are:
tzdata2007e from tzdata2007i and /data/tzdata2007e from /data/tzdata2007i.
bash-2.05# cat data/tzdata.conf
Sun Microsystems Inc\. 1\.4(\.[012](_\d\d[a-z]?)?)?|1\.5(\.0(_0[0-3][a-z]?)?)? tzdata2007e /data/tzdata2007i.oldformat
Sun Microsystems Inc\. .+ tzdata2007e /data/tzdata2007e
bash-2.05#
bash-2.05# $JAVA_HOME/bin/jar uvf tzupdater.jar data/tzdata.conf
adding: data/tzdata.conf(in = 175) (out= 108)(deflated 38%)
bash-2.05# $JAVA_HOME/bin/java -jar tzupdater.jar -V
tzupdater version 1.3.1-b01
JRE time zone data version: tzdata2003d
Embedded time zone data version: tzdata2007e
bash-2.05#
bash-2.05#
bash-2.05# $JAVA_HOME/bin/java -jar tzupdater.jar -u -v
java.home: /usr/jdk/instances/jdk1.5.0/jre
java.vendor: Sun Microsystems Inc.
java.version: 1.5.0_03
JRE time zone data version: tzdata2003d
Embedded time zone data version: tzdata2007e
Extracting files... done.
Renaming directories... done.
Validating the new time zone data... Extracting files... Creating: /usr/jdk/instances/jdk1.5.0/jre/lib/tz.tmp/: /pkg_resolve.sh
done.
Updating package SUNWj5rt with timezone base directory /usr/jdk/instances/jdk1.5.0/jre/lib/zi
(update time is variable, but can take several minutes)
Removing previous package entries...
Installing new package entries...
Completed resolving Solaris package information.
done.
Time zone data update is complete.
bash-2.05#
bash-2.05#
bash-2.05# $JAVA_HOME/bin/java -jar tzupdater.jar -V
tzupdater version 1.3.1-b01
JRE time zone data version: tzdata2007i
Embedded time zone data version: tzdata2007e
bash-2.05#
When -u -v or -f -v option is used the jdk is updated with the misconfigured tzdata.conf. A TzupdaterException should have been thrown.