From 39db22ec95d24a90fedd82d15d756e160cfca983 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 24 May 2020 10:41:09 +0200 Subject: [PATCH] mariadb: use default umask for rundir rundir needs to be accessible for clients, hence o= is not the proper permission for rundir. This commit breaks out rundir from the awk script and sets it up with default umask. This also removes chmod call and instead tells mkdir to create the directories with the proper permissions directly. Signed-off-by: Sebastian Kemper --- utils/mariadb/Makefile | 2 +- utils/mariadb/files/mysqld.init | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/utils/mariadb/Makefile b/utils/mariadb/Makefile index 8e1f1d7b7..fc6e9495d 100644 --- a/utils/mariadb/Makefile +++ b/utils/mariadb/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mariadb PKG_VERSION:=10.2.32 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL := \ diff --git a/utils/mariadb/files/mysqld.init b/utils/mariadb/files/mysqld.init index 66afb35bc..7bd0037d9 100644 --- a/utils/mariadb/files/mysqld.init +++ b/utils/mariadb/files/mysqld.init @@ -110,27 +110,31 @@ start_service() { -v group="$group" \ -v a="$datadir" \ -v b="$logdir" \ - -v c="$rundir" \ - -v d="$tmpdir" \ + -v c="$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("mkdir -p -m 0750 \"" dir[x] "\"" ) system("chown \"" user "\":\"" group "\" \"" dir[x] "\"" ) } } ' + if ! [ -e "$rundir" ]; then + # $rundir needs to be accessible for + # clients + mkdir -p "$rundir" + [ -d "$rundir" ] && chown "$user":"$group" "$rundir" + fi + if [ ! -f "$datadir/mysql/tables_priv.MYD" ]; then local args="--force" local basedir=$(mysqld_get_param basedir)