mysqld_safe could generate filenames with spaces and then didn't properly

quote them in later use. (Bug #33685, based on a patch by Hartmut Holzgraefe)
This commit is contained in:
Jim Winstead 2009-05-07 17:25:23 -07:00
parent 850f6c2225
commit d115236248

View File

@ -391,8 +391,8 @@ then
fi fi
# Change the err log to the right user, if it is in use # Change the err log to the right user, if it is in use
if [ $want_syslog -eq 0 ]; then if [ $want_syslog -eq 0 ]; then
touch $err_log touch "$err_log"
chown $user $err_log chown $user "$err_log"
fi fi
if test -n "$open_files" if test -n "$open_files"
then then
@ -509,9 +509,9 @@ fi
# #
# If there exists an old pid file, check if the daemon is already running # If there exists an old pid file, check if the daemon is already running
# Note: The switches to 'ps' may depend on your operating system # Note: The switches to 'ps' may depend on your operating system
if test -f $pid_file if test -f "$pid_file"
then then
PID=`cat $pid_file` PID=`cat "$pid_file"`
if @CHECK_PID@ if @CHECK_PID@
then then
if @FIND_PROC@ if @FIND_PROC@
@ -520,8 +520,8 @@ then
exit 1 exit 1
fi fi
fi fi
rm -f $pid_file rm -f "$pid_file"
if test -f $pid_file if test -f "$pid_file"
then then
log_error "Fatal error: Can't remove the pid file: log_error "Fatal error: Can't remove the pid file:
$pid_file $pid_file
@ -563,11 +563,11 @@ test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null"
log_notice "Starting $MYSQLD daemon with databases from $DATADIR" log_notice "Starting $MYSQLD daemon with databases from $DATADIR"
while true while true
do do
rm -f $safe_mysql_unix_port $pid_file # Some extra safety rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety
eval_log_error "$cmd" eval_log_error "$cmd"
if test ! -f $pid_file # This is removed if normal shutdown if test ! -f "$pid_file" # This is removed if normal shutdown
then then
break break
fi fi