Skip to content

Commit 7a5145e

Browse files
committed
Bug#24516262 PRIVILEGE ESCALATION USING MYSQL_PRE_SYSTEMD
Post push fix: create error log only if it matches pattern /var/log/mysql*.log
1 parent 7356fb7 commit 7a5145e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/systemd/mysqld_pre_systemd.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ install_db () {
4848

4949
[ -d "$datadir" ] || install -d -m 0751 -o@MYSQLD_USER@ -g@MYSQLD_USER@ "$datadir" || exit 1
5050

51-
if [ ! -e "$log" -a ! -h "$log" -a -O "$(dirname "$log")" ]; then
52-
touch "$log"
53-
chmod 0640 "$log"
54-
chown @MYSQLD_USER@:@MYSQLD_USER@ "$log" || exit 1
51+
if [ ! -e "$log" -a ! -h "$log" -a x$(dirname "$log") = "x/var/log" ]; then
52+
case $(basename "$log") in
53+
mysql*.log) install /dev/null -m0640 -o@MYSQLD_USER@ -g@MYSQLD_USER@ "$log" ;;
54+
*) ;;
55+
esac
5556
fi
5657

5758
if [ -x /usr/sbin/restorecon ]; then

0 commit comments

Comments
 (0)