From 0471c8ed2c0ae57c00066cff30494964272d7591 Mon Sep 17 00:00:00 2001 From: Tan Jiang Date: Tue, 11 Apr 2017 12:50:13 +0800 Subject: [PATCH] escape mysql root password --- make/common/db/docker-entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/make/common/db/docker-entrypoint.sh b/make/common/db/docker-entrypoint.sh index 95c46e939..32172eeb6 100644 --- a/make/common/db/docker-entrypoint.sh +++ b/make/common/db/docker-entrypoint.sh @@ -13,6 +13,7 @@ if [ ! -d '/var/lib/mysql/mysql' -a "${1%_safe}" = 'mysqld' ]; then # These statements _must_ be on individual lines, and _must_ end with # semicolons (no line breaks or comments are permitted). # TODO proper SQL escaping on ALL the things D: + printf -v MYSQL_ROOT_PASSWORD "%q" ${MYSQL_ROOT_PASSWORD} TEMP_FILE='/tmp/mysql-first-time.sql' cat > "$TEMP_FILE" <<-EOSQL DELETE FROM mysql.user ;