summaryrefslogtreecommitdiff
path: root/scripts/mysqld_safe.sh
diff options
context:
space:
mode:
authorunknown <monty@work.mysql.com>2001-09-02 20:13:07 +0200
committerunknown <monty@work.mysql.com>2001-09-02 20:13:07 +0200
commit46e1697882c5f79189d08763e7900b34e425f6cc (patch)
tree13764f67c4bd995d05603d7061d33b11ddcdb100 /scripts/mysqld_safe.sh
parent2edb76f0f7b0832daf0c0038c752564704fa05a1 (diff)
parent2528660d5589c1581723c006caeed331b53733e5 (diff)
downloadmariadb-git-46e1697882c5f79189d08763e7900b34e425f6cc.tar.gz
merge
configure.in: Auto merged Docs/manual.texi: Auto merged myisam/mi_create.c: Auto merged
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r--scripts/mysqld_safe.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index ac33c9ad1f2..c6df7400c75 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -36,7 +36,7 @@ parse_arguments() {
--basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;;
--datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;;
--pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;;
- --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;;
+ --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;;
# these two might have been set in a [mysqld_safe] section of my.cnf
# they get passed via environment variables to mysqld_safe
@@ -113,6 +113,7 @@ fi
# these rely on $DATADIR by default, so we'll set them later on
pid_file=
err_log=
+SET_USER=0
# Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe]
# and then merge with the command line arguments
@@ -172,7 +173,10 @@ fi
USER_OPTION=""
if test -w /
then
- USER_OPTION="--user=$user"
+ if test "$user" != "root" -o $SET_USER = 1
+ then
+ USER_OPTION="--user=$user"
+ fi
# If we are root, change the err log to the right user.
touch $err_log; chown $user $err_log
if test -n "$open_files"