From 62dfd0c09dc2f138075047e726f2cab592807edb Mon Sep 17 00:00:00 2001 From: Tuukka Pasanen Date: Fri, 14 Jun 2024 09:51:44 +0300 Subject: [PATCH] MDEV-33837: Workaround chown warnings Blindly recursive chown is not way to do it. This Workaround is not much better than just chown -R but there is small adjustment just chown MariaDB statedir and logdir then with find only chown those files that are not correctly owned. Fixes lintian warnings: * W: mariadb-server: recursive-privilege-change "chown -R" [postinst:*] * W: mariadb-server: recursive-privilege-change "chown -R" [postinst:*] --- debian/mariadb-server-10.5.postinst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/debian/mariadb-server-10.5.postinst b/debian/mariadb-server-10.5.postinst index d6017f32169..0d84d943258 100644 --- a/debian/mariadb-server-10.5.postinst +++ b/debian/mariadb-server-10.5.postinst @@ -128,10 +128,12 @@ EOF # The mysql_statedir must not be writable by the mysql user under any # circumstances as it contains scripts that are executed by root. set +e - chown -R 0:0 $mysql_statedir - find $mysql_datadir ! -uid "$(id -u mysql)" -print0 | xargs -0 -r chown mysql - chown -R mysql:adm $mysql_logdir - chmod 2750 $mysql_logdir + chown 0:0 "$mysql_statedir" + find "$mysql_statedir" ! -uid 0 -print0 | xargs -0 -r chown 0:0 + find "$mysql_datadir" ! -uid "$(id -u mysql)" -print0 | xargs -0 -r chown mysql + chown mysql:adm "$mysql_logdir" + find "$mysql_logdir" -print0 | xargs -0 -r chown mysql:adm + chmod 2750 "$mysql_logdir" set -e ## Set the correct filesystem ownership for the PAM v2 plugin