diff --git a/mariadb-test-openssl_1.patch b/mariadb-test-openssl_1.patch new file mode 100644 index 0000000..9e63524 --- /dev/null +++ b/mariadb-test-openssl_1.patch @@ -0,0 +1,20 @@ +--- mariadb-10.1.15/mysql-test/t/openssl_1.test.orig 2016-06-29 22:56:09.000000000 +0200 ++++ mariadb-10.1.15/mysql-test/t/openssl_1.test 2016-07-04 10:47:13.366522457 +0200 +@@ -134,7 +134,7 @@ drop table t1; + # verification of servers certificate by setting both ca certificate + # and ca path to NULL + # +---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA ++--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA AES256-GCM-SHA384 DHE-RSA-AES256-SHA + --exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1 + --echo End of 5.0 tests + +@@ -259,7 +259,7 @@ select 'is still running; no cipher requ + GRANT SELECT ON test.* TO bug42158@localhost REQUIRE X509; + FLUSH PRIVILEGES; + connect(con1,localhost,bug42158,,,,,SSL); +---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA ++--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA AES256-GCM-SHA384 DHE-RSA-AES256-SHA + SHOW STATUS LIKE 'Ssl_cipher'; + disconnect con1; + connection default; diff --git a/mariadb.spec b/mariadb.spec index 69df542..df44a61 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -119,12 +119,12 @@ # Make long macros shorter %global sameevr %{epoch}:%{version}-%{release} %global compatver 10.1 -%global bugfixver 14 +%global bugfixver 15 Name: mariadb Version: %{compatver}.%{bugfixver} -Release: 2%{?with_debug:.debug}%{?dist} -Epoch: 1 +Release: 3%{?with_debug:.debug}%{?dist} +Epoch: 2 Summary: A community developed branch of MySQL Group: Applications/Databases @@ -136,7 +136,6 @@ License: GPLv2 with exceptions and LGPLv2 and BSD Source0: http://mirrors.syringanetworks.net/mariadb/mariadb-%{version}/source/mariadb-%{version}.tar.gz Source2: mysql_config_multilib.sh Source3: my.cnf.in -Source4: my_config.h Source5: README.mysql-cnf Source6: README.mysql-docs Source7: README.mysql-license @@ -163,6 +162,7 @@ Source72: mariadb-server-galera.te # Patches common for more mysql-like packages Patch1: %{pkgnamepatch}-strmov.patch Patch2: %{pkgnamepatch}-install-test.patch +Patch3: %{pkgnamepatch}-test-openssl_1.patch Patch4: %{pkgnamepatch}-logrotate.patch Patch5: %{pkgnamepatch}-file-contents.patch Patch7: %{pkgnamepatch}-scripts.patch @@ -187,8 +187,10 @@ BuildRequires: libedit-devel BuildRequires: openssl-devel BuildRequires: ncurses-devel BuildRequires: perl +BuildRequires: perl-generators BuildRequires: systemtap-sdt-devel BuildRequires: zlib-devel +BuildRequires: multilib-rpm-config # auth_pam.so plugin will be build if pam-devel is installed BuildRequires: pam-devel # use either new enough version of pcre or provide bundles(pcre) @@ -547,6 +549,7 @@ MariaDB is a community developed branch of MySQL. %patch1 -p1 %patch2 -p1 +%patch3 -p1 %patch4 -p1 %patch5 -p1 %patch7 -p1 @@ -698,22 +701,20 @@ cp -p -f mysql_config.tmp %{buildroot}%{_bindir}/mysql_config chmod 755 %{buildroot}%{_bindir}/mysql_config # multilib header support +for header in mysql/my_config.h mysql/private/config.h; do +%multilib_fix_c_header --file %{_includedir}/$header +done + +# multilib support for shell scripts # we only apply this to known Red Hat multilib arches, per bug #181335 -unamei=$(uname -i) -%ifarch %{arm} -unamei=arm -%endif -%ifarch %{power64} -unamei=ppc64 -%endif -%ifarch %{arm} aarch64 %{ix86} x86_64 ppc %{power64} %{sparc} s390 s390x -mv %{buildroot}%{_includedir}/mysql/my_config.h %{buildroot}%{_includedir}/mysql/my_config_${unamei}.h -mv %{buildroot}%{_includedir}/mysql/private/config.h %{buildroot}%{_includedir}/mysql/private/my_config_${unamei}.h -install -p -m 644 %{SOURCE4} %{buildroot}%{_includedir}/mysql/ -install -p -m 644 %{SOURCE4} %{buildroot}%{_includedir}/mysql/private/config.h +if %multilib_capable; then mv %{buildroot}%{_bindir}/mysql_config %{buildroot}%{_bindir}/mysql_config-%{__isa_bits} install -p -m 0755 scripts/mysql_config_multilib %{buildroot}%{_bindir}/mysql_config -%endif +fi + +# Upstream install this into arch-independent directory, TODO: report +mkdir -p %{buildroot}/%{_libdir}/pkgconfig +mv %{buildroot}/%{_datadir}/pkgconfig/*.pc %{buildroot}/%{_libdir}/pkgconfig # install INFO_SRC, INFO_BIN into libdir (upstream thinks these are doc files, # but that's pretty wacko --- see also %%{name}-file-contents.patch) @@ -857,7 +858,7 @@ rm -f %{buildroot}%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded rm -f %{buildroot}%{_bindir}/mysql_config* rm -rf %{buildroot}%{_includedir}/mysql rm -f %{buildroot}%{_datadir}/aclocal/mysql.m4 -rm -f %{buildroot}%{_datadir}/pkgconfig/mariadb.pc +rm -f %{buildroot}%{_libdir}/pkgconfig/mariadb.pc rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient*.so rm -f %{buildroot}%{_mandir}/man1/mysql_config.1* %endif @@ -1097,8 +1098,9 @@ fi %files server-galera %doc Docs/README.wsrep %license LICENSE.clustercheck -%{_bindir}/galera_new_cluster %{_bindir}/clustercheck +%{_bindir}/galera_new_cluster +%{_bindir}/galera_recovery %{_datadir}/%{pkg_name}/systemd/use_galera_new_cluster.conf %config(noreplace) %{_sysconfdir}/my.cnf.d/galera.cnf %attr(0640,root,root) %ghost %config(noreplace) %{_sysconfdir}/sysconfig/clustercheck @@ -1246,11 +1248,10 @@ fi %if %{with devel} %files devel -%{_bindir}/mysql_config -%{_bindir}/mysql_config-%{__isa_bits} +%{_bindir}/mysql_config* %{_includedir}/mysql %{_datadir}/aclocal/mysql.m4 -%{_datadir}/pkgconfig/mariadb.pc +%{_libdir}/pkgconfig/mariadb.pc %if %{with clibrary} %{_libdir}/mysql/libmysqlclient.so %{_libdir}/mysql/libmysqlclient_r.so @@ -1284,6 +1285,10 @@ fi %endif %changelog +* Thu Jul 14 2016 Honza Horak - 2:10.1.15-3 +- Check datadir more carefully to avoid unwanted data corruption + Related: #1335849 + * Thu May 26 2016 Jakub Dorňák - 1:10.1.14-2 - Fix mysql-prepare-db-dir Resolves: #1335849 diff --git a/my_config.h b/my_config.h deleted file mode 100644 index 02baa3d..0000000 --- a/my_config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Kluge to support multilib installation of both 32- and 64-bit RPMS: - * we need to arrange that header files that appear in both RPMs are - * identical. Hence, this file is architecture-independent and calls - * in an arch-dependent file that will appear in just one RPM. - * - * To avoid breaking arches not explicitly supported by Red Hat, we - * use this indirection file *only* on known multilib arches. - * - * Note: this may well fail if user tries to use gcc's -I- option. - * But that option is deprecated anyway. - */ -#if defined(__x86_64__) -#include "my_config_x86_64.h" -#elif defined(__i386__) -#include "my_config_i386.h" -#elif defined(__ppc64__) || defined(__powerpc64__) -#include "my_config_ppc64.h" -#elif defined(__ppc__) || defined(__powerpc__) -#include "my_config_ppc.h" -#elif defined(__s390x__) -#include "my_config_s390x.h" -#elif defined(__s390__) -#include "my_config_s390.h" -#elif defined(__sparc__) && defined(__arch64__) -#include "my_config_sparc64.h" -#elif defined(__sparc__) -#include "my_config_sparc.h" -#elif defined(__arm__) -#include "my_config_arm.h" -#elif defined(__aarch64__) -#include "my_config_aarch64.h" -#endif diff --git a/mysql-prepare-db-dir.sh b/mysql-prepare-db-dir.sh index 1873c1f..ac7bc5e 100644 --- a/mysql-prepare-db-dir.sh +++ b/mysql-prepare-db-dir.sh @@ -5,6 +5,26 @@ source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" +# Returns content of the specified directory +# If listing files fails, fake-file is returned so which means +# we'll behave like there was some data initialized +# @param datadir +ls_check_datadir () +{ + ls -A "$1" 2>/dev/null + test $? -eq 0 || echo "fake-file" +} + +# Checks whether datadir should be initialized +# @param datadir +can_initialize () +{ + case `ls_check_datadir "$1"` in + ""|lost+found) true ;; + *) false ;; + esac +} + # If two args given first is user, second is group # otherwise the arg is the systemd service file if [ "$#" -eq 2 ] @@ -56,7 +76,7 @@ chmod 0640 "$errlogfile" [ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile" # Make the data directory if doesn't exist or empty -if ! ls $datadir/* &>/dev/null; then +if can_initialize "$datadir" ; then # First, make sure $datadir is there with correct permissions # (note: if it's not, and we're not root, this'll fail ...) if [ ! -e "$datadir" -a ! -h "$datadir" ] @@ -69,14 +89,30 @@ if ! ls $datadir/* &>/dev/null; then # Now create the database echo "Initializing @NICE_PROJECT_NAME@ database" + CURRENT_TIME=`LANG=C date -u` @bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser" ret=$? if [ $ret -ne 0 ] ; then echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2 - echo "Perhaps @sysconfdir@/my.cnf is misconfigured." >&2 + echo "Perhaps @sysconfdir@/my.cnf is misconfigured or there is some problem with permissions of $datadir." >&2 # Clean up any partially-created database files - if [ ! -e "$datadir/mysql/user.frm" ] ; then - rm -rf "$datadir"/* + if [ ! -e "$datadir/mysql/user.frm" ] && [ -d "$datadir" ] ; then + echo "Initialization of @NICE_PROJECT_NAME@ database was not finished successfully." >&2 + echo "Files created so far will be removed." >&2 + # Avoiding deletion of files not created by mysql_install_db is + # guarded by time check and sleep should help work-arounded + # potential issues on systems with 1 second resolution timestamps + # https://bugzilla.redhat.com/show_bug.cgi?id=1335849#c19 + sleep 1 + find "$datadir" -mindepth 1 -maxdepth 1 -newermt "$CURRENT_TIME" \ + -not -name "lost+found" -exec rm -rf {} + + if [ $? -ne 0 ] ; then + echo "Removing of created files was not successfull." >&2 + echo "Please, clean directory $datadir manually." >&2 + fi + else + echo "However, part of data has been initialized and those will not be removed." >&2 + echo "Please, clean directory $datadir manually." >&2 fi exit $ret fi @@ -84,6 +120,18 @@ if ! ls $datadir/* &>/dev/null; then echo "@VERSION@-MariaDB" >"$datadir/mysql_upgrade_info" # In case we're running as root, make sure files are owned properly chown -R "$myuser:$mygroup" "$datadir" +else + if [ -d "$datadir/mysql/" ] ; then + # mysql dir exists, it seems data are initialized properly + echo "Database MariaDB is probably initialized in $datadir already, nothing is done." + echo "If this is not the case, make sure the $datadir is empty before running `basename $0`." + else + # if the directory is not empty but mysql/ directory is missing, then + # print error and let user to initialize manually or empty the directory + echo "Database MariaDB is not initialized, but the directory $datadir is not empty, so initialization cannot be done." + echo "Make sure the $datadir is empty before running `basename $0`." + exit 1 + fi fi exit 0 diff --git a/rh-skipped-tests-arm.list b/rh-skipped-tests-arm.list index 9b92367..c2fbe9d 100644 --- a/rh-skipped-tests-arm.list +++ b/rh-skipped-tests-arm.list @@ -1,12 +1,8 @@ - -connect.bin : rhbz#1096787 (pass on aarch64) -connect.endian : rhbz#1096787 - -main.partition_exchange : rhbz#1096787 -main.analyze_stmt_orderby : rhbz#1096787 -main.explain_json_innodb : rhbz#1096787 -main.explain_json_format_partitions : rhbz#1096787 main.analyze_format_json : rhbz#1096787 +main.analyze_stmt_orderby : rhbz#1096787 main.explain_json : rhbz#1096787 +main.explain_json_format_partitions : rhbz#1096787 +main.explain_json_innodb : rhbz#1096787 +main.partition_exchange : rhbz#1096787 main.subselect_cache : rhbz#1096787 main.type_year : rhbz#1096787 diff --git a/rh-skipped-tests-base.list b/rh-skipped-tests-base.list index fb33990..cb0ecbc 100644 --- a/rh-skipped-tests-base.list +++ b/rh-skipped-tests-base.list @@ -1,14 +1,15 @@ # These tests fail with MariaDB 10: - -main.userstat : rhbz#1096787 +main.multi_update : rhbz#1096787 main.set_statement_notembedded_binlog : rhbz#1096787 -main.ssl_7937 : rhbz#1096787 -main.ssl_crl_clients : rhbz#1096787 -main.openssl_1 : rhbz#1096787 main.ssl : rhbz#1096787 -main.ssl_8k_key : rhbz#1096787 +main.ssl_ca : rhbz#1096787 +main.ssl_cert_verify : rhbz#1096787 main.ssl_compress : rhbz#1096787 +main.ssl_crl_clients : rhbz#1096787 main.ssl_timeout : rhbz#1096787 +main.ssl_7937 : rhbz#1096787 +main.ssl_8k_key : rhbz#1096787 +main.userstat : rhbz#1096787 perfschema.nesting : rhbz#1096787 perfschema.socket_summary_by_event_name_func : rhbz#1096787 perfschema.socket_summary_by_instance_func : rhbz#1096787 diff --git a/sources b/sources index 7a029da..55c84ac 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -294925531e0fd2f0461e3894496a5adc mariadb-10.1.14.tar.gz +21bd68cbc08b4195fbfcf29d1c385fe8 mariadb-10.1.15.tar.gz