You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adduser --ingroup mysql --system --disabled-login --no-create-home --home ${MYSQLDATA} --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
89
90
fi
90
-
91
+
ERROR_FLAG=0
91
92
if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ]; then
92
-
install -d -m0750 -omysql -gmysql ${MYSQLDATA}
93
+
if [ "$(dirname "${MYSQLDATA}")" = "/var/lib" ]; then
94
+
install -d -m0750 -omysql -gmysql ${MYSQLDATA}
95
+
else
96
+
echo "Error: Datadir ${MYSQLDATA} does not exist. For security reasons the service will not automatically create directories outside /var/lib.."
97
+
ERROR_FLAG=1
98
+
fi
93
99
fi
94
100
95
101
if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ]; then
96
-
install -d -m0770 -omysql -gmysql ${MYSQLFILES}
102
+
if [ "$(dirname "${MYSQLFILES}")" = "/var/lib" -o ${MYSQLFILES} = NULL ]; then
103
+
install -d -m0770 -omysql -gmysql ${MYSQLFILES}
104
+
else
105
+
echo "Error: Secure-file-priv dir ${MYSQLFILES} does not exist. For security reasons the service will not automatically create directories outside /var/lib."
106
+
ERROR_FLAG=1
107
+
fi
97
108
fi
98
109
99
110
if [ ! -d ${MYSQLKEYRING} -a ! -L ${MYSQLKEYRING} ]; then
100
-
install -d -m0750 -omysql -gmysql ${MYSQLKEYRING}
111
+
if [ "$(dirname "${MYSQLKEYRING}")" = "/var/lib" ]; then
112
+
install -d -m0750 -omysql -gmysql ${MYSQLKEYRING}
113
+
else
114
+
echo "Warning: Keyring dir ${MYSQLKEYRING} does not exist. For security reasons the service will not automatically create directories outside /var/lib. The server may not start correctly."
0 commit comments