aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2023-09-26 17:04:16 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2023-09-27 13:02:28 +0000
commitee6121a7a096d1fe9dd117de2269ce34c7e9c868 (patch)
tree267a6a0883f1afc517756dc6d3787508024f4df2
parentdc1033759a68899bf02740298240d5a638b87873 (diff)
main/mariadb: don't create /var/lib/mysql by adduser, change its perms to 750
adduser automatically copies /etc/skel/* to the create home directory and also creates it with mode 755. That's why it should be created by the package, not pre-install script.
-rw-r--r--main/mariadb/APKBUILD4
-rw-r--r--main/mariadb/mariadb.pre-install2
2 files changed, 4 insertions, 2 deletions
diff --git a/main/mariadb/APKBUILD b/main/mariadb/APKBUILD
index 3818ad560d6..a2854807cba 100644
--- a/main/mariadb/APKBUILD
+++ b/main/mariadb/APKBUILD
@@ -8,7 +8,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mariadb
pkgver=10.11.5
-pkgrel=2
+pkgrel=3
pkgdesc="A fast SQL database server"
url="https://www.mariadb.org/"
pkgusers="mysql"
@@ -356,6 +356,8 @@ package() {
"$pkgdir"/usr/lib/libmariadb.so* \
"$pkgdir"/usr/lib/pkgconfig/libmariadb.pc
+ install -d -m750 -o mysql -g mysql "$pkgdir"/usr/lib/mysql
+
cat >"$pkgdir"/etc/my.cnf<<-EOF
# This group is read both both by the client and the server
# use it for options that affect everything
diff --git a/main/mariadb/mariadb.pre-install b/main/mariadb/mariadb.pre-install
index 2ab1374c764..5b2695f8078 100644
--- a/main/mariadb/mariadb.pre-install
+++ b/main/mariadb/mariadb.pre-install
@@ -1,6 +1,6 @@
#!/bin/sh
addgroup -S mysql 2>/dev/null
-adduser -S -D -h /var/lib/mysql -s /sbin/nologin -G mysql -g mysql mysql 2>/dev/null
+adduser -S -D -H -h /var/lib/mysql -s /sbin/nologin -G mysql -g mysql mysql 2>/dev/null
exit 0