Accepting request 406393 from LibreOffice:Factory

- change BuildRequire from pkgconfig(fbembed) to libfbembed-devel;
  this is a temporary workaround allowing build both before and
  after firebird is upgraded to version 3.0 in Factory; once 3.0
  is there, this will be changed to pkgconfig(fbembed) or
  pkgconfig(fbclient), based on %suse_version
- libreoffice-firebird3.patch:
  build against system libfbclient2 if Firebird 3 detected
- libreoffice-firebird3-selftest.patch:
  fix failing selftest when built against Firebird 3 libraries;
  the failure is caused by database file format change, provide
  two versions of the test database and let the test select the
  one that matches Firebird version
- firebird_integer_x64le_ods12.odb:
  rpmbuild doesn't support git patches adding binary files, add
  the ODS12 test database as a source instead

  * Fixes bnc#987553 CVE-2016-4324

OBS-URL: https://build.opensuse.org/request/show/406393
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libreoffice?expand=0&rev=114
This commit is contained in:
Dominique Leuenberger 2016-07-07 13:09:09 +00:00 committed by Git OBS Bridge
commit dcc3729829
6 changed files with 218 additions and 1 deletions

1
.gitattributes vendored
View File

@ -23,3 +23,4 @@
*.zst filter=lfs diff=lfs merge=lfs -text
## Specific LFS patterns
185d60944ea767075d27247c3162b3bc-unowinreg.dll filter=lfs diff=lfs merge=lfs -text
firebird_integer_x64le_ods12.odb filter=lfs diff=lfs merge=lfs -text

View File

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

View File

