修改 pre 和 postun 中对 mysql 用户的处理逻辑
Signed-off-by: herengui <herengui@uniontech.com>
This commit is contained in:
parent
052b2ee5fd
commit
7d66291b85
15
mysql.spec
15
mysql.spec
@ -7,7 +7,7 @@
|
|||||||
%global boost_bundled_version 1.73.0
|
%global boost_bundled_version 1.73.0
|
||||||
Name: mysql
|
Name: mysql
|
||||||
Version: 8.0.26
|
Version: 8.0.26
|
||||||
Release: 1
|
Release: 2
|
||||||
License: GPLv2 with exceptions and LGPLv2 and BSD
|
License: GPLv2 with exceptions and LGPLv2 and BSD
|
||||||
Summary: The world's most popular open source database
|
Summary: The world's most popular open source database
|
||||||
URL: http://www.mysql.com/
|
URL: http://www.mysql.com/
|
||||||
@ -74,9 +74,9 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql/data
|
|||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
if ! id %{name} > /dev/null 2>&1;then
|
/usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || :
|
||||||
useradd -M -s /sbin/nologin %{name}
|
/usr/sbin/useradd -M -N -g mysql -o -r -d %{_sharedstatedir}/mysql -s /sbin/nologin \
|
||||||
fi
|
-c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
|
||||||
|
|
||||||
%post
|
%post
|
||||||
if [ -f %{_prefix}/local/%{name}/support-files/mysql.server > /dev/null 2>&1 ] && [ ! -f %{_initddir}/mysql > /dev/null 2>&1 ];then
|
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
|
fi
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
if [ "$1" = 0 ];then
|
|
||||||
userdel -r %{name} &>/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%dir %{_prefix}/local/%{name}
|
%dir %{_prefix}/local/%{name}
|
||||||
@ -116,6 +113,10 @@ fi
|
|||||||
%exclude /usr/lib/debug
|
%exclude /usr/lib/debug
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Aug 23 2021 herengui <herengui@uniontech.com> - 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 <liwu13@huawei.com> - 8.0.26-1
|
* Mon Aug 2 2021 liwu <liwu13@huawei.com> - 8.0.26-1
|
||||||
- Upgrade mysql to 8.0.26,fix CVES:CVE-2021-2356,CVE-2021-2339,CVE-2021-2354
|
- Upgrade mysql to 8.0.26,fix CVES:CVE-2021-2356,CVE-2021-2339,CVE-2021-2354
|
||||||
CVE-2021-2352,CVE-2021-2340
|
CVE-2021-2352,CVE-2021-2340
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user