aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common/mariadb-galera
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-09-08 14:54:01 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-08 14:54:01 +0000
commit1a8c01a011e0aedfe6ef1f57811429a9133be0ef (patch)
treedc86c8c87d5899e5cddaaaa25d6ed6d5b4bc3c81 /kubernetes/common/mariadb-galera
parent0da88c316b62f80976822231b544c280e1a61c50 (diff)
parent7860146d73472e3b2ff9f7390638ae608c9f9d0f (diff)
Merge "[CLAMP,COMMON] Escape special chars in mysql passwords"
Diffstat (limited to 'kubernetes/common/mariadb-galera')
-rwxr-xr-xkubernetes/common/mariadb-galera/resources/config/configure-mysql.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/kubernetes/common/mariadb-galera/resources/config/configure-mysql.sh b/kubernetes/common/mariadb-galera/resources/config/configure-mysql.sh
index 42c5c89726..678761736a 100755
--- a/kubernetes/common/mariadb-galera/resources/config/configure-mysql.sh
+++ b/kubernetes/common/mariadb-galera/resources/config/configure-mysql.sh
@@ -32,8 +32,9 @@ if [ -z "$MYSQL_INITDB_SKIP_TZINFO" ]; then
mysql_tzinfo_to_sql /usr/share/zoneinfo | sed 's/Local time zone must be set--see zic manual page/FCTY/' | "${mysql[@]}" mysql
fi
-function prepare_password {
- echo -n $1 | sed -e "s/'/''/g"
+prepare_password()
+{
+ echo "$1" | sed -e "s/'/\\\\'/g; s/\"/\\\\\"/g"
}
mysql_root_password=`prepare_password $MYSQL_ROOT_PASSWORD`