mariadb/mariadb-auth_pam_tool_dir.patch
2020-10-22 14:02:19 +02:00

35 lines
1.4 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
diff -Nau mariadb-10.5.0/scripts/mysql_install_db.sh.old mariadb-10.5.0/scripts/mysql_install_db.sh
--- mariadb-10.5.0/scripts/mysql_install_db.sh.old 2020-09-08 15:20:02.075081944 +0200
+++ mariadb-10.5.0/scripts/mysql_install_db.sh 2020-09-08 15:21:36.251043330 +0200
@@ -490,13 +490,16 @@
fi
if test -z "$srcdir"
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
- 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
+ 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
fi
args="$args --user=$user"