diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-10-23 15:06:43 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-10-26 16:11:13 +0400 |
commit | e4f9d20d7c0359aadaf212346f7b4517e7efa5d7 (patch) | |
tree | de5c6214e88738bccc37a195a0e2aaba1292fee9 /scripts | |
parent | c9185225cba8bb6a2a6745d98a168efe6dfaddcd (diff) | |
download | mariadb-git-e4f9d20d7c0359aadaf212346f7b4517e7efa5d7.tar.gz |
MDEV-8498 - mysql_secure_installation can't find "mysql" in basedir
mysql_secure_installation used incorrect path while looking up for "mysql"
client tool: $basedir/$basedir/bin instead of $basedir/bin.
This patch adapts "my_print_defaults" lookup algorithm for "mysql" client tool.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysql_secure_installation.sh | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index d91e31cda48..82ea1b60a17 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -24,7 +24,6 @@ rootpass="" echo_n= echo_c= basedir= -bindir= defaults_file= defaults_extra_file= no_defaults= @@ -159,8 +158,15 @@ then cannot_find_file my_print_defaults $basedir/bin $basedir/extra exit 1 fi + mysql_command=`find_in_basedir mysql bin` + if test -z "$mysql_command" + then + cannot_find_file mysql $basedir/bin + exit 1 + fi else print_defaults="@bindir@/my_print_defaults" + mysql_command="@bindir@/mysql" fi if test ! -x "$print_defaults" @@ -169,29 +175,17 @@ then exit 1 fi +if test ! -x "$mysql_command" +then + cannot_find_file "$mysql_command" + exit 1 +fi + # Now we can get arguments from the group [client] and [client-server] # in the my.cfg file, then re-run to merge with command line arguments. parse_arguments `$print_defaults $defaults_file $defaults_extra_file $no_defaults client client-server client-mariadb` parse_arguments PICK-ARGS-FROM-ARGV "$@" -# Configure paths to support files -if test -n "$basedir" -then - bindir="$basedir/bin" -elif test -f "./bin/mysql" - then - bindir="./bin" -else - bindir="@bindir@" -fi - -mysql_command=`find_in_basedir mysql $bindir` -if test -z "$mysql_command" -then - cannot_find_file mysql $bindir - exit 1 -fi - set_echo_compat() { case `echo "testing\c"`,`echo -n testing` in *c*,-n*) echo_n= echo_c= ;; |