@ -0,0 +1,119 @@
From: Michal Kubecek <mkubecek@suse.cz>
Date: Thu, 2 Jun 2016 11:56:10 +0200
Subject: connectivity: firebird: use ODS12 test database for Firebird 3
Patch-mainline: Not tagged yet (5.3.0.0.alpha1?)
Git-commit: de899f0b350e51b1932fa4674f7ce2ae386cd1ce
References: bsc#982485
Firebird 3.0 uses new database file format (ODS, On Disk Structure) so
that we need to use either ODS11 or ODS12 version of test database for
dbaccess_firebird test, depending on whether building against Firebird
2.5 or 3.0 libraries.
Change-Id: Idecdc35b0ac87ab7f46cb79b5c044c65423a2c7e
Reviewed-on: https://gerrit.libreoffice.org/25846
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
---
config_host/config_firebird.h.in | 10 ++++++++++
configure.ac | 16 +++++++++++++---
dbaccess/qa/unit/data/firebird_integer_x64le_ods12.odb | Bin 0 -> 75701 bytes
dbaccess/qa/unit/firebird.cxx | 5 +++++
4 files changed, 28 insertions(+), 3 deletions(-)
create mode 100644 config_host/config_firebird.h.in
create mode 100644 dbaccess/qa/unit/data/firebird_integer_x64le_ods12.odb
diff --git a/config_host/config_firebird.h.in b/config_host/config_firebird.h.in
new file mode 100644
index 000000000000..c6aa43ac54f3
--- /dev/null
+++ b/config_host/config_firebird.h.in
@@ -0,0 +1,10 @@
+/*
+Settings for Firebird
+*/
+
+#ifndef CONFIG_FIREBIRD_H
+#define CONFIG_FIREBIRD_H
+
+#define HAVE_FIREBIRD_30 0
+
+#endif
diff --git a/configure.ac b/configure.ac
index 6abeae315c2e..1d137c6a129c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8671,8 +8671,10 @@ if test "$enable_firebird_sdbc" = "yes" ; then
if test -n "${FIREBIRD_VERSION}"; then
FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
- if test "$FIREBIRD_MAJOR" -eq "2" -a "$FIREBIRD_MINOR" -eq "5" -o \
- "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
+ if test "$FIREBIRD_MAJOR" -eq "2" -a "$FIREBIRD_MINOR" -eq "5"; then
+ AC_MSG_RESULT([OK])
+ elif test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
+ AC_DEFINE(HAVE_FIREBIRD_30, 1)
AC_MSG_RESULT([OK])
else
AC_MSG_ERROR([Ensure firebird 2.5.x or 3.0.x is installed])
@@ -8681,10 +8683,16 @@ if test "$enable_firebird_sdbc" = "yes" ; then
__save_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
-#if defined(FB_API_VER) && (FB_API_VER == 25 || FB_API_VER == 30)
+#if defined(FB_API_VER) && FB_API_VER == 25
+int fb_api_is_25(void) { return 0; }
+#elif defined(FB_API_VER) && FB_API_VER == 30
+int fb_api_is_30(void) { return 0; }
#else
#error "Wrong Firebird API version"
#endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 2.5.x or 3.0.x is installed]))
+ if nm conftest.$OBJEXT | grep fb_api_is_30; then
+ AC_DEFINE(HAVE_FIREBIRD_30, 1)
+ fi
CFLAGS="${__save_CFLAGS}"
fi
ENABLE_FIREBIRD_SDBC="TRUE"
@@ -8727,6 +8735,7 @@ AC_SUBST(LIBATOMIC_OPS_LIBS)
AC_SUBST(SYSTEM_FIREBIRD)
AC_SUBST(FIREBIRD_CFLAGS)
AC_SUBST(FIREBIRD_LIBS)
+AC_SUBST(HAVE_FIREBIRD_30)
dnl AC_SUBST([TOMMATH_CFLAGS])
dnl AC_SUBST([TOMMATH_LIBS])
@@ -12928,6 +12937,7 @@ AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
AC_CONFIG_HEADERS([config_host/config_dbus.h])
AC_CONFIG_HEADERS([config_host/config_features.h])
+AC_CONFIG_HEADERS([config_host/config_firebird.h])
AC_CONFIG_HEADERS([config_host/config_folders.h])
AC_CONFIG_HEADERS([config_host/config_gio.h])
AC_CONFIG_HEADERS([config_host/config_global.h])
diff --git a/dbaccess/qa/unit/firebird.cxx b/dbaccess/qa/unit/firebird.cxx
index c9ee575f9b7f..da0bed760d2e 100644
--- a/dbaccess/qa/unit/firebird.cxx
+++ b/dbaccess/qa/unit/firebird.cxx
@@ -16,6 +16,7 @@
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XStatement.hpp>
#include <svtools/miscopt.hxx>
+#include <config_firebird.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::sdb;
@@ -65,7 +66,11 @@ void FirebirdTest::testEmptyDBConnection()
void FirebirdTest::testIntegerDatabase()
{
uno::Reference< XOfficeDatabaseDocument > xDocument =
+#if HAVE_FIREBIRD_30
+ getDocumentForFileName("firebird_integer_x64le_ods12.odb");
+#else
getDocumentForFileName("firebird_integer_x64le.odb");
+#endif
uno::Reference< XConnection > xConnection =
getConnectionForDocument(xDocument);
--
2.9.0

View File

@ -0,0 +1,65 @@
From: Michal Kubecek <mkubecek@suse.cz>
Date: Thu, 2 Jun 2016 08:12:37 +0200
Subject: configure.ac: allow build with Firebird 3.0
Patch-mainline: Not tagged yet (5.3.0.0.alpha1?)
Git-commit: e5d48f12faec6027bf79411cb69111d90f4e4129
References: bsc#982485
Relax the checks in configure.ac to allow building against recently
released Firebird 3.0. In this version, libfbclient is also used to
access local database files (embedded server mode) rather than
separate libfbembed.
Change-Id: Id498cbca22409f95ee299a6165cc765efa25eca7
Reviewed-on: https://gerrit.libreoffice.org/25845
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
---
configure.ac | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index ebca3bab7665..6abeae315c2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8653,8 +8653,10 @@ if test "$enable_firebird_sdbc" = "yes" ; then
AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
if test -z "$FIREBIRDCONFIG"; then
AC_MSG_NOTICE([No fb_config -- using pkg-config])
- PKG_CHECK_MODULES(FIREBIRD, fbembed)
- FIREBIRD_VERSION=`pkg-config --modversion fbembed`
+ PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
+ PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
+ ])
+ FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
else
AC_MSG_NOTICE([fb_config found])
FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
@@ -8669,19 +8671,20 @@ if test "$enable_firebird_sdbc" = "yes" ; then
if test -n "${FIREBIRD_VERSION}"; then
FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
- if test "$FIREBIRD_MAJOR" -eq "2" -a "$FIREBIRD_MINOR" -eq "5"; then
+ if test "$FIREBIRD_MAJOR" -eq "2" -a "$FIREBIRD_MINOR" -eq "5" -o \
+ "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
AC_MSG_RESULT([OK])
else
- AC_MSG_ERROR([Ensure firebird 2.5.x is installed])
+ AC_MSG_ERROR([Ensure firebird 2.5.x or 3.0.x is installed])
fi
else
__save_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
-#if defined(FB_API_VER) && FB_API_VER == 25
+#if defined(FB_API_VER) && (FB_API_VER == 25 || FB_API_VER == 30)
#else
#error "Wrong Firebird API version"
-#endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 2.5.x is installed]))
+#endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 2.5.x or 3.0.x is installed]))
CFLAGS="${__save_CFLAGS}"
fi
ENABLE_FIREBIRD_SDBC="TRUE"
--
2.9.0

