Dominique Leuenberger 2017-05-31 11:29:37 +00:00 committed by Git OBS Bridge
commit 33928772f6
14 changed files with 910 additions and 2076 deletions

26
compile-jdk7.patch Normal file

@ -0,0 +1,26 @@
Index: mysql-connector-java-5.1.42/build.xml
===================================================================
--- mysql-connector-java-5.1.42.orig/build.xml
+++ mysql-connector-java-5.1.42/build.xml
@@ -911,8 +911,8 @@ Java 8 (for JDBC 4+ implementation) is a
executable="${com.mysql.jdbc.jdk8.javac}"
compiler="modern"
includeantruntime="false"
- source="1.8"
- target="1.8">
+ source="1.6"
+ target="1.6">
<include name="**/JDBC42*.java" />
<classpath refid="project.build.classpath" />
<compilerarg line="${javac.compilerarg}" />
@@ -970,8 +970,8 @@ Java 8 (for JDBC 4+ implementation) is a
executable="${com.mysql.jdbc.jdk8.javac}"
compiler="modern"
includeantruntime="false"
- source="1.8"
- target="1.8">
+ source="1.6"
+ target="1.6">
<include name="testsuite/**/jdbc42/**" />
<classpath refid="project.build.classpath" />
<compilerarg line="${javac.compilerarg}" />

19
disable-testsuite.patch Normal file

@ -0,0 +1,19 @@
From: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Date: Thu, 25 Aug 2011 10:44:00 +0200
Subject: [PATCH] disable testsuite
---
build.xml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
--- a/build.xml
+++ b/build.xml
@@ -835,7 +835,7 @@
<!-- Compile the driver including JDBC 3 and JDBC 4+ implementations, JUnit test suite and 'helpers' for third-party software. -->
<target name="compile"
description="Compiles driver including JDBC 3 and JDBC 4+ implementations, JUnit test suite and integration 'helpers' for third-party software."
- depends="init, compile-driver, compile-testsuite, compile-integration" />
+ depends="init, compile-driver, compile-integration" />
<!-- Compile the driver including JDBC 3 and JDBC 4+ implementations only. -->

@ -1,66 +0,0 @@
Index: mysql-connector-java-5.1.35/build.xml
===================================================================
--- mysql-connector-java-5.1.35.orig/build.xml
+++ mysql-connector-java-5.1.35/build.xml
@@ -449,7 +449,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Add commercial license configuration class (Build). -->
- <target name="-init-filter-license" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.filterLicense">
+ <target name="-init-filter-license" depends="-init-copy" if="com.mysql.jdbc.filterLicense">
<copy file="${com.mysql.jdbc.extra.libs}/CommercialLicenseConfiguration.notjava"
toFile="${buildDir}/${fullProdName}/com/mysql/jdbc/LicenseConfiguration.java"
overwrite="true" />
@@ -457,7 +457,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Add no-crypto export control class (Build). -->
- <target name="-init-no-crypto" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.noCryptoBuild">
+ <target name="-init-no-crypto" depends="-init-copy" if="com.mysql.jdbc.noCryptoBuild">
<copy file="${com.mysql.jdbc.extra.libs}/ExportControlledNoCrypto.notjava"
toFile="${buildDir}/${fullProdName}/com/mysql/jdbc/ExportControlled.java"
overwrite="true" />
@@ -465,7 +465,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Copy commercial license configuration class (Package). -->
- <target name="-copy-filter-license" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.filterLicense">
+ <target name="-copy-filter-license" depends="-init-copy" if="com.mysql.jdbc.filterLicense">
<copy file="${com.mysql.jdbc.extra.libs}/CommercialLicenseConfiguration.notjava"
toFile="${packageDest}/src/com/mysql/jdbc/LicenseConfiguration.java"
overwrite="true" />
@@ -473,7 +473,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Copy no-crypto export control class (Package). -->
- <target name="-copy-no-crypto" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.noCryptoBuild">
+ <target name="-copy-no-crypto" depends="-init-copy" if="com.mysql.jdbc.noCryptoBuild">
<copy file="${com.mysql.jdbc.extra.libs}/ExportControlledNoCrypto.notjava"
toFile="${packageDest}/src/com/mysql/jdbc/ExportControlled.java"
overwrite="true" />
@@ -481,7 +481,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Copy README-commercial info (Package). -->
- <target name="-copy-license-commercial" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.commercialBuild">
+ <target name="-copy-license-commercial" depends="-init-copy" if="com.mysql.jdbc.commercialBuild">
<copy file="${com.mysql.jdbc.extra.libs}/README-commercial" tofile="${packageDest}/README.txt" filtering="true">
<filterset refid="versionFilterset" />
<filterset refid="licenseFilterset" />
@@ -500,7 +500,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Copy LICENCE.mysql and replace license commercial headers (Package). -->
- <target name="-replace-license-commercial" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.commercialBuild">
+ <target name="-replace-license-commercial" depends="-init-copy" if="com.mysql.jdbc.commercialBuild">
<delete file="${packageDest}/COPYING" />
<copy file="${com.mysql.jdbc.extra.libs}/LICENSE.mysql" toDir="${packageDest}" />
@@ -773,6 +773,7 @@ Java 6 (for JDBC4+ implementation) is al
compiler="modern"
includeantruntime="false">
<include name="**/*.java" />
+ <exclude name="demo/**" />
<exclude name="testsuite/**" />
<exclude name="com/mysql/jdbc/integration/**" />
<exclude name="com/mysql/jdbc/log/Log4JLogger.java" />

