blob: 3c466185b4b63fe41b630b85c99e9f8e2a8944a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
From 7e4faa6aa71e84193a3fd9a40cfa6fca0c52d496 Mon Sep 17 00:00:00 2001
From: Sergei Golubchik <serg@mariadb.org>
Date: Thu, 29 Sep 2016 10:16:24 +0200
Subject: [PATCH 2/3] mysqld_safe: close stdout and stderr
when they're not needed anymore. Helps when
daemonizing it from mysql.init
Upstream-Status: Backport
CVE: CVE-2016-6664 patch#2
Signed-off-by: Sunil Kumar <sukumar@mvista.com>
---
scripts/mysqld_safe.sh | 6 +++++-
support-files/mysql.server.sh | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 7f18abb3dc2..7cadce725d1 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -620,6 +620,10 @@ else
logging=syslog
fi
+# close stdout and stderr, everything goes to $logging now
+exec 1>&-
+exec 2>&-
+
USER_OPTION=""
if test -w / -o "$USER" = "root"
then
@@ -650,7 +654,7 @@ if [ ! -d $mysql_unix_port_dir ]
then
if ! `mkdir -p $mysql_unix_port_dir`
then
- echo "Fatal error Can't create database directory '$mysql_unix_port'"
+ log_error "Fatal error Can't create database directory '$mysql_unix_port'"
exit 1
fi
chown $user $mysql_unix_port_dir
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index e5c8814f930..d4fff33af13 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -308,7 +308,7 @@ case "$mode" in
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
- $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &
+ $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args &
wait_for_ready; return_value=$?
# Make lock for RedHat / SuSE
--
2.11.1
|