diff --git a/.gitignore b/.gitignore index 75c6286..1a2f03d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/mariadb-10.1.19.tar.gz +SOURCES/mariadb-10.1.29.tar.gz diff --git a/.rh-mariadb101-mariadb.metadata b/.rh-mariadb101-mariadb.metadata index 34fb6dc..48645e9 100644 --- a/.rh-mariadb101-mariadb.metadata +++ b/.rh-mariadb101-mariadb.metadata @@ -1 +1 @@ -6ad858653647effe16fceb096d0897694d3c7bcb SOURCES/mariadb-10.1.19.tar.gz +0be98afd6ba210644e17d9163bc28b71a6e89969 SOURCES/mariadb-10.1.29.tar.gz diff --git a/SOURCES/README.mariadb-devel b/SOURCES/README.mariadb-devel new file mode 100644 index 0000000..3e7a55a --- /dev/null +++ b/SOURCES/README.mariadb-devel @@ -0,0 +1,44 @@ +This is a short overview how rh-mariadb101-mariadb-devel should be used. + +* General information + +Red Hat Software Collections contains the server part of MariaDB 10.1 database. +The core Red Hat Enterprise Linux 6 provides version 5.1 of MySQL databases +(client library and server daemon) and the core Red Hat Enterprise Linux 7 +provides version 5.5 of MariaDB databases (client library and server daemon) . + +A protocol which is used between the client library and the daemon (MySQL +and MariaDB are compatible enough from this POV) is stable across database +versions, so using, for example, the MySQL 5.1 client library with the +MariaDB 10.1 daemon works as expected. + + +* Usage of database connectors for dynamic languages + +Client libraries from MySQL 5.1 or MariaDB 5.5 are used in database connectors +for dynamic languages (Python, Perl, PHP, Ruby) and libraries that are part +of the core Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7. + +The same client libraries from MySQL 5.1 or MariaDB 5.5 are used in database +connectors for more recent version of dynamic languages that are part of +the Red Hat Software Collections. + + +* How to build applications for MariaDB 10.1 from Red Hat Software Collection + +MariaDB 10.1 from Red Hat Software Collection does not include database +connectors; client libraries packaged in the MariaDB 10.1 Red Hat Software +Collections database packages are not supposed to be used as they are included +only for purposes of server utilities and the daemon. Users are instead +expected to use the system libraries and database connectors provided by +MySQL 5.1 or MariaDB 5.5 with the core system. + +It means that users who would like to link their application against MariaDB +client library should compile and link it against MySQL 5.1 or MariaDB 5.5 +in the core Red Hat Enterprise Linux environment, not in MariaDB 10.1 Red Hat +Software Collections environment. + +The only exception to this are server-side plugins, which are expected +to be built under MariaDB 10.1 Red Hat Software Collections environment, +which means the build process should be run inside "scl enable rh-mysql101 '...'" +call. diff --git a/SOURCES/mariadb-covscan-stroverflow.patch b/SOURCES/mariadb-covscan-stroverflow.patch deleted file mode 100644 index 5039612..0000000 --- a/SOURCES/mariadb-covscan-stroverflow.patch +++ /dev/null @@ -1,57 +0,0 @@ -The following problems have been found by Coverity - static analysis tool. - -mysql-5.5.31/plugin/semisync/semisync_master.cc:672:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function. - -mysql-5.5.31/plugin/semisync/semisync_master.cc:661:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function. - -mysql-5.5.31/plugin/semisync/semisync_master.cc:555:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function. - -diff -up mariadb-10.0.15/plugin/semisync/semisync_master.cc.orig mariadb-10.0.15/plugin/semisync/semisync_master.cc ---- mariadb-10.0.15/plugin/semisync/semisync_master.cc.orig 2014-11-27 15:16:59.664855517 +0100 -+++ mariadb-10.0.15/plugin/semisync/semisync_master.cc 2014-11-27 15:16:17.029779375 +0100 -@@ -555,7 +555,8 @@ int ReplSemiSyncMaster::reportReplyBinlo - - if (need_copy_send_pos) - { -- strcpy(reply_file_name_, log_file_name); -+ strncpy(reply_file_name_, log_file_name, sizeof(reply_file_name_)-1); -+ reply_file_name_[sizeof(reply_file_name_)-1] = '\0'; - reply_file_pos_ = log_file_pos; - reply_file_name_inited_ = true; - -@@ -663,7 +664,8 @@ int ReplSemiSyncMaster::commitTrx(const - if (cmp <= 0) - { - /* This thd has a lower position, let's update the minimum info. */ -- strcpy(wait_file_name_, trx_wait_binlog_name); -+ strncpy(wait_file_name_, trx_wait_binlog_name, sizeof(wait_file_name_)-1); -+ wait_file_name_[sizeof(wait_file_name_)-1] = '\0'; - wait_file_pos_ = trx_wait_binlog_pos; - - rpl_semi_sync_master_wait_pos_backtraverse++; -@@ -674,7 +676,8 @@ int ReplSemiSyncMaster::commitTrx(const - } - else - { -- strcpy(wait_file_name_, trx_wait_binlog_name); -+ strncpy(wait_file_name_, trx_wait_binlog_name, sizeof(wait_file_name_)-1); -+ wait_file_name_[sizeof(wait_file_name_)-1] = '\0'; - wait_file_pos_ = trx_wait_binlog_pos; - wait_file_name_inited_ = true; - - -mysql-5.5.31/sql/rpl_handler.cc:306:fixed_size_dest – You might overrun the 512 byte fixed-size string "log_info->log_file" by copying "log_file + dirname_length(log_file)" without checking the length. diff -up mysql-5.5.31/sql/rpl_handler.cc.covscan-stroverflow mysql-5.5.31/sql/rpl_handler.cc - -diff -up mariadb-10.1.11/sql/rpl_handler.cc.stroverflow mariadb-10.1.11/sql/rpl_handler.cc ---- mariadb-10.1.11/sql/rpl_handler.cc.stroverflow 2016-02-07 14:59:15.828635150 +0100 -+++ mariadb-10.1.11/sql/rpl_handler.cc 2016-02-07 15:01:01.776653452 +0100 -@@ -267,7 +267,8 @@ int Binlog_storage_delegate::after_flush - thd->semisync_info= log_info; - } - -- strcpy(log_info->log_file, log_file+dirname_length(log_file)); -+ strncpy(log_info->log_file, log_file+dirname_length(log_file), sizeof(log_info->log_file)-1); -+ log_info->log_file[sizeof(log_info->log_file)-1] = '\0'; - log_info->log_pos = log_pos; - - FOREACH_OBSERVER(ret, after_flush, false, diff --git a/SOURCES/mariadb-galera-new-cluster-help.patch b/SOURCES/mariadb-galera-new-cluster-help.patch deleted file mode 100644 index cf63719..0000000 --- a/SOURCES/mariadb-galera-new-cluster-help.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- mariadb-10.1.14/scripts/galera_new_cluster.sh.orig 2016-05-11 18:51:13.797926130 +0200 -+++ mariadb-10.1.14/scripts/galera_new_cluster.sh 2016-05-11 19:19:41.195591769 +0200 -@@ -5,6 +5,22 @@ - # the Free Software Foundation; either version 2.1 of the License, or - # (at your option) any later version. - -+if [ "${1}" == "-h" -o "${1}" == "--help" ]; then -+ cat <> /etc/opt/rh/rh-mariadb101/sysconfig/mariadb +diff -up mariadb-10.1.24/scripts/galera_new_cluster.sh.p42 mariadb-10.1.24/scripts/galera_new_cluster.sh +--- mariadb-10.1.24/scripts/galera_new_cluster.sh.p42 2017-06-25 09:49:08.770170892 +0200 ++++ mariadb-10.1.24/scripts/galera_new_cluster.sh 2017-06-25 09:53:10.367380549 +0200 +@@ -24,7 +24,12 @@ fi + VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@" + COMPILATION_COMMENT="@COMPILATION_COMMENT@" -systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \ - systemctl start ${1:-@DAEMON_NAME@} ++echo "_WSREP_NEW_CLUSTER='--wsrep-new-cluster'" >> @sysconfdir@/sysconfig/mariadb + +-systemctl set-environment _WSREP_NEW_CLUSTER='' +service rh-mariadb101-mariadb start + +EXIT_CODE=$? + -+sed -i -r "/^_WSREP_NEW_CLUSTER='--wsrep-new-cluster'$/d" /etc/opt/rh/rh-mariadb101/sysconfig/mariadb ++sed -i -r "/^_WSREP_NEW_CLUSTER='--wsrep-new-cluster'$/d" @sysconfdir@/sysconfig/mariadb + +exit $EXIT_CODE - --systemctl set-environment _WSREP_NEW_CLUSTER='' diff --git a/SOURCES/mariadb-install-db-sharedir.patch b/SOURCES/mariadb-install-db-sharedir.patch deleted file mode 100644 index f32c3df..0000000 --- a/SOURCES/mariadb-install-db-sharedir.patch +++ /dev/null @@ -1,23 +0,0 @@ -Use configured value instead of hardcoded path - -diff -up mariadb-10.1.19/scripts/mysql_install_db.pl.in.pbasedir mariadb-10.1.19/scripts/mysql_install_db.pl.in ---- mariadb-10.1.19/scripts/mysql_install_db.pl.in.pbasedir 2016-11-19 13:08:53.882777759 +0100 -+++ mariadb-10.1.19/scripts/mysql_install_db.pl.in 2016-11-19 13:08:53.880777758 +0100 -@@ -306,7 +306,7 @@ if ( $opt->{srcdir} ) - $bindir = "$opt->{basedir}/client"; - $extra_bindir = "$opt->{basedir}/extra"; - $mysqld = "$opt->{basedir}/sql/mysqld"; -- $mysqld_opt = "--language=$opt->{srcdir}/sql/share/english"; -+ $mysqld_opt = "--language=$opt->{srcdir}/sql/@INSTALL_MYSQLSHAREDIR@/english"; - $srcpkgdatadir = "$opt->{srcdir}/scripts"; - $buildpkgdatadir = "$opt->{builddir}/scripts"; - $scriptdir = "$opt->{srcdir}/scripts"; -@@ -320,7 +320,7 @@ elsif ( $opt->{basedir} ) - find_in_basedir($opt,"file","mysqld-nt", - "bin"); # ,"sql" - $srcpkgdatadir = find_in_basedir($opt,"dir","fill_help_tables.sql", -- "share","share/mysql"); # ,"scripts" -+ "share","@INSTALL_MYSQLSHAREDIR@"); # ,"scripts" - $buildpkgdir = $srcpkgdatadir; - $scriptdir = "$opt->{basedir}/scripts"; - } diff --git a/SOURCES/mariadb-install-test.patch b/SOURCES/mariadb-install-test.patch deleted file mode 100644 index e085599..0000000 --- a/SOURCES/mariadb-install-test.patch +++ /dev/null @@ -1,55 +0,0 @@ -Improve the documentation that will be installed in the mysql-test RPM. - ---- mariadb-10.1.13/mysql-test/README.orig 2016-03-24 10:12:10.000000000 +0100 -+++ mariadb-10.1.13/mysql-test/README 2016-03-29 10:23:30.074326900 +0200 -@@ -1,15 +1,28 @@ --This directory contains a test suite for the MySQL daemon. To run --the currently existing test cases, simply execute ./mysql-test-run in --this directory. It will fire up the newly built mysqld and test it. -- --Note that you do not have to have to do "make install", and you could --actually have a co-existing MySQL installation. The tests will not --conflict with it. To run the test suite in a source directory, you --must do make first. -- --All tests must pass. If one or more of them fail on your system, please --read the following manual section for instructions on how to report the --problem: -+This directory contains a test suite for the MariaDB daemon. To run -+the currently existing test cases, execute ./mysql-test-run in -+this directory. -+ -+For use in Red Hat distributions, you should run the script as user mysql, -+who is created with nologin shell however, so the best bet is something like -+ $ su - -+ # cd /usr/share/mysql-test -+ # su -s /bin/bash mysql -c "./mysql-test-run --skip-test-list=rh-skipped-tests.list" -+ -+This will use the installed mysql executables, but will run a private copy -+of the server process (using data files within /usr/share/mysql-test), -+so you need not start the mysqld service beforehand. -+ -+The "--skip-test-list=rh-skipped-tests.list" option excludes tests that are -+known to fail on one or more Red-Hat-supported platforms. You can omit it -+if you want to check whether such failures occur for you. Documentation -+about the reasons for omitting such tests can be found in the file -+rh-skipped-tests.list. -+ -+To clean up afterwards, remove the created "var" subdirectory, eg -+ # su -s /bin/bash - mysql -c "rm -rf /usr/share/mysql-test/var" -+ -+If one or more tests fail on your system, please read the following manual -+section for instructions on how to report the problem: - - https://mariadb.com/kb/en/reporting-bugs - -@@ -26,7 +39,8 @@ other relevant options. - - With no test cases named on the command line, mysql-test-run falls back - to the normal "non-extern" behavior. The reason for this is that some --tests cannot run with an external server. -+tests cannot run with an external server (because they need to control the -+options with which the server is started). - - You can create your own test cases. To create a test case, create a new - file in the t subdirectory using a text editor. The file should have a .test diff --git a/SOURCES/mariadb-logrotate.patch b/SOURCES/mariadb-logrotate.patch index 898f7f4..2a4f416 100644 --- a/SOURCES/mariadb-logrotate.patch +++ b/SOURCES/mariadb-logrotate.patch @@ -14,9 +14,9 @@ Adjust the mysql-log-rotate script in several ways: See discussions at RH bugs 799735, 547007 -diff -up mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5 mariadb-10.0.10/support-files/mysql-log-rotate.sh ---- mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5 2014-03-30 19:56:53.000000000 +0200 -+++ mariadb-10.0.10/support-files/mysql-log-rotate.sh 2014-04-07 16:30:11.264618655 +0200 +diff -up mariadb-10.1.24/support-files/mysql-log-rotate.sh.p4 mariadb-10.1.24/support-files/mysql-log-rotate.sh +--- mariadb-10.1.24/support-files/mysql-log-rotate.sh.p4 2017-05-29 18:48:37.000000000 +0200 ++++ mariadb-10.1.24/support-files/mysql-log-rotate.sh 2017-06-25 08:58:02.294912909 +0200 @@ -1,9 +1,9 @@ # This logname can be set in /etc/my.cnf -# by setting the variable "err-log" @@ -31,7 +31,7 @@ diff -up mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5 mariadb-10.0.10/su # # If the root user has a password you have to create a # /root/.my.cnf configuration file with the following -@@ -18,19 +18,21 @@ +@@ -18,20 +18,22 @@ # ATTENTION: This /root/.my.cnf should be readable ONLY # for root ! @@ -47,7 +47,8 @@ diff -up mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5 mariadb-10.0.10/su - if test -x @bindir@/mysqladmin && \ - @bindir@/mysqladmin ping &>/dev/null - then -- @bindir@/mysqladmin flush-logs +- @bindir@/mysqladmin --local flush-error-log \ +- flush-engine-log flush-general-log flush-slow-log - fi - endscript -} @@ -65,7 +66,8 @@ diff -up mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5 mariadb-10.0.10/su +# if test -x @bindir@/mysqladmin && \ +# @bindir@/mysqladmin ping &>/dev/null +# then -+# @bindir@/mysqladmin flush-logs ++# @bindir@/mysqladmin --local flush-error-log \ ++# flush-engine-log flush-general-log flush-slow-log +# fi +# endscript +#} diff --git a/SOURCES/mariadb-recoverpath.patch b/SOURCES/mariadb-recoverpath.patch new file mode 100644 index 0000000..90909f2 --- /dev/null +++ b/SOURCES/mariadb-recoverpath.patch @@ -0,0 +1,22 @@ +Upstream changed location of the temporary file in the wsrep_recover_position +function, which causes issues on RHEL-6, because mysqld_safe is not expected +to play with files in /tmp, and SELinux started to complain. + +Changing the location of the temporary files to the datadir means practically +reverting part of the upstream commit +https://github.com/MariaDB/server/commit/bb7a70c9551c1756b1d1736ca4f6a0a965795873 + +Upstream issue: https://jira.mariadb.org/browse/MDEV-10767 + +diff -up mariadb-10.1.29/scripts/mysqld_safe.sh.recoverpath mariadb-10.1.29/scripts/mysqld_safe.sh +--- mariadb-10.1.29/scripts/mysqld_safe.sh.recoverpath 2017-11-23 10:48:37.538678722 +0100 ++++ mariadb-10.1.29/scripts/mysqld_safe.sh 2017-11-23 10:50:48.134585794 +0100 +@@ -246,7 +246,7 @@ wsrep_recover_position() { + local euid=$(id -u) + local ret=0 + +- local wr_logfile=$(mktemp /tmp/wsrep_recovery.XXXXXX) ++ local wr_logfile=$(mktemp $DATADIR/wsrep_recovery.XXXXXX) + + # safety checks + if [ -z $wr_logfile ]; then diff --git a/SOURCES/mariadb-recovery.patch b/SOURCES/mariadb-recovery.patch new file mode 100644 index 0000000..2c90daf --- /dev/null +++ b/SOURCES/mariadb-recovery.patch @@ -0,0 +1,16 @@ +Wrong path used for mysqld + +rhbz: #1403416 + +diff -up mariadb-10.1.28/scripts/galera_recovery.sh.p43 mariadb-10.1.28/scripts/galera_recovery.sh +--- mariadb-10.1.28/scripts/galera_recovery.sh.p43 2017-11-10 00:28:01.843757434 +0100 ++++ mariadb-10.1.28/scripts/galera_recovery.sh 2017-11-10 00:28:51.827998710 +0100 +@@ -68,7 +68,7 @@ parse_arguments() { + + wsrep_recover_position() { + # Redirect server's error log to the log file. +- eval /usr/sbin/mysqld $cmdline_args --user=$user --wsrep_recover \ ++ eval @libexecdir@/mysqld $cmdline_args --user=$user --wsrep_recover \ + --disable-log-error 2> "$log_file" + ret=$? + if [ $ret -ne 0 ]; then diff --git a/SOURCES/mariadb-scl-env-check.patch b/SOURCES/mariadb-scl-env-check.patch index f0cac67..af81eb0 100644 --- a/SOURCES/mariadb-scl-env-check.patch +++ b/SOURCES/mariadb-scl-env-check.patch @@ -1,6 +1,6 @@ -diff -up mariadb-10.1.11/scripts/mysqld_safe.sh.p90 mariadb-10.1.11/scripts/mysqld_safe.sh ---- mariadb-10.1.11/scripts/mysqld_safe.sh.p90 2016-01-28 13:12:51.000000000 +0100 -+++ mariadb-10.1.11/scripts/mysqld_safe.sh 2016-02-11 15:07:13.238878202 +0100 +diff -up mariadb-10.1.29/scripts/mysqld_safe.sh.p90 mariadb-10.1.29/scripts/mysqld_safe.sh +--- mariadb-10.1.29/scripts/mysqld_safe.sh.p90 2017-11-13 19:46:47.000000000 +0100 ++++ mariadb-10.1.29/scripts/mysqld_safe.sh 2017-11-16 15:33:51.364577292 +0100 @@ -11,6 +11,12 @@ # mysql.server works by first doing a cd to the base directory and from there # executing mysqld_safe @@ -14,9 +14,9 @@ diff -up mariadb-10.1.11/scripts/mysqld_safe.sh.p90 mariadb-10.1.11/scripts/mysq # Initialize script globals KILL_MYSQLD=1; MYSQLD= -diff -up mariadb-10.1.11/scripts/mysql.init.in.p90 mariadb-10.1.11/scripts/mysql.init.in ---- mariadb-10.1.11/scripts/mysql.init.in.p90 2016-02-11 15:07:13.235878197 +0100 -+++ mariadb-10.1.11/scripts/mysql.init.in 2016-02-11 15:07:13.239878203 +0100 +diff -up mariadb-10.1.29/scripts/mysql.init.in.p90 mariadb-10.1.29/scripts/mysql.init.in +--- mariadb-10.1.29/scripts/mysql.init.in.p90 2017-11-16 15:33:51.358577260 +0100 ++++ mariadb-10.1.29/scripts/mysql.init.in 2017-11-16 15:33:51.365577297 +0100 @@ -154,6 +154,18 @@ condrestart(){ [ -e $lockfile ] && restart || : } @@ -36,9 +36,9 @@ diff -up mariadb-10.1.11/scripts/mysql.init.in.p90 mariadb-10.1.11/scripts/mysql # See how we were called. case "$1" in -diff -up mariadb-10.1.11/scripts/mysql_install_db.sh.p90 mariadb-10.1.11/scripts/mysql_install_db.sh ---- mariadb-10.1.11/scripts/mysql_install_db.sh.p90 2016-02-11 15:07:12.611877135 +0100 -+++ mariadb-10.1.11/scripts/mysql_install_db.sh 2016-02-11 15:07:13.240878205 +0100 +diff -up mariadb-10.1.29/scripts/mysql_install_db.sh.p90 mariadb-10.1.29/scripts/mysql_install_db.sh +--- mariadb-10.1.29/scripts/mysql_install_db.sh.p90 2017-11-13 19:46:47.000000000 +0100 ++++ mariadb-10.1.29/scripts/mysql_install_db.sh 2017-11-16 15:36:33.918439507 +0100 @@ -19,6 +19,12 @@ # # All unrecognized arguments to this script are passed to mysqld. @@ -52,12 +52,12 @@ diff -up mariadb-10.1.11/scripts/mysql_install_db.sh.p90 mariadb-10.1.11/scripts basedir="" builddir="" ldata="@localstatedir@" -@@ -438,16 +444,16 @@ else +@@ -481,16 +487,16 @@ else echo "The problem could be conflicting information in an external" echo "my.cnf files. You can ignore these by doing:" echo -- echo " shell> $scriptdir/scripts/mysql_install_db --defaults-file=~/.my.cnf" -+ echo " shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $scriptdir/scripts/mysql_install_db --defaults-file=~/.my.cnf'" +- echo " shell> $0 --defaults-file=~/.my.cnf" ++ echo " shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $0 --defaults-file=~/.my.cnf'" echo echo "You can also try to start the mysqld daemon with:" echo @@ -72,7 +72,7 @@ diff -up mariadb-10.1.11/scripts/mysql_install_db.sh.p90 mariadb-10.1.11/scripts echo " mysql> show tables;" echo echo "Try 'mysqld --help' if you have problems with paths. Using" -@@ -488,19 +494,15 @@ fi +@@ -531,19 +537,15 @@ fi # the screen. if test "$cross_bootstrap" -eq 0 && test -z "$srcdir" then @@ -95,7 +95,7 @@ diff -up mariadb-10.1.11/scripts/mysql_install_db.sh.p90 mariadb-10.1.11/scripts echo echo "which will also give you the option of removing the test" echo "databases and anonymous user created by default. This is" -@@ -516,7 +518,8 @@ then +@@ -559,7 +561,8 @@ then echo "cd '$basedir' ; $bindir/mysqld_safe --datadir='$ldata'" echo echo "You can test the MariaDB daemon with mysql-test-run.pl" @@ -105,9 +105,9 @@ diff -up mariadb-10.1.11/scripts/mysql_install_db.sh.p90 mariadb-10.1.11/scripts fi echo -diff -up mariadb-10.1.11/scripts/mysql.service.in.p90 mariadb-10.1.11/scripts/mysql.service.in ---- mariadb-10.1.11/scripts/mysql.service.in.p90 2016-02-11 15:07:13.240878205 +0100 -+++ mariadb-10.1.11/scripts/mysql.service.in 2016-02-11 15:10:28.640210693 +0100 +diff -up mariadb-10.1.29/scripts/mysql.service.in.p90 mariadb-10.1.29/scripts/mysql.service.in +--- mariadb-10.1.29/scripts/mysql.service.in.p90 2017-11-16 15:33:51.342577175 +0100 ++++ mariadb-10.1.29/scripts/mysql.service.in 2017-11-16 15:33:51.367577308 +0100 @@ -34,14 +34,20 @@ Type=notify User=mysql Group=mysql @@ -134,9 +134,38 @@ diff -up mariadb-10.1.11/scripts/mysql.service.in.p90 mariadb-10.1.11/scripts/my # Setting this to true can break replication and the Type=notify settings # See also bind-address mysqld option. -diff -up mariadb-10.1.11/support-files/mysql-log-rotate.sh.p90 mariadb-10.1.11/support-files/mysql-log-rotate.sh ---- mariadb-10.1.11/support-files/mysql-log-rotate.sh.p90 2016-02-11 15:07:12.570877065 +0100 -+++ mariadb-10.1.11/support-files/mysql-log-rotate.sh 2016-02-11 15:07:13.240878205 +0100 +diff -up mariadb-10.1.29/scripts/mysql@.service.in.p90 mariadb-10.1.29/scripts/mysql@.service.in +--- mariadb-10.1.29/scripts/mysql@.service.in.p90 2017-11-16 15:33:51.358577260 +0100 ++++ mariadb-10.1.29/scripts/mysql@.service.in 2017-11-16 15:33:51.367577308 +0100 +@@ -41,14 +41,20 @@ Type=notify + User=mysql + Group=mysql + +-ExecStartPre=@libexecdir@/mysql-check-socket --defaults-group-suffix=.%I +-ExecStartPre=@libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n ++# Load collections set to enabled for this service ++EnvironmentFile=@SCL_SCRIPTS@/service-environment ++ ++# We want to start server only inside "scl enable" invocation ++ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- /usr/bin/scl_enabled @SCL_NAME@ ++ ++ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-socket --defaults-group-suffix=.%I ++ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n + # MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf + # Note: we set --basedir to prevent probes that might trigger SELinux alarms, + # per bug #547485 +-ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER +-ExecStartPost=@libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I +-ExecStopPost=@libexecdir@/mysql-wait-stop --defaults-group-suffix=.%I ++ExecStart=@libexecdir@/mysqld_safe-scl-helper enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER ++ExecStartPost=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I ++ExecStopPost=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-wait-stop --defaults-group-suffix=.%I + + # Setting this to true can break replication and the Type=notify settings + # See also bind-address mysqld option. +diff -up mariadb-10.1.29/support-files/mysql-log-rotate.sh.p90 mariadb-10.1.29/support-files/mysql-log-rotate.sh +--- mariadb-10.1.29/support-files/mysql-log-rotate.sh.p90 2017-11-16 15:33:51.312577016 +0100 ++++ mariadb-10.1.29/support-files/mysql-log-rotate.sh 2017-11-16 15:33:51.368577314 +0100 @@ -30,9 +30,9 @@ # postrotate # # just if mysqld is really running @@ -144,8 +173,8 @@ diff -up mariadb-10.1.11/support-files/mysql-log-rotate.sh.p90 mariadb-10.1.11/s -# @bindir@/mysqladmin ping &>/dev/null +# /usr/bin/scl enable @SCL_NAME@ -- @bindir@/mysqladmin ping &>/dev/null # then --# @bindir@/mysqladmin flush-logs -+# /usr/bin/scl enable @SCL_NAME@ -- @bindir@/mysqladmin flush-logs +-# @bindir@/mysqladmin --local flush-error-log \ ++# /usr/bin/scl enable @SCL_NAME@ -- @bindir@/mysqladmin --local flush-error-log \ + # flush-engine-log flush-general-log flush-slow-log # fi # endscript - #} diff --git a/SOURCES/mariadb-scripts.patch b/SOURCES/mariadb-scripts.patch index 636635d..8ea2369 100644 --- a/SOURCES/mariadb-scripts.patch +++ b/SOURCES/mariadb-scripts.patch @@ -1,10 +1,13 @@ ---- mariadb-10.1.11.orig/scripts/CMakeLists.txt 2016-01-28 13:12:51.000000000 +0100 -+++ mariadb-10.1.11/scripts/CMakeLists.txt 2016-02-03 12:46:26.306109293 +0100 -@@ -321,6 +321,35 @@ ELSE() - COMPONENT ${${file}_COMPONENT} +We have some downstream patches and other scripts that include variables to +be expanded by cmake. Cmake needs to know about them, so adding them manually. + +diff -up mariadb-10.1.26/scripts/CMakeLists.txt.p7 mariadb-10.1.26/scripts/CMakeLists.txt +--- mariadb-10.1.26/scripts/CMakeLists.txt.p7 2017-08-14 10:34:16.811312068 +0200 ++++ mariadb-10.1.26/scripts/CMakeLists.txt 2017-08-14 10:35:32.567557220 +0200 +@@ -375,6 +375,36 @@ ELSE() ) ENDFOREACH() -+ + + # files for systemd + SET(SYSTEMD_SCRIPTS + mysql.tmpfiles.d @@ -18,6 +21,7 @@ + mysql-scripts-common + mysql_config_multilib + clustercheck ++ galera_new_cluster + mysql.init + my.cnf + ) @@ -33,6 +37,7 @@ + "${CMAKE_CURRENT_SOURCE_DIR}" ) + ENDIF() + ENDFOREACH() ++ ENDIF() - # Configure two scripts from one 'in' file. + # Install libgcc as mylibgcc.a diff --git a/SOURCES/mariadb-ssl-cypher.patch b/SOURCES/mariadb-ssl-cypher.patch new file mode 100644 index 0000000..a1a9dcf --- /dev/null +++ b/SOURCES/mariadb-ssl-cypher.patch @@ -0,0 +1,21 @@ +diff -up mariadb-10.1.19/mysql-test/r/ssl_8k_key.result.sslbak mariadb-10.1.19/mysql-test/r/ssl_8k_key.result +--- mariadb-10.1.19/mysql-test/r/ssl_8k_key.result.sslbak 2016-11-24 08:55:21.637000000 -0500 ++++ mariadb-10.1.19/mysql-test/r/ssl_8k_key.result 2016-11-24 08:55:55.853000000 -0500 +@@ -1,2 +1,2 @@ +-Variable_name Value +-Ssl_cipher DHE-RSA-AES256-SHA ++have_ssl ++1 +diff -up mariadb-10.1.19/mysql-test/t/ssl_8k_key.test.sslbak mariadb-10.1.19/mysql-test/t/ssl_8k_key.test +--- mariadb-10.1.19/mysql-test/t/ssl_8k_key.test.sslbak 2016-11-24 08:54:10.485000000 -0500 ++++ mariadb-10.1.19/mysql-test/t/ssl_8k_key.test 2016-11-24 08:54:35.724000000 -0500 +@@ -5,7 +5,7 @@ + # + # Bug#29784 YaSSL assertion failure when reading 8k key. + # +---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 ++--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher'" 2>&1 + + ## This test file is for testing encrypted communication only, not other + ## encryption routines that the SSL library happens to provide! + diff --git a/SOURCES/mariadb-string-overflow.patch b/SOURCES/mariadb-string-overflow.patch deleted file mode 100644 index e0f5f60..0000000 --- a/SOURCES/mariadb-string-overflow.patch +++ /dev/null @@ -1,22 +0,0 @@ -These issues were found by Coverity static analysis tool, for more info -see messages by particular fixes (messages belong to 5.1.61). - -Filed upstream at http://bugs.mysql.com/bug.php?id=64631 - - -Error: BUFFER_SIZE_WARNING: -/builddir/build/BUILD/mysql-5.1.61/sql/sql_prepare.cc:2749: buffer_size_warning: Calling strncpy with a maximum size argument of 512 bytes on destination array "this->stmt->last_error" of size 512 bytes might leave the destination string unterminated. - - -diff -up mariadb-10.0.10/sql/sql_prepare.cc.p8 mariadb-10.0.10/sql/sql_prepare.cc ---- mariadb-10.0.10/sql/sql_prepare.cc.p8 2014-03-30 19:56:42.000000000 +0200 -+++ mariadb-10.0.10/sql/sql_prepare.cc 2014-04-07 18:43:33.901074770 +0200 -@@ -3277,7 +3277,7 @@ void mysql_stmt_get_longdata(THD *thd, c - { - stmt->state= Query_arena::STMT_ERROR; - stmt->last_errno= thd->get_stmt_da()->sql_errno(); -- strncpy(stmt->last_error, thd->get_stmt_da()->message(), MYSQL_ERRMSG_SIZE); -+ strncpy(stmt->last_error, thd->get_stmt_da()->message(), sizeof(stmt->last_error)-1); - } - thd->set_stmt_da(save_stmt_da); - diff --git a/SOURCES/mariadb-strmov.patch b/SOURCES/mariadb-strmov.patch index c2350c4..6500358 100644 --- a/SOURCES/mariadb-strmov.patch +++ b/SOURCES/mariadb-strmov.patch @@ -12,18 +12,20 @@ ability to detect this type of error is low, and I also see little evidence of any real performance gain from optimizing these calls. So I'm keeping this patch. -diff -up mariadb-10.0.15/include/m_string.h.orig mariadb-10.0.15/include/m_string.h ---- mariadb-10.0.15/include/m_string.h.orig 2014-11-27 14:40:32.622032698 +0100 -+++ mariadb-10.0.15/include/m_string.h 2014-11-27 14:38:56.211864712 +0100 -@@ -73,12 +73,6 @@ extern void *(*my_str_malloc)(size_t); +diff -up mariadb-10.1.24/include/m_string.h.p1 mariadb-10.1.24/include/m_string.h +--- mariadb-10.1.24/include/m_string.h.p1 2017-06-24 23:36:17.621883847 +0200 ++++ mariadb-10.1.24/include/m_string.h 2017-06-24 23:36:41.454890701 +0200 +@@ -73,14 +73,6 @@ extern void *(*my_str_malloc)(size_t); extern void *(*my_str_realloc)(void *, size_t); extern void (*my_str_free)(void *); +-#ifdef DBUG_OFF -#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER) -#define strmov(A,B) __builtin_stpcpy((A),(B)) -#elif defined(HAVE_STPCPY) -#define strmov(A,B) stpcpy((A),(B)) -#endif +-#endif - /* Declared in int2str() */ extern const char _dig_vec_upper[]; diff --git a/SOURCES/mysql-prepare-db-dir.sh b/SOURCES/mysql-prepare-db-dir.sh index 1905f09..94b90dd 100644 --- a/SOURCES/mysql-prepare-db-dir.sh +++ b/SOURCES/mysql-prepare-db-dir.sh @@ -36,54 +36,76 @@ else fi # Set up the errlogfile with appropriate permissions -touch "$errlogfile" -ret=$? -# Provide some advice if the log file cannot be touched -if [ $ret -ne 0 ] ; then - errlogdir=$(dirname $errlogfile) +if [ ! -e "$errlogfile" -a ! -h "$errlogfile" -a x$(dirname "$errlogfile") = "x/var/log" ]; then + case $(basename "$errlogfile") in + mysql*.log|mariadb*.log) install /dev/null -m0640 -o$myuser -g$mygroup "$errlogfile" ;; + *) ;; + esac +else + # Provide some advice if the log file cannot be created by this script + errlogdir=$(dirname "$errlogfile") if ! [ -d "$errlogdir" ] ; then - echo "The directory $errlogdir does not exist." - elif [ -f "$errlogfile" ] ; then - echo "The log file $errlogfile cannot be touched, please, fix its permissions." - else - echo "The log file $errlogfile could not be created." + echo "The directory $errlogdir does not exist." >&2 + exit 1 + elif [ -e "$errlogfile" -a ! -w "$errlogfile" ] ; then + echo "The log file $errlogfile cannot be written, please, fix its permissions." >&2 + echo "The daemon will be run under $myuser:$mygroup" >&2 + exit 1 fi - echo "The daemon will be run under $myuser:$mygroup" - exit 1 fi -chown "$myuser:$mygroup" "$errlogfile" -chmod 0640 "$errlogfile" -[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile" -# Make the data directory -if [ ! -d "$datadir/mysql" ] ; 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" ] - then - mkdir -p "$datadir" || exit 1 - fi - chown "$myuser:$mygroup" "$datadir" - chmod 0755 "$datadir" - [ -x /sbin/restorecon ] && /sbin/restorecon "$datadir" + + +export LC_ALL=C + +# 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 +# Some files or directories are fine to be there, so those are +# explicitly removed from the listing +# @param datadir +list_datadir () +{ + ( ls -1A "$1" 2>/dev/null || echo "fake-file" ) | grep -v \ + -e '^lost+found$' \ + -e '\.err$' \ + -e '^\.bash_history$' +} + +# Checks whether datadir should be initialized +# @param datadir +should_initialize () +{ + test -z "$(list_datadir "$1")" +} + +# Make the data directory if doesn't exist or empty +if should_initialize "$datadir" ; then # Now create the database - echo "Initializing @NICE_PROJECT_NAME@ database" - @bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser" + echo "Initializing @NICE_PROJECT_NAME@ database" >&2 + @bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser" >&2 ret=$? if [ $ret -ne 0 ] ; then echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2 echo "Perhaps @sysconfdir@/my.cnf is misconfigured." >&2 - # Clean up any partially-created database files - if [ ! -e "$datadir/mysql/user.frm" ] ; then - rm -rf "$datadir"/* - fi + echo "Note, that you may need to clean up any partially-created database files in $datadir" >&2 exit $ret fi # upgrade does not need to be run on a fresh datadir 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 @NICE_PROJECT_NAME@ 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 @NICE_PROJECT_NAME@ is not initialized, but the directory $datadir is not empty, so initialization cannot be done." >&2 + echo "Make sure the $datadir is empty before running `basename $0`." >&2 + exit 1 + fi fi exit 0 diff --git a/SOURCES/mysql-scripts-common.sh b/SOURCES/mysql-scripts-common.sh index 925cf9c..a65acc9 100644 --- a/SOURCES/mysql-scripts-common.sh +++ b/SOURCES/mysql-scripts-common.sh @@ -18,13 +18,23 @@ get_mysql_option(){ sections="$1" option_name="$2" default_value="$3" - result=`@bindir@/my_print_defaults $sections | sed -n "s/^--${option_name}=//p" | tail -n 1` + result=`@bindir@/my_print_defaults $my_print_defaults_extra_args $sections | sed -n "s/^--${option_name}=//p" | tail -n 1` if [ -z "$result" ]; then # not found, use default result="${default_value}" fi } +# For the case of running more instances via systemd, scrits that source +# this file can get --default-group-suffix or similar option as the first +# argument. The utility my_print_defaults needs to use it as well, so the +# scripts sourcing this file work with the same options as the daemon. +my_print_defaults_extra_args='' +while echo "$1" | grep -q '^--defaults' ; do + my_print_defaults_extra_args="${my_print_defaults_extra_args} $1" + shift +done + # Defaults here had better match what mysqld_safe will default to # The option values are generally defined on three important places # on the default installation: diff --git a/SOURCES/mysql.init.in b/SOURCES/mysql.init.in index 46c78c3..36d27e9 100644 --- a/SOURCES/mysql.init.in +++ b/SOURCES/mysql.init.in @@ -71,8 +71,8 @@ start(){ action $"Starting $prog: " /bin/true ret=0 else - @libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP || return 4 - @libexecdir@/mysql-check-socket || return 1 + @libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP >/dev/null || return 4 + @libexecdir@/mysql-check-socket >/dev/null || return 1 # Pass all the options determined above, to ensure consistent behavior. # In many cases mysqld_safe would arrive at the same conclusions anyway diff --git a/SOURCES/mysql@.service.in b/SOURCES/mysql@.service.in index ab9a7cd..720084d 100644 --- a/SOURCES/mysql@.service.in +++ b/SOURCES/mysql@.service.in @@ -41,14 +41,14 @@ Type=notify User=mysql Group=mysql -ExecStartPre=@libexecdir@/mysql-check-socket -ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n +ExecStartPre=@libexecdir@/mysql-check-socket --defaults-group-suffix=.%I +ExecStartPre=@libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n # MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf # Note: we set --basedir to prevent probes that might trigger SELinux alarms, # per bug #547485 ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER -ExecStartPost=@libexecdir@/mysql-check-upgrade -ExecStopPost=@libexecdir@/mysql-wait-stop +ExecStartPost=@libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I +ExecStopPost=@libexecdir@/mysql-wait-stop --defaults-group-suffix=.%I # Setting this to true can break replication and the Type=notify settings # See also bind-address mysqld option. diff --git a/SOURCES/rh-skipped-tests-base.list b/SOURCES/rh-skipped-tests-base.list index fb33990..400359d 100644 --- a/SOURCES/rh-skipped-tests-base.list +++ b/SOURCES/rh-skipped-tests-base.list @@ -1,14 +1,4 @@ # These tests fail with MariaDB 10: -main.userstat : 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_compress : rhbz#1096787 -main.ssl_timeout : rhbz#1096787 -perfschema.nesting : rhbz#1096787 -perfschema.socket_summary_by_event_name_func : rhbz#1096787 -perfschema.socket_summary_by_instance_func : rhbz#1096787 +main.multi_update : rhbz#1096787 diff --git a/SPECS/mariadb.spec b/SPECS/mariadb.spec index acbad64..2e38cc4 100644 --- a/SPECS/mariadb.spec +++ b/SPECS/mariadb.spec @@ -10,8 +10,8 @@ # --nocheck is not possible (e.g. in koji build) %{!?runselftest:%global runselftest 1} -# Set this to 1 to see which tests fail -%global check_testsuite 1 +# Set this to 1 to see which tests fail, but 0 on production ready build +%global ignore_testsuite_result 0 # In f20+ use unversioned docdirs, otherwise the old versioned one %global _pkgdocdirname %{pkg_name}%{!?_pkgdocdir:-%{version}} @@ -99,7 +99,7 @@ # MariaDB 10.0 and later requires pcre >= 8.35, otherwise we need to use # the bundled library, since the package cannot be build with older version -%global pcre_version 8.39 +%global pcre_version 8.41 %if 0%{?fedora} >= 21 %bcond_without pcre %else @@ -154,7 +154,7 @@ # Make long macros shorter %global sameevr %{epoch}:%{version}-%{release} %global compatver 10.1 -%global bugfixver 19 +%global bugfixver 29 %if 0%{?scl:1} %global scl_upper %{lua:print(string.upper(string.gsub(rpm.expand("%{scl}"), "-", "_")))} @@ -162,7 +162,7 @@ Name: %{?scl_prefix}mariadb Version: %{compatver}.%{bugfixver} -Release: 6%{?with_debug:.debug}%{?dist} +Release: 3%{?with_debug:.debug}%{?dist} Epoch: 1 Summary: A community developed branch of MySQL @@ -179,6 +179,7 @@ Source4: my_config.h Source5: README.mysql-cnf Source6: README.mysql-docs Source7: README.mysql-license +Source8: README.mariadb-devel Source9: mysql-embedded-check.c Source10: mysql.tmpfiles.d.in Source11: mysql.service.in @@ -202,27 +203,25 @@ Source72: mariadb-server-galera.te # Comments for these patches are in the patch files # Patches common for more mysql-like packages Patch1: %{pkgnamepatch}-strmov.patch -Patch2: %{pkgnamepatch}-install-test.patch Patch4: %{pkgnamepatch}-logrotate.patch Patch5: %{pkgnamepatch}-file-contents.patch Patch7: %{pkgnamepatch}-scripts.patch -Patch8: %{pkgnamepatch}-install-db-sharedir.patch Patch9: %{pkgnamepatch}-ownsetup.patch Patch10: %{pkgnamepatch}-noclientlib.patch Patch12: %{pkgnamepatch}-admincrash.patch +Patch13: %{pkgnamepatch}-ssl-cypher.patch # Patches specific for this mysql package Patch30: %{pkgnamepatch}-errno.patch -Patch31: %{pkgnamepatch}-string-overflow.patch Patch32: %{pkgnamepatch}-basedir.patch -Patch34: %{pkgnamepatch}-covscan-stroverflow.patch Patch37: %{pkgnamepatch}-notestdb.patch Patch38: %{pkgnamepatch}-servicename.patch # Patches for galera Patch40: %{pkgnamepatch}-galera.cnf.patch -Patch41: %{pkgnamepatch}-galera-new-cluster-help.patch Patch42: %{pkgnamepatch}-galera-new-cluster-init.patch +Patch43: %{pkgnamepatch}-recovery.patch +Patch44: %{pkgnamepatch}-recoverpath.patch # Patches specific for scl Patch90: %{pkgnamepatch}-scl-env-check.patch @@ -408,6 +407,7 @@ Requires(pre): systemd Requires(posttrans): systemd %{?systemd_requires: %systemd_requires} %endif +%{?scl:Requires(post): policycoreutils policycoreutils-python libselinux-utils} # mysqlhotcopy needs DBI/DBD support Requires: perl(DBI) Requires: perl(DBD::mysql) @@ -603,26 +603,27 @@ MariaDB is a community developed branch of MySQL. %prep %setup -q -n mariadb-%{version} +# Removt JAR files that upstream puts into tarball +find . -name "*.jar" -type f -exec rm --verbose -f {} \; + %patch1 -p1 -%patch2 -p1 %patch4 -p1 %patch5 -p1 %patch7 -p1 -%patch8 -p1 %patch9 -p1 %patch10 -p1 %patch12 -p1 +%patch13 -p1 %patch30 -p1 -%patch31 -p1 %patch32 -p1 -%patch34 -p1 %patch37 -p1 %patch38 -p1 %patch40 -p1 -%patch41 -p1 %if %{without init_systemd} %patch42 -p1 %endif +%patch43 -p1 +%patch44 -p1 sed -i -e 's/2.8.7/2.6.4/g' cmake/cpack_rpm.cmake @@ -814,7 +815,7 @@ install -p -m 0755 scripts/mysql_config_multilib %{buildroot}%{_bindir}/mysql_co # but that's pretty wacko --- see also %%{name}-file-contents.patch) install -p -m 644 Docs/INFO_SRC %{buildroot}%{_libdir}/mysql/ install -p -m 644 Docs/INFO_BIN %{buildroot}%{_libdir}/mysql/ -rm -rf %{buildroot}%{_pkgdocdir}/MariaDB-server-%{version}/ +rm -rf %{buildroot}%{_datadir}/doc/%{_pkgdocdirname}/MariaDB-server-%{version}/ mkdir -p %{buildroot}%{logfiledir} chmod 0750 %{buildroot}%{logfiledir} @@ -913,6 +914,7 @@ echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arc install -p -m 0644 %{SOURCE5} %{basename:%{SOURCE5}} install -p -m 0644 %{SOURCE6} %{basename:%{SOURCE6}} install -p -m 0644 %{SOURCE7} %{basename:%{SOURCE7}} +install -p -m 0644 %{SOURCE8} %{basename:%{SOURCE8}} install -p -m 0644 %{SOURCE16} %{basename:%{SOURCE16}} install -p -m 0644 %{SOURCE71} %{basename:%{SOURCE71}} @@ -927,8 +929,7 @@ install -p -m 0755 scripts/clustercheck %{buildroot}%{_bindir}/clustercheck # install the galera_new_cluster script anyway %if %{without init_systemd} -sed -i 's/@DAEMON_NAME@/%{name}/g' scripts/galera_new_cluster.sh -install -p -m 0755 scripts/galera_new_cluster.sh %{buildroot}%{_bindir}/galera_new_cluster +install -p -m 0755 scripts/galera_new_cluster %{buildroot}%{_bindir}/galera_new_cluster %endif # install the list of skipped tests to be available for user runs @@ -952,11 +953,8 @@ rm -f %{buildroot}%{_sysconfdir}/logrotate.d/mysql # remove solaris files rm -rf %{buildroot}%{_datadir}/%{pkg_name}/solaris/ -# remove *.jar file from mysql-test -rm -rf %{buildroot}%{_datadir}/mysql-test/plugin/connect/connect/std_data/JdbcMariaDB.jar - # rename the wsrep README so it corresponds with the other README names -mv Docs/README-wsrep Docs/README.wsrep +cp Docs/README-wsrep Docs/README.wsrep # remove *.jar file from mysql-test rm -rf %{buildroot}%{_datadir}/mysql-test/plugin/connect/connect/std_data/JdbcMariaDB.jar @@ -1064,7 +1062,7 @@ export MTR_BUILD_THREAD=%{__isa_bits} --suite-timeout=720 --testcase-timeout=30 \ --mysqld=--binlog-format=mixed --force-restart \ --shutdown-timeout=60 --max-test-fail=0 \ -%if %{check_testsuite} +%if %{ignore_testsuite_result} || : %else --skip-test-list=rh-skipped-tests.list @@ -1102,6 +1100,18 @@ semodule -i %{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp >/dev/ %endif %post server +%if 0%{?scl:1} +semanage fcontext -a -e "%{se_daemon_source}" "%{daemondir}/%{daemon_name}%{?with_init_systemd:.service}" >/dev/null 2>&1 || : +semanage fcontext -a -t mysqld_var_run_t "%{pidfiledir}" >/dev/null 2>&1 || : +# in order to avoid a race condition: https://bugzilla.redhat.com/show_bug.cgi?id=1463417#c4 +semanage fcontext -a -t mysqld_exec_t %{_root_libexecdir}/mysqld_safe_helper >/dev/null 2>&1 || : +selinuxenabled && load_policy || : +restorecon -R "%{?_scl_root}/" >/dev/null 2>&1 || : +restorecon -R "%{_sysconfdir}" >/dev/null 2>&1 || : +restorecon -R "%{_localstatedir}" >/dev/null 2>&1 || : +restorecon -R "%{daemondir}/%{daemon_name}%{?with_init_systemd:.service}" >/dev/null 2>&1 || : +restorecon -R "%{pidfiledir}" >/dev/null 2>&1 || : +%endif %if %{with init_systemd} %systemd_post %{daemon_name}.service %endif @@ -1199,7 +1209,7 @@ fi %if %{with common} %files common -%doc README COPYING COPYING.LESSER README.mysql-license README.mysql-docs +%doc README COPYING COPYING.thirdparty README.mysql-license README.mysql-docs README.mariadb-devel %doc storage/innobase/COPYING.Percona storage/innobase/COPYING.Google %dir %{_libdir}/mysql %dir %{_libdir}/mysql/plugin @@ -1262,6 +1272,8 @@ fi %if %{with init_systemd} %{_bindir}/mariadb-service-convert %endif +%{_bindir}/mariabackup +%{_bindir}/mbstream %{_bindir}/myisamchk %{_bindir}/myisam_ftdump %{_bindir}/myisamlog @@ -1278,6 +1290,7 @@ fi %{_bindir}/mysqldumpslow %{_bindir}/mysqld_multi %{_bindir}/mysqld_safe +%{_bindir}/mysqld_safe_helper %{_bindir}/mysqlhotcopy %{_bindir}/mysqltest %{_bindir}/innochecksum @@ -1288,10 +1301,24 @@ fi %{_bindir}/wsrep_sst_common %{_bindir}/wsrep_sst_mysqldump %{_bindir}/wsrep_sst_rsync +%{_bindir}/wsrep_sst_mariabackup %{_bindir}/wsrep_sst_xtrabackup %{_bindir}/wsrep_sst_xtrabackup-v2 %{?with_tokudb:%{_bindir}/tokuftdump} %{?with_tokudb:%{_bindir}/tokuft_logprint} +%{_mandir}/man1/galera_new_cluster.1.* +%{_mandir}/man1/galera_recovery.1.* +%{_mandir}/man1/mariadb-service-convert.1.* +%{_mandir}/man1/my_safe_process.1.* +%{_mandir}/man1/mysqld_safe_helper.1.* +%{_mandir}/man1/wsrep_sst_common.1.* +%{_mandir}/man1/wsrep_sst_mysqldump.1.* +%{_mandir}/man1/wsrep_sst_rsync.1.* +%{_mandir}/man1/wsrep_sst_xtrabackup-v2.1.* +%{_mandir}/man1/wsrep_sst_xtrabackup.1.* +%{_mandir}/man1/tokuftdump.1.* +%{_mandir}/man1/tokuft_logdump.1.* + %config(noreplace) %{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf %config(noreplace) %{_sysconfdir}/my.cnf.d/auth_gssapi.cnf @@ -1365,6 +1392,7 @@ fi %{_datadir}/%{pkg_name}/policy/apparmor/README %{_datadir}/%{pkg_name}/policy/apparmor/usr.sbin.mysqld* %{_datadir}/%{pkg_name}/policy/selinux/README +%{_datadir}/%{pkg_name}/policy/selinux/mariadb.* %{_datadir}/%{pkg_name}/policy/selinux/mariadb-server.* %if %{with init_systemd} %{_datadir}/%{pkg_name}/systemd/mariadb.service @@ -1440,10 +1468,59 @@ fi %endif %changelog -* Wed Nov 23 2016 Michal Schorm - 1:10.1.19-6 +* Fri Nov 24 2017 Honza Horak - 1:10.1.29-3 +- Use selinux for the mysqld_safe_helper also on RHEL-6 + Related: #1463417 +- Print the same messages as before when starting the service in SysV init, + to not scare users + Related: #1463411 + +* Thu Nov 23 2017 Honza Horak - 1:10.1.29-2 +- Remove jar files used for testing from the source + Related: #1463417 + +* Thu Nov 16 2017 Honza Horak - 1:10.1.29-1 +- Update to 10.1.29 + Also fixes: CVE-2017-10378, MDEV-13819, CVE-2017-10268 + Related: #1463417 + +* Mon Aug 28 2017 Honza Horak - 1:10.1.26-2 +- SCL-ize file mariadb@.service and support --defaults-group-suffix + Resolves: #1485777 + +* Mon Aug 14 2017 Honza Horak - 1:10.1.26-1 +- Update to 10.1.26 +- Remove mariadb-covscan-stroverflow.patch that was fixed upstream +- Update bundled pcre version to 8.41 + Related: #1463417 + +* Thu Jul 20 2017 Honza Horak - 1:10.1.25-1 +- Rebase to latest upstream 10.1.25 + Related: #1463417 + +* Tue Jul 18 2017 Honza Horak - 1:10.1.24-2 +- Fix paths in galera_recovery and galera_new_cluster + Resolves: #1403416 + +* Tue Dec 20 2016 Honza Horak - 1:10.1.20-1 +- Rebase to version 10.1.24 + Also fixes: CVE-2016-5617/CVE-2016-6664 CVE-2017-3312 CVE-2017-3238 + CVE-2017-3243 CVE-2017-3244 CVE-2017-3257 CVE-2017-3258 CVE-2017-3313 + CVE-2017-3317 CVE-2017-3318 CVE-2017-3291 CVE-2017-3302 CVE-2017-3308 + CVE-2017-3309 CVE-2017-3453 CVE-2017-3456 CVE-2017-3464 + Resolves: #1463417 +- Fix mysql-prepare-db-dir for CVE-2017-3265 + Resolves: #1463412 +- Use correct directories to search for language files + Resolves: #1406391 +- Fix SELinux context for the daemon + Resolves: #1336806 + +* Wed Nov 23 2016 Michal Schorm - 1:10.1.19-7 - Rebase to version 10.1.19 - JdbcMariaDB.jar test removed - PCRE version check added +- All test removed from blacklist, 2 new added to blacklist Related: #1393306, #1396934 Also fix: CVE-2016-3492 CVE-2016-5616 CVE-2016-5624 CVE-2016-5626 CVE-2016-5629 CVE-2016-6662 CVE-2016-6663 CVE-2016-8283