32
hibernate-check.patch Normal file

@ -0,0 +1,32 @@
Description: Do not compile MultiTenantConnectionProvider since it requires Hibernate 4 which isn't in Debian yet
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/build.xml
+++ b/build.xml
@@ -244,6 +244,7 @@
</not>
</condition>
</fail>
+<!--
<fail message="Hibernate libraries, required for build tasks, must be in the directory '${com.mysql.jdbc.extra.libs}/hibernate4'.">
<condition>
<not>
@@ -251,6 +252,7 @@
</not>
</condition>
</fail>
+-->
</target>
@@ -889,8 +891,10 @@
bootclasspath="${com.mysql.jdbc.jre6.rtjar}"
source="1.6"
target="1.6">
+<!--
<include name="**/FabricMultiTenantConnectionProvider.java" />
<include name="**/HibernateFabric.java" />
+-->
<include name="**/JDBC4*.java" />
<exclude name="**/JDBC42*.java" />
<include name="com/mysql/jdbc/exceptions/jdbc4/*" />

14
javac-check.patch Normal file

@ -0,0 +1,14 @@
Description: Disable the JDK check
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/build.xml
+++ b/build.xml
@@ -415,7 +415,7 @@
<!-- Prepares files and settings for compiling driver. -->
- <target name="init" depends="-compiler-check, -init-copy, -init-filter-license, -init-no-crypto">
+ <target name="init" depends="-init-copy, -init-filter-license, -init-no-crypto">
<!-- The following is needed for source distributions as the classpath can't be dynamically altered, and not having this directory present causes the
build to fail. -->
<available file="${com.mysql.jdbc.docs.sourceDir}" property="com.mysql.jdbc.docs.sourcesPresent" />

@ -1,16 +0,0 @@
Index: mysql-connector-java-5.1.35/build.xml
===================================================================
--- mysql-connector-java-5.1.35.orig/build.xml
+++ mysql-connector-java-5.1.35/build.xml
@@ -267,10 +267,7 @@ Java 6 (for JDBC4+ implementation) is al
<fail message="Java 6 (for JDBC4+ implementation) is required. Set the full path to this JDK home with the property 'com.mysql.jdbc.jdk6'. Default: '/usr/lib/jvm/jdk1.6'.">
<condition>
<not>
- <and>
- <equals arg1="${jdk6checkexitstatus}" arg2="0" />
- <contains string="${com.mysql.jdbc.jdk6.version}" substring="java version &quot;1.6" casesensitive="true" />
- </and>
+ <equals arg1="${jdk6checkexitstatus}" arg2="0" />
</not>
</condition>
</fail>

