[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#913360: libreoffice-base-drivers: please switch to libmariadb-java



Package: libreoffice-base-drivers
Version: 1:6.1.3-1
Severity: important
Tags: patch

Hello,

we would like to remove libmysql-java from Debian because it is
frequently affected by security vulnerabilities which are not fully
disclosed. This makes it hard to determine the impact of such a flaw.[1]
However we also have libmariadb-java which is a drop-in replacement
and upstream is more transparent about security issues.

Please find attached two patches that make the necessary changes to
the Debian packaging.

The 0001 patch can be applied for the Debian packaging. The 0002 patch must
be applied against the upstream sources. We have to replace the old
MySQL driver class with the new one from MariaDB. Except for that
libmariadb-java should just work.

[1] https://bugs.debian.org/912916

Regards,

Markus
>From 4fc33bd9b4969842bd092bbe62b4f119da749316 Mon Sep 17 00:00:00 2001
From: Markus Koschany <apo@debian.org>
Date: Fri, 9 Nov 2018 22:00:34 +0100
Subject: [PATCH] Switch from libmysql-java to libmariadb-java.

---
 control.in                          | 4 ++--
 libreoffice-base.bug-control        | 2 +-
 patches/jdbc-driver-classpaths.diff | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/control.in b/control.in
index a01b846b..3ee62c2c 100644
--- a/control.in
+++ b/control.in
@@ -581,7 +581,7 @@ Depends: libreoffice-core, ${shlibs:Depends}, ${misc:Depends}
 Architecture: %OOO_BASE_ARCHS%
 Section: database
 Suggests: libreoffice-sdbc-postgresql | odbc-postgresql | libpg-java,
-          libreoffice-mysql-connector | libmyodbc | libmysql-java,
+          libreoffice-mysql-connector | libmyodbc | libmariadb-java,
           libsqliteodbc | tdsodbc | mdbtools,
           libjtds-java,
 Recommends: libreoffice-sdbc-hsqldb [%OOO_JAVA_ARCHS%], ${base-firebird-recommends}
@@ -610,7 +610,7 @@ Description: Database connectivity drivers for LibreOffice
     - SQLite
     - MS SQL / Sybase SQL
     - *.mdb (JET / MS Access)
-  * libmysql-java | libpg-java | libjtds-java: JDBC Drivers
+  * libmariadb-java | libpg-java | libjtds-java: JDBC Drivers
     for:
     - MySQL
     - PostgreSQL
diff --git a/libreoffice-base.bug-control b/libreoffice-base.bug-control
index 67cfb8ba..26be7127 100644
--- a/libreoffice-base.bug-control
+++ b/libreoffice-base.bug-control
@@ -1,2 +1,2 @@
 report-with: libreoffice-core
-package-status: unixodbc libmyodbc odbc-postgresql libsqliteodbc tdsodbc mdbtools libmysql-java libpg-java libsapdbc-java
+package-status: unixodbc libmyodbc odbc-postgresql libsqliteodbc tdsodbc mdbtools libmariadb-java libpg-java libsapdbc-java
diff --git a/patches/jdbc-driver-classpaths.diff b/patches/jdbc-driver-classpaths.diff
index 1887772c..b3120667 100644
--- a/patches/jdbc-driver-classpaths.diff
+++ b/patches/jdbc-driver-classpaths.diff
@@ -8,9 +8,9 @@ index 9be30a2..59c87cb 100644
    </node>
 +  <node oor:name="JDBC">
 +    <node oor:name="DriverClassPaths">
-+      <node oor:name="com.mysql.jdbc.Driver" oor:op="replace">
++      <node oor:name="org.mariadb.jdbc.Driver" oor:op="replace">
 +        <prop oor:name="Path">
-+          <value>file:///usr/share/java/mysql.jar</value>
++          <value>file:///usr/share/java/mariadb-java-client.jar</value>
 +        </prop>
 +      </node>
 +      <node oor:name="org.postgresql.Driver" oor:op="replace">
-- 
2.19.1

>From 1172166889764ae0e77488e5d173f33961b9859b Mon Sep 17 00:00:00 2001
From: Markus Koschany <apo@debian.org>
Date: Fri, 9 Nov 2018 23:06:15 +0100
Subject: [PATCH] mariadb

---
 connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java | 4 ++--
 .../mysql/org/openoffice/Office/DataAccess/Drivers.xcu        | 2 +-
 connectivity/source/drivers/mysql/YDriver.cxx                 | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java b/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java
index a44f1b9d1..03a8293ef 100644
--- a/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java
+++ b/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java
@@ -59,7 +59,7 @@ public class JdbcLongVarCharTest extends ComplexTestCase
 
             String url = "jdbc:mysql://localhost:3306/mysql?user=root";
             com.sun.star.beans.PropertyValue prop[] = new PropertyValue[1];
-            prop[0] = new PropertyValue("JavaDriverClass", 0, "com.mysql.jdbc.Driver", PropertyState.DIRECT_VALUE);
+            prop[0] = new PropertyValue("JavaDriverClass", 0, "org.mariadb.jdbc.Driver", PropertyState.DIRECT_VALUE);
 
             // get the remote office component context
             XMultiServiceFactory xServiceManager = param.getMSF();
@@ -117,4 +117,4 @@ public class JdbcLongVarCharTest extends ComplexTestCase
             System.exit(0);
         }
     }
-}
\ No newline at end of file
+}
diff --git a/connectivity/registry/mysql/org/openoffice/Office/DataAccess/Drivers.xcu b/connectivity/registry/mysql/org/openoffice/Office/DataAccess/Drivers.xcu
index 77988448f..acd8bfdaf 100644
--- a/connectivity/registry/mysql/org/openoffice/Office/DataAccess/Drivers.xcu
+++ b/connectivity/registry/mysql/org/openoffice/Office/DataAccess/Drivers.xcu
@@ -33,7 +33,7 @@
         </node>
         <node oor:name="JavaDriverClass" oor:op="replace">
           <prop oor:name="Value" oor:type="xs:string">
-            <value>com.mysql.jdbc.Driver</value>
+            <value>org.mariadb.jdbc.Driver</value>
           </prop>
         </node>
         <node oor:name="AddIndexAppendix" oor:op="replace">
diff --git a/connectivity/source/drivers/mysql/YDriver.cxx b/connectivity/source/drivers/mysql/YDriver.cxx
index 95094265e..c0ad7802e 100644
--- a/connectivity/source/drivers/mysql/YDriver.cxx
+++ b/connectivity/source/drivers/mysql/YDriver.cxx
@@ -54,7 +54,7 @@ namespace connectivity
             css::uno::Sequence<css::beans::PropertyValue> const & info)
         {
             return comphelper::NamedValueCollection(info).getOrDefault(
-                "JavaDriverClass", OUString("com.mysql.jdbc.Driver"));
+                "JavaDriverClass", OUString("org.mariadb.jdbc.Driver"));
         }
     }
 
@@ -185,7 +185,7 @@ namespace connectivity
                     aProps.push_back( PropertyValue(
                                           "JavaDriverClass"
                                           ,0
-                                          ,makeAny(OUString("com.mysql.jdbc.Driver"))
+                                          ,makeAny(OUString("org.mariadb.jdbc.Driver"))
                                           ,PropertyState_DIRECT_VALUE) );
                 }
             }
-- 
2.19.1


Reply to: