@@ -152,7 +152,6 @@ WSREP_SST_OPT_DATA=""
152152WSREP_SST_OPT_AUTH=" ${WSREP_SST_OPT_AUTH:- } "
153153WSREP_SST_OPT_USER=" ${WSREP_SST_OPT_USER:- } "
154154WSREP_SST_OPT_PSWD=" ${WSREP_SST_OPT_PSWD:- } "
155- WSREP_SST_OPT_REMOTE_AUTH=" ${WSREP_SST_OPT_REMOTE_AUTH:- } "
156155WSREP_SST_OPT_DEFAULT=" "
157156WSREP_SST_OPT_DEFAULTS=" "
158157WSREP_SST_OPT_EXTRA_DEFAULT=" "
@@ -1008,11 +1007,6 @@ in_config()
10081007 echo $found
10091008}
10101009
1011- wsrep_auth_not_set ()
1012- {
1013- [ -z " $WSREP_SST_OPT_AUTH " ]
1014- }
1015-
10161010# Get rid of incorrect values resulting from substitution
10171011# in programs external to the script:
10181012if [ " $WSREP_SST_OPT_USER " = ' (null)' ]; then
@@ -1028,12 +1022,12 @@ fi
10281022# Let's read the value of the authentication string from the
10291023# configuration file so that it does not go to the command line
10301024# and does not appear in the ps output:
1031- if wsrep_auth_not_set ; then
1025+ if [ -z " $WSREP_SST_OPT_AUTH " ] ; then
10321026 WSREP_SST_OPT_AUTH=$( parse_cnf ' sst' ' wsrep-sst-auth' )
10331027fi
10341028
10351029# Splitting WSREP_SST_OPT_AUTH as "user:password" pair:
1036- if ! wsrep_auth_not_set ; then
1030+ if [ -n " $WSREP_SST_OPT_AUTH " ] ; then
10371031 # Extract username as shortest prefix up to first ':' character:
10381032 WSREP_SST_OPT_AUTH_USER=" ${WSREP_SST_OPT_AUTH%%:* } "
10391033 if [ -z " $WSREP_SST_OPT_USER " ]; then
@@ -1057,12 +1051,13 @@ if ! wsrep_auth_not_set; then
10571051 fi
10581052fi
10591053
1054+ WSREP_SST_OPT_REMOTE_AUTH=" ${WSREP_SST_OPT_REMOTE_AUTH:- } "
10601055WSREP_SST_OPT_REMOTE_USER=
10611056WSREP_SST_OPT_REMOTE_PSWD=
10621057if [ -n " $WSREP_SST_OPT_REMOTE_AUTH " ]; then
10631058 # Split auth string at the last ':'
1064- readonly WSREP_SST_OPT_REMOTE_USER=" ${WSREP_SST_OPT_REMOTE_AUTH%%:* } "
1065- readonly WSREP_SST_OPT_REMOTE_PSWD=" ${WSREP_SST_OPT_REMOTE_AUTH#*: } "
1059+ WSREP_SST_OPT_REMOTE_USER=" ${WSREP_SST_OPT_REMOTE_AUTH%%:* } "
1060+ WSREP_SST_OPT_REMOTE_PSWD=" ${WSREP_SST_OPT_REMOTE_AUTH#*: } "
10661061fi
10671062
10681063# Reads incoming data from STDIN and sets the variables
10771072read_variables_from_stdin ()
10781073{
10791074 while read line; do
1080- key=${line%% =* }
1081- value=${line#* =}
1075+ local key=" ${line%% =* } "
1076+ local value=" "
1077+ [ " $key " != " $line " ] && value=" ${line#* =} "
10821078 case " $key " in
10831079 ' sst_user' )
10841080 WSREP_SST_OPT_USER=" $value "
0 commit comments