mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Don't allow multiple --user options to mysqld
(First one is used) scripts/safe_mysqld.sh: Don't allow multiple --user options sql/mysqld.cc: Don't allow multiple --user options
This commit is contained in:
@ -33,8 +33,12 @@ parse_arguments() {
|
|||||||
--basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;;
|
--basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;;
|
||||||
--datadir=*) DATADIR=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;;
|
--datadir=*) DATADIR=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;;
|
||||||
--pid-file=*) pid_file=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;;
|
--pid-file=*) pid_file=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;;
|
||||||
--user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;;
|
--user=*)
|
||||||
|
if [ $SET_USER == 0 ]
|
||||||
|
then
|
||||||
|
user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
# these two might have been set in a [safe_mysqld] section of my.cnf
|
# these two might have been set in a [safe_mysqld] section of my.cnf
|
||||||
# they get passed via environment variables to safe_mysqld
|
# they get passed via environment variables to safe_mysqld
|
||||||
--socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;;
|
--socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;;
|
||||||
|
@ -3639,7 +3639,10 @@ static void get_options(int argc,char **argv)
|
|||||||
use_temp_pool=1;
|
use_temp_pool=1;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
mysqld_user=optarg;
|
if (!mysqld_user)
|
||||||
|
mysqld_user=optarg;
|
||||||
|
else
|
||||||
|
fprintf(stderr, "Warning: Ignoring user change to '%s' becasue the user is set to '%s' earlier on the command line\n", optarg, mysqld_user);
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
case 'V':
|
case 'V':
|
||||||
|
Reference in New Issue
Block a user