Skip to content

Commit 62dfd0c

Browse files
illuusiogrooverdan
authored andcommitted
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:*]
1 parent 972879f commit 62dfd0c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

debian/mariadb-server-10.5.postinst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,12 @@ EOF
128128
# The mysql_statedir must not be writable by the mysql user under any
129129
# circumstances as it contains scripts that are executed by root.
130130
set +e
131-
chown -R 0:0 $mysql_statedir
132-
find $mysql_datadir ! -uid "$(id -u mysql)" -print0 | xargs -0 -r chown mysql
133-
chown -R mysql:adm $mysql_logdir
134-
chmod 2750 $mysql_logdir
131+
chown 0:0 "$mysql_statedir"
132+
find "$mysql_statedir" ! -uid 0 -print0 | xargs -0 -r chown 0:0
133+
find "$mysql_datadir" ! -uid "$(id -u mysql)" -print0 | xargs -0 -r chown mysql
134+
chown mysql:adm "$mysql_logdir"
135+
find "$mysql_logdir" -print0 | xargs -0 -r chown mysql:adm
136+
chmod 2750 "$mysql_logdir"
135137
set -e
136138

137139
## Set the correct filesystem ownership for the PAM v2 plugin

0 commit comments

Comments
 (0)