View File

@ -1,8 +1,28 @@
-------------------------------------------------------------------
Wed Jun 29 08:04:22 UTC 2016 - mkubecek@suse.cz
- change BuildRequire from pkgconfig(fbembed) to libfbembed-devel;
this is a temporary workaround allowing build both before and
after firebird is upgraded to version 3.0 in Factory; once 3.0
is there, this will be changed to pkgconfig(fbembed) or
pkgconfig(fbclient), based on %suse_version
- libreoffice-firebird3.patch:
build against system libfbclient2 if Firebird 3 detected
- libreoffice-firebird3-selftest.patch:
fix failing selftest when built against Firebird 3 libraries;
the failure is caused by database file format change, provide
two versions of the test database and let the test select the
one that matches Firebird version
- firebird_integer_x64le_ods12.odb:
rpmbuild doesn't support git patches adding binary files, add
the ODS12 test database as a source instead
-------------------------------------------------------------------
Fri Jun 24 19:44:10 UTC 2016 - tchvatal@suse.com
- Version update to 5.2.0.1:
* Various bugfixes for the rc1 candidate
* Fixes bnc#987553 CVE-2016-4324
-------------------------------------------------------------------
Fri Jun 17 17:25:11 UTC 2016 - tchvatal@suse.com

View File

@ -39,6 +39,8 @@ Url: http://www.documentfoundation.org/
Source0: %{tarball_url}/libreoffice-%{version}.tar.xz
Source1: %{tarball_url}/libreoffice-help-%{version}.tar.xz
Source2: %{tarball_url}/libreoffice-translations-%{version}.tar.xz
# test database for Patch18
Source20: firebird_integer_x64le_ods12.odb
Source99: %{name}-rpmlintrc
# prebuilt extensions
Source402: %{external_url}/b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_%{numbertext_version}.oxt
@ -69,6 +71,9 @@ Patch4: nlpsolver-no-broken-help.diff
Patch5: mediawiki-no-broken-help.diff
# PATCH-HOTFIX-UPSTREAM: disable test that rounds wrongly on most archs
Patch16: libreoffice-hotfix-disablebrokenshapetest.patch
# PATCH-FIX-UPSTREAM: fix build against (system) Firebird 3.0
Patch17: libreoffice-firebird3.patch
Patch18: libreoffice-firebird3-selftest.patch
# try to save space by using hardlinks
Patch990: install-with-hardlinks.diff
BuildRequires: %{name}-share-linker
@ -99,6 +104,8 @@ BuildRequires: libbase
BuildRequires: libcppunit-devel
BuildRequires: liberation-fonts
BuildRequires: libexif
# once FB 3.0 is in Factory, change to pkgconfig(fbclient) / pkgconfig(fbembed)
BuildRequires: libfbembed-devel
BuildRequires: libfonts
BuildRequires: libformula
BuildRequires: libjpeg-devel
@ -136,7 +143,6 @@ BuildRequires: perl(Digest::MD5)
BuildRequires: pkgconfig(bluez)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(fbembed)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glew) >= 1.10.0
BuildRequires: pkgconfig(glu)
@ -910,6 +916,9 @@ Provides additional %{langname} translations and resources for %{project}. \
%patch4
%patch5
%patch16 -p1
%patch17 -p1
%patch18 -p1
cp -vn %{SOURCE20} dbaccess/qa/unit/data/
%patch990 -p1
# Do not generate doxygen timestamp