From 284943b69979015a774d42e16b366288c76454a0 Mon Sep 17 00:00:00 2001 From: Martin Neubert Date: Tue, 27 Apr 2021 21:16:50 +0200 Subject: [PATCH] USER and HOST should be quoted (#443) USER and HOST should be quoted to avoid errors in drop user statement Signed-off-by: Martin Neubert --- roles/mysql_hardening/tasks/mysql_secure_installation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/mysql_hardening/tasks/mysql_secure_installation.yml b/roles/mysql_hardening/tasks/mysql_secure_installation.yml index d7e394a3..803b50d2 100644 --- a/roles/mysql_hardening/tasks/mysql_secure_installation.yml +++ b/roles/mysql_hardening/tasks/mysql_secure_installation.yml @@ -49,7 +49,7 @@ - name: get all users that have no password or authentication_string on MySQL version >= 5.7.6 community.mysql.mysql_query: query: - - SELECT GROUP_CONCAT(USER, '@', HOST SEPARATOR ', ') AS users + - SELECT GROUP_CONCAT(QUOTE(USER), '@', QUOTE(HOST) SEPARATOR ', ') AS users FROM mysql.user WHERE (length(authentication_string)=0 OR authentication_string="") @@ -64,7 +64,7 @@ - name: get all users that have no password on MySQL version < 5.7.6 community.mysql.mysql_query: query: - - SELECT GROUP_CONCAT(USER, '@', HOST SEPARATOR ', ') AS users + - SELECT GROUP_CONCAT(QUOTE(USER), '@', QUOTE(HOST) SEPARATOR ', ') AS users FROM mysql.user WHERE (length(password)=0 OR password="")