@ -1,49 +0,0 @@
--- mysql-connector-java-5.1.35.orig/src/com/mysql/jdbc/ResultSetImpl.java
+++ mysql-connector-java-5.1.35/src/com/mysql/jdbc/ResultSetImpl.java
@@ -3436,27 +3436,26 @@ public class ResultSetImpl implements Re
byte[] data = getBytes(columnIndex);
Object obj = data;
- if ((data != null) && (data.length >= 2)) {
- if ((data[0] == -84) && (data[1] == -19)) {
- // Serialized object?
- try {
- ByteArrayInputStream bytesIn = new ByteArrayInputStream(data);
- ObjectInputStream objIn = new ObjectInputStream(bytesIn);
- obj = objIn.readObject();
- objIn.close();
- bytesIn.close();
- } catch (ClassNotFoundException cnfe) {
- throw SQLError.createSQLException(
- Messages.getString("ResultSet.Class_not_found___91") + cnfe.toString()
- + Messages.getString("ResultSet._while_reading_serialized_object_92"), getExceptionInterceptor());
- } catch (IOException ex) {
- obj = data; // not serialized?
+ if (this.connection.getAutoDeserialize()) {
+ if ((data != null) && (data.length >= 2)) {
+ if ((data[0] == -84) && (data[1] == -19)) {
+ // Serialized object?
+ try {
+ ByteArrayInputStream bytesIn = new ByteArrayInputStream(data);
+ ObjectInputStream objIn = new ObjectInputStream(bytesIn);
+ obj = objIn.readObject();
+ objIn.close();
+ bytesIn.close();
+ } catch (ClassNotFoundException cnfe) {
+ throw SQLError.createSQLException(Messages.getString("ResultSet.Class_not_found___91") + cnfe.toString()
+ + Messages.getString("ResultSet._while_reading_serialized_object_92"), getExceptionInterceptor());
+ } catch (IOException ex) {
+ obj = data; // not serialized?
+ }
}
- }
-
- return obj.toString();
- }
-
+ return obj.toString();
+ }
+ }
return extractStringFromNativeColumn(columnIndex, mysqlType);
}

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c2e0805b8e40d6b09b5dccfaf0f071d6e35470d7c392d019feddf885c1fe5d0
size 1432996

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d0b150764cedb1e2f5b1ee82705e17f52e343cbbe1c9499859ed3c06ed9ab4a9
size 1395624

File diff suppressed because it is too large Load Diff

@ -1,3 +1,42 @@
-------------------------------------------------------------------
Fri May 19 11:34:06 UTC 2017 - dziolkowski@suse.com
- New build dependency: javapackages-local
- cleaned spec using spec-cleaner
-------------------------------------------------------------------
Thu May 18 12:40:03 UTC 2017 - tchvatal@suse.com
- Hardcode requirement for java 1.8 or newer to build
-------------------------------------------------------------------
Thu May 18 11:55:03 UTC 2017 - tchvatal@suse.com
- Drop patch use-classpath-in-tests.patch
- Add patch disabling testsuite:
* disable-testsuite.patch
- Drop patch extra-libs-build.patch:
* Rather use the thing to propagate some wrongly found libs
- Drop patch no-jdk5-requirement.patch:
* Simply override the value in ant command
- Add patch hibernate-check.patch to remove hibernate check
- Add patch compile-jdk7.patch to compile with old JDK versions
-------------------------------------------------------------------
Thu May 18 10:42:07 UTC 2017 - tchvatal@suse.com
- Version update to 5.1.42 bsc#1035210 bsc#1035697 bsc#1035211:
* CVE-2017-3589 CVE-2017-3523 CVE-2017-3586
* http://dev.mysql.com/doc/relnotes/connector-j/en/news-5-1.html
- Remove upstreamed mysql-connector-java-5.1.35-CVE-2017-3523.patch
- Refresh patch extra-libs-build.patch
- Drop obsolete patch jdk6-check-use-jdk7.patch
- Refresh patch no-jdk5-requirement.patch
- Attempt to refresh mysql-connector-java-jdbc-4.1.patch
* Partialy merged by upstream, many conflicts
- Add patch to relax compiler check:
* javac-check.patch
-------------------------------------------------------------------
Tue May 2 15:20:16 UTC 2017 - pmonrealgonzalez@suse.com

@ -17,7 +17,7 @@
Name: mysql-connector-java
Version: 5.1.35
Version: 5.1.42
Release: 0
Summary: Official JDBC Driver for MySQL
License: GPL-2.0+
@ -27,24 +27,17 @@ Source0: %{name}-%{version}-suse.tar.xz
# Script to repack upstream tarball
# ./generate-tarball.sh VERSION
Source99: generate-tarball.sh
# PATCH-FIX-UPSTREAM: do not strictly require jdk6 to compile
Patch0: jdk6-check-use-jdk7.patch
# PATCH-FIX-UPSTREAM: do not require hibernate4 to actually just build
Patch1: extra-libs-build.patch
# PATCH-FIX-SUSE: do not build jdbc3 driver needing too old java
Patch2: no-jdk5-requirement.patch
# PATCH-FIX-UPSTREAM: build with jdbc4.1 and also with new javac
Patch3: mysql-connector-java-jdbc-4.1.patch
# PATCH-FIX-UPSTREAM: do not lose classpath during tests build
Patch4: use-classpath-in-tests.patch
# PATCH_FIX-UPSTREAM: CVE-2017-3523 Oracle MySQL <=5.1.40 Connector/J
# Remote Code Execution Vulnerability
Patch5: mysql-connector-java-5.1.35-CVE-2017-3523.patch
Patch0: javac-check.patch
Patch1: hibernate-check.patch
Patch2: mysql-connector-java-jdbc-4.1.patch
Patch3: disable-testsuite.patch
Patch4: compile-jdk7.patch
BuildRequires: ant
BuildRequires: ant-contrib
BuildRequires: apache-commons-logging
BuildRequires: geronimo-jta-1_1-api
BuildRequires: java-devel >= 1.6.0
BuildRequires: java-devel >= 1.8.0
BuildRequires: javapackages-local
BuildRequires: javapackages-tools
BuildRequires: junit
BuildRequires: log4j-mini
@ -77,13 +70,18 @@ set that supports the capabilities of MySQL.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
# dup
rm -f README
# wrong end of line encoding
sed -i -e 's/.$//' README.txt
# extra libs
mkdir -p lib
mkdir -p src/lib
ln -f -s %{_datadir}/java/ant/ant-contrib.jar lib/ant-contrib.jar
ln -f -s %{_datadir}/java/slf4j/api.jar lib/slf4j-api.jar
%build
# disable jboss integration
rm -rf src/com/mysql/jdbc/integration/jboss
@ -104,17 +102,19 @@ export CLASSPATH=$(build-classpath \
junit \
log4j)
ant \
-Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \
-DbuildDir=build-mysql-jdbc \
-DdistDir=dist-mysql-jdbc \
-Dcom.mysql.jdbc.jdk6.javac="%{javac}" \
-Dcom.mysql.jdbc.jdk6.java="%{java}" \
-Dcom.mysql.jdbc.jdk5.javac=%javac \
-Dcom.mysql.jdbc.jdk8.javac=%javac \
-Dsnapshot.version= \
-Dcom.mysql.jdbc.extra.libs=lib \
-Dant.java.version=1.5 \
-Dant.build.javac.source=1.6 \
-Dant.build.javac.target=1.7 \
dist
%install
install -d -m 755 %{buildroot}%{_javadir}
install ./build-mysql-jdbc/%{name}-%{version}-SNAPSHOT/%{name}-%{version}-SNAPSHOT-bin.jar \
install ./build/%{name}-%{version}/%{name}-%{version}-bin.jar \
%{buildroot}%{_javadir}/%{name}.jar
rm -rf %{buildroot}%{name}-%{version}/docs/release-test-output
@ -130,7 +130,11 @@ sed -i 's/>@.*</>%{version}</' %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%defattr(0644,root,root,0755)
%doc CHANGES COPYING README.txt
%attr(0644,root,root) %{_javadir}/%{name}.jar
%if %{?suse_version} > 1320
%config(noreplace) %{_datadir}/maven-metadata/%{name}.xml*
%else
%config(noreplace) %{_mavendepmapfragdir}/*
%endif
%{_mavenpomdir}/*.pom
%changelog

@ -1,31 +0,0 @@
Index: mysql-connector-java-5.1.35/build.xml
===================================================================
--- mysql-connector-java-5.1.35.orig/build.xml
+++ mysql-connector-java-5.1.35/build.xml
@@ -219,7 +219,7 @@ com.mysql.jdbc.noCleanBetweenCompiles=ye
<!-- Check for required JDKs for compilation. -->
- <target name="-compiler-check" depends="-jdk5-check, -jdk6-check" />
+ <target name="-compiler-check" depends="-jdk6-check" />
<!-- Check for required JDK5 for compilation of JDBC3 implementation. -->
@@ -769,7 +769,7 @@ Java 6 (for JDBC4+ implementation) is al
deprecation="off"
debug="${debug.enable}"
fork="yes"
- executable="${com.mysql.jdbc.jdk5.javac}"
+ executable="${com.mysql.jdbc.jdk6.javac}"
compiler="modern"
includeantruntime="false">
<include name="**/*.java" />
@@ -820,7 +820,7 @@ Java 6 (for JDBC4+ implementation) is al
deprecation="off"
debug="${debug.enable}"
fork="yes"
- executable="${com.mysql.jdbc.jdk5.javac}"
+ executable="${com.mysql.jdbc.jdk6.javac}"
compiler="modern"
includeantruntime="false">
<include name="testsuite/**" />

@ -1,12 +0,0 @@
Index: mysql-connector-java-5.1.35/build.xml
===================================================================
--- mysql-connector-java-5.1.35.orig/build.xml
+++ mysql-connector-java-5.1.35/build.xml
@@ -191,6 +191,7 @@ com.mysql.jdbc.noCleanBetweenCompiles=ye
</fileset>
<pathelement location="${buildDir}/${fullProdName}" />
+ <pathelement path="${java.class.path}" />
</path>