30 lines
1.2 KiB
Diff
30 lines
1.2 KiB
Diff
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
|
|
|
|
--- mariadb-10.5.26-downstream_modified/scripts/mysql_install_db.sh 2024-08-03 08:57:42.000000000 +0200
|
|
+++ mariadb-10.5.26-downstream_modified/scripts/mysql_install_db.sh_patched 2024-10-19 13:50:46.157063739 +0200
|
|
@@ -494,13 +494,16 @@ if test -n "$user"
|
|
then
|
|
if test -z "$srcdir" -a "$in_rpm" -eq 0 -a -d "$pamtooldir/auth_pam_tool_dir"
|
|
then
|
|
- chown 0 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" && \
|
|
- chmod 04755 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool"
|
|
- if test $? -ne 0
|
|
+ if [ `stat "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" -c %u` -ne 0 ]
|
|
then
|
|
+ chown 0 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool" && \
|
|
+ chmod 04755 "$pamtooldir/auth_pam_tool_dir/auth_pam_tool"
|
|
+ if test $? -ne 0
|
|
+ then
|
|
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
|
|
+ fi
|
|
fi
|
|
chown $user "$pamtooldir/auth_pam_tool_dir" && \
|
|
chmod 0700 "$pamtooldir/auth_pam_tool_dir"
|