mariadb/mariadb-auth_pam_tool_dir.patch

30 lines
1.1 KiB
Diff
Raw Normal View History

2019-06-20 16:09:56 +00:00
This scirpt is ran by the systemd service.
In Fedora the service has priviledges dropped to the mysql user.
Thus "chown 0" will always fail
Never parse 'ls' output!
http://mywiki.wooledge.org/BashFAQ/087
2019-08-22 14:31:37 +00:00
--- mariadb-10.4.7/scripts/mysql_install_db.sh 2019-07-30 13:32:16.000000000 +0200
+++ mariadb-10.4.7/scripts/mysql_install_db.sh_patched 2019-08-22 16:29:28.341484925 +0200
@@ -490,13 +490,16 @@ then
2019-06-20 16:09:56 +00:00
fi
if test -z "$srcdir"
then
2019-08-22 14:31:37 +00:00
- chown 0 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" && \
- chmod 04755 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool"
2019-06-20 16:09:56 +00:00
- if test $? -ne 0
+ if [ `stat "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" -c %u` -ne 0 ]
then
2019-08-22 14:31:37 +00:00
+ chown 0 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" && \
+ chmod 04755 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool"
2019-06-20 16:09:56 +00:00
+ if test $? -ne 0
+ then
2019-08-22 14:31:37 +00:00
echo "Couldn't set an owner to '$pamtooldir/auth_pam_tool_dir/auth_pam_tool'."
echo " It must be root, the PAM authentication plugin doesn't work otherwise.."
echo
2019-06-20 16:09:56 +00:00
+ fi
fi
fi
args="$args --user=$user"