summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2021-04-30 09:45:14 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2021-04-30 09:45:14 +0200
commitf11187371d1e259e0fa137e8653c7fb1faaed8e8 (patch)
tree8a691571f1a07c897fa93d28d1838e7d702ee47e
parentd1314b20d12703b9bedb5f57ed92872011253abd (diff)
downloadmariadb-git-10.2-MDEV-24962-v5.tar.gz
Filter out --user from --mysqld-argsbb-10.2-MDEV-24962-v510.2-MDEV-24962-v5
-rwxr-xr-xscripts/wsrep_sst_common.sh21
1 files changed, 13 insertions, 8 deletions
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index d0b47fca2cc..87a2acb2efb 100755
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -244,6 +244,7 @@ case "$1" in
if [ "$option" != '--defaults-file' -a \
"$option" != '--defaults-extra-file' -a \
"$option" != '--defaults-group-suffix' -a \
+ "$option" != '--user' -a \
"$option" != '--port' -a \
"$option" != '--socket' ]; then
value="${1#*=}"
@@ -586,20 +587,27 @@ if wsrep_auth_not_set; then
WSREP_SST_OPT_AUTH=$(parse_cnf 'sst' 'wsrep-sst-auth')
fi
-WSREP_SST_OPT_AUTH_USER=""
-
-# Splitting AUTH into potential user:password pair
+# Splitting WSREP_SST_OPT_AUTH as "user:password" pair:
if ! wsrep_auth_not_set
then
+ # Extract username as shortest prefix up to first ':' character:
WSREP_SST_OPT_AUTH_USER="${WSREP_SST_OPT_AUTH%%:*}"
if [ -z "$WSREP_SST_OPT_USER" ]; then
+ # if the username is not in the parameters, set the username
+ # and password using WSREP_SST_OPT_AUTH (from environment):
WSREP_SST_OPT_USER="$WSREP_SST_OPT_AUTH_USER"
WSREP_SST_OPT_PSWD="${WSREP_SST_OPT_AUTH#*:}"
elif [ "$WSREP_SST_OPT_USER" = "$WSREP_SST_OPT_AUTH_USER" ]; then
+ # If the username in the parameters and in the environment
+ # variable are the same, set the password if it was not
+ # specified in the command line:
if [ -z "$WSREP_SST_OPT_PSWD" ]; then
WSREP_SST_OPT_PSWD="${WSREP_SST_OPT_AUTH#*:}"
fi
else
+ # The username is passed through the command line and does
+ # not match the username in the environment variable - ignore
+ # the environment and rebuild the authentication parameters:
WSREP_SST_OPT_AUTH="$WSREP_SST_OPT_USER:$WSREP_SST_OPT_PSWD"
fi
fi
@@ -608,8 +616,6 @@ readonly WSREP_SST_OPT_USER
readonly WSREP_SST_OPT_PSWD
readonly WSREP_SST_OPT_AUTH
-readonly WSREP_SST_OPT_REMOTE_AUTH
-
if [ -n "$WSREP_SST_OPT_REMOTE_AUTH" ]
then
# Split auth string at the last ':'
@@ -620,6 +626,8 @@ else
readonly WSREP_SST_OPT_REMOTE_PSWD=
fi
+readonly WSREP_SST_OPT_REMOTE_AUTH
+
if [ -n "$WSREP_SST_OPT_DATA" ]
then
SST_PROGRESS_FILE="$WSREP_SST_OPT_DATA/sst_in_progress"
@@ -650,9 +658,6 @@ wsrep_log_info()
wsrep_log "[INFO] $*"
}
-wsrep_log_info "BYPASS=[$WSREP_SST_OPT_BYPASS]"
-wsrep_log_info "USER=[$WSREP_SST_OPT_USER], PSWD=[$WSREP_SST_OPT_PSWD], AUTH=[$WSREP_SST_OPT_AUTH], AUTH_USER=[$WSREP_SST_OPT_AUTH_USER]"
-
wsrep_cleanup_progress_file()
{
[ -n "$SST_PROGRESS_FILE" ] && rm -f "$SST_PROGRESS_FILE" 2>/dev/null || true