Commit dc5f2824 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-5303 rpm post-inst scriptlet creates mysql user with a valid shell

create mysql user with /sbin/nologin shell
parent 18b27a37
......@@ -23,9 +23,9 @@ if [ $1 = 1 ] ; then
# Create a MySQL user and group. Do not report any problems if it already
# exists.
groupadd -r %{mysqld_group} 2> /dev/null || true
useradd -M -r -d $datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
useradd -M -r --home $datadir --shell /sbin/nologin --comment "MySQL server" --gid %{mysqld_group} %{mysqld_user} 2> /dev/null || true
# The user may already exist, make sure it has the proper group nevertheless (BUG#12823)
usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
usermod --gid %{mysqld_group} %{mysqld_user} 2> /dev/null || true
# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment