From 55723fb9ee76a79e2eccb90144e270b165deb362 Mon Sep 17 00:00:00 2001 From: herengui Date: Mon, 23 Aug 2021 13:22:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20pre=20=E5=92=8C=20postun?= =?UTF-8?q?=20=E4=B8=AD=E5=AF=B9=20mysql=20=E7=94=A8=E6=88=B7=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: herengui --- mysql.spec | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mysql.spec b/mysql.spec index fb350c2..dced56e 100644 --- a/mysql.spec +++ b/mysql.spec @@ -7,7 +7,7 @@ %global boost_bundled_version 1.73.0 Name: mysql Version: 8.0.26 -Release: 1 +Release: 2 License: GPLv2 with exceptions and LGPLv2 and BSD Summary: The world's most popular open source database URL: http://www.mysql.com/ @@ -74,9 +74,9 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql/data rm -rf %{buildroot} %pre -if ! id %{name} > /dev/null 2>&1;then - useradd -M -s /sbin/nologin %{name} -fi +/usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || : +/usr/sbin/useradd -M -N -g mysql -o -r -d %{_sharedstatedir}/mysql -s /sbin/nologin \ + -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || : %post if [ -f %{_prefix}/local/%{name}/support-files/mysql.server > /dev/null 2>&1 ] && [ ! -f %{_initddir}/mysql > /dev/null 2>&1 ];then @@ -105,9 +105,6 @@ if [ "$1" = 0 ];then fi %postun -if [ "$1" = 0 ];then - userdel -r %{name} &>/dev/null -fi %files %dir %{_prefix}/local/%{name} @@ -116,6 +113,10 @@ fi %exclude /usr/lib/debug %changelog +* Mon Aug 23 2021 herengui - 8.0.26-2 +- The user mysql should not be deleted when mysql is uninstalled + Set the mysql user/group to use a fixed uid/gid 27 + * Mon Aug 2 2021 liwu - 8.0.26-1 - Upgrade mysql to 8.0.26,fix CVES:CVE-2021-2356,CVE-2021-2339,CVE-2021-2354 CVE-2021-2352,CVE-2021-2340 -- Gitee