Merge pull request #8948 from micmac1/maria10224
mariadb: security bump + init script brush-up
This commit is contained in:
commit
f681ca8bf2
4 changed files with 75 additions and 21 deletions
|
@ -8,7 +8,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=mariadb
|
PKG_NAME:=mariadb
|
||||||
PKG_VERSION:=10.2.22
|
PKG_VERSION:=10.2.24
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
|
@ -18,11 +18,13 @@ PKG_SOURCE_URL := \
|
||||||
https://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/$(PKG_NAME)-$(PKG_VERSION)/source \
|
https://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/$(PKG_NAME)-$(PKG_VERSION)/source \
|
||||||
https://downloads.mariadb.org/interstitial/$(PKG_NAME)-$(PKG_VERSION)/source
|
https://downloads.mariadb.org/interstitial/$(PKG_NAME)-$(PKG_VERSION)/source
|
||||||
|
|
||||||
PKG_HASH:=42f4c54c29b7c196bd105bbf4d2ea721f869b14cb7ba436c3566e6dd2760614c
|
PKG_HASH:=97f4d924e69f77abb2f650116785c2f5ef356230442534ebcbaadb51d9bb8bc4
|
||||||
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
|
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
|
||||||
PKG_LICENSE:=GPL-2.0 LGPL-2.1
|
PKG_LICENSE:=GPL-2.0 LGPL-2.1
|
||||||
PKG_LICENSE_FILES:=COPYING libmariadb/COPYING.LIB
|
PKG_LICENSE_FILES:=COPYING libmariadb/COPYING.LIB
|
||||||
|
|
||||||
|
PKG_CPE_ID:=cpe:/a:mariadb:mariadb
|
||||||
|
|
||||||
HOST_BUILD_PARALLEL:=1
|
HOST_BUILD_PARALLEL:=1
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
PKG_USE_MIPS16:=0
|
PKG_USE_MIPS16:=0
|
||||||
|
@ -200,10 +202,7 @@ define Package/mariadb/install/plugin
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/mariadb/description/Default
|
define Package/mariadb/description/Default
|
||||||
MariaDB is a fast, stable and true multi-user, multi-threaded SQL
|
MariaDB is a very fast and robust SQL database server.
|
||||||
database server. SQL (Structured Query Language) is the most popular
|
|
||||||
database query language in the world. The main goals of MariaDB are
|
|
||||||
speed, robustness and ease of use.
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/libmariadb/Default
|
define Package/libmariadb/Default
|
||||||
|
|
|
@ -10,7 +10,7 @@ USE_PROCD=1
|
||||||
|
|
||||||
NAME=mysqld
|
NAME=mysqld
|
||||||
|
|
||||||
LOGGER="/usr/bin/logger -p user.err -s -t $NAME"
|
LOGGER="/usr/bin/logger -p user.err -s -t $NAME --"
|
||||||
COMMAND=/usr/bin/$NAME
|
COMMAND=/usr/bin/$NAME
|
||||||
|
|
||||||
mysqld_get_param() {
|
mysqld_get_param() {
|
||||||
|
@ -24,7 +24,10 @@ mysqld_get_param() {
|
||||||
start_service() {
|
start_service() {
|
||||||
local conf=/etc/mysql/my.cnf
|
local conf=/etc/mysql/my.cnf
|
||||||
local dir
|
local dir
|
||||||
local user=mariadb
|
local user
|
||||||
|
local group
|
||||||
|
|
||||||
|
local logfile
|
||||||
|
|
||||||
local datadir
|
local datadir
|
||||||
local logdir=/var/log/mysql
|
local logdir=/var/log/mysql
|
||||||
|
@ -36,6 +39,8 @@ start_service() {
|
||||||
local log_stdout
|
local log_stdout
|
||||||
local options
|
local options
|
||||||
|
|
||||||
|
local hint="please fix your server configuration in /etc/mysql/"
|
||||||
|
|
||||||
if [ ! -x $COMMAND ]; then
|
if [ ! -x $COMMAND ]; then
|
||||||
$LOGGER $COMMAND is missing
|
$LOGGER $COMMAND is missing
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -60,30 +65,80 @@ start_service() {
|
||||||
config_get options general options
|
config_get options general options
|
||||||
|
|
||||||
datadir=$(mysqld_get_param datadir)
|
datadir=$(mysqld_get_param datadir)
|
||||||
|
logfile=$(mysqld_get_param general_log_file)
|
||||||
tmpdir=$(mysqld_get_param tmpdir)
|
tmpdir=$(mysqld_get_param tmpdir)
|
||||||
|
user=$(mysqld_get_param user)
|
||||||
|
|
||||||
if [ -z "$datadir" ]; then
|
if [ -z "$datadir" ]; then
|
||||||
$LOGGER datadir is not set
|
$LOGGER datadir is not set
|
||||||
|
$LOGGER $hint
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$tmpdir" ]; then
|
if [ -z "$tmpdir" ]; then
|
||||||
$LOGGER tmpdir is not set.
|
$LOGGER tmpdir is not set
|
||||||
|
$LOGGER $hint
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -e "$datadir" ] || mkdir -p "$datadir"
|
if [ -z "$user" ]; then
|
||||||
|
$LOGGER user is not set
|
||||||
|
$LOGGER $hint
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
for dir in "$logdir" "$rundir" "$tmpdir"; do
|
user_exists "$user" || {
|
||||||
if [ ! -e "$dir" ]; then
|
$LOGGER user \""$user"\" does not exist
|
||||||
mkdir -p "$dir"
|
$LOGGER $hint
|
||||||
chown $user "$dir"
|
exit 1
|
||||||
fi
|
}
|
||||||
done
|
|
||||||
|
group=$(id -g -n "$user")
|
||||||
|
|
||||||
|
group_exists "$group" || {
|
||||||
|
$LOGGER group \""$group"\" does not exist
|
||||||
|
$LOGGER user \""$user"\" not configured correctly
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
[ -n "$logfile" ] && logdir=$(dirname "$logfile")
|
||||||
|
|
||||||
|
# do not touch directories that already exist
|
||||||
|
# posix shell does not support arrays, hence using awk
|
||||||
|
awk \
|
||||||
|
-v user="$user" \
|
||||||
|
-v group="$group" \
|
||||||
|
-v a="$datadir" \
|
||||||
|
-v b="$logdir" \
|
||||||
|
-v c="$rundir" \
|
||||||
|
-v d="$tmpdir" \
|
||||||
|
'
|
||||||
|
BEGIN {
|
||||||
|
dir[0]=a
|
||||||
|
dir[1]=b
|
||||||
|
dir[2]=c
|
||||||
|
dir[3]=d
|
||||||
|
for (x in dir) {
|
||||||
|
if (system("test ! -e \"" dir[x] "\"" )) {
|
||||||
|
delete dir[x]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (x in dir) {
|
||||||
|
system("mkdir -p \"" dir[x] "\"" )
|
||||||
|
system("chmod 750 \"" dir[x] "\"" )
|
||||||
|
system("chown \"" user "\":\"" group "\" \"" dir[x] "\"" )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
|
||||||
if [ ! -f "$datadir/mysql/tables_priv.MYD" ]; then
|
if [ ! -f "$datadir/mysql/tables_priv.MYD" ]; then
|
||||||
$LOGGER "cannot detect privileges table, you might need to"
|
local args="--force"
|
||||||
$LOGGER "run 'mysql_install_db --force' to initialize the system tables"
|
local basedir=$(mysqld_get_param basedir)
|
||||||
|
[ -n "$basedir" ] && args="$args --basedir=$basedir"
|
||||||
|
|
||||||
|
$LOGGER Cannot detect privileges table. You might need to run
|
||||||
|
$LOGGER \'mysql_install_db $args\'
|
||||||
|
$LOGGER to initialize the system tables.
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/scripts/mysql_install_db.sh
|
--- a/scripts/mysql_install_db.sh
|
||||||
+++ b/scripts/mysql_install_db.sh
|
+++ b/scripts/mysql_install_db.sh
|
||||||
@@ -399,7 +399,7 @@ fi
|
@@ -403,7 +403,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
# Try to determine the hostname
|
# Try to determine the hostname
|
||||||
|
|
|
@ -53,7 +53,7 @@ directly was the first solution adopted in MariaDB [2].
|
||||||
# define UT_RESUME_PRIORITY_CPU() ((void)0)
|
# define UT_RESUME_PRIORITY_CPU() ((void)0)
|
||||||
--- a/storage/innobase/include/ut0ut.h
|
--- a/storage/innobase/include/ut0ut.h
|
||||||
+++ b/storage/innobase/include/ut0ut.h
|
+++ b/storage/innobase/include/ut0ut.h
|
||||||
@@ -70,9 +70,8 @@ typedef time_t ib_time_t;
|
@@ -71,9 +71,8 @@ typedef time_t ib_time_t;
|
||||||
the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
|
the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
|
||||||
independent way by using YieldProcessor. */
|
independent way by using YieldProcessor. */
|
||||||
# define UT_RELAX_CPU() YieldProcessor()
|
# define UT_RELAX_CPU() YieldProcessor()
|
||||||
|
@ -65,7 +65,7 @@ directly was the first solution adopted in MariaDB [2].
|
||||||
#else
|
#else
|
||||||
# define UT_RELAX_CPU() do { \
|
# define UT_RELAX_CPU() do { \
|
||||||
volatile int32 volatile_var; \
|
volatile int32 volatile_var; \
|
||||||
@@ -90,9 +89,8 @@ typedef time_t ib_time_t;
|
@@ -91,9 +90,8 @@ typedef time_t ib_time_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_HMT_PRIORITY_INSTRUCTION)
|
#if defined(HAVE_HMT_PRIORITY_INSTRUCTION)
|
||||||
|
|
Loading…
Reference in a new issue