Skip to content

Commit 284943b

Browse files
authored
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 <[email protected]>
1 parent b12ee4d commit 284943b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roles/mysql_hardening/tasks/mysql_secure_installation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
- name: get all users that have no password or authentication_string on MySQL version >= 5.7.6
5050
community.mysql.mysql_query:
5151
query:
52-
- SELECT GROUP_CONCAT(USER, '@', HOST SEPARATOR ', ') AS users
52+
- SELECT GROUP_CONCAT(QUOTE(USER), '@', QUOTE(HOST) SEPARATOR ', ') AS users
5353
FROM mysql.user
5454
WHERE (length(authentication_string)=0
5555
OR authentication_string="")
@@ -64,7 +64,7 @@
6464
- name: get all users that have no password on MySQL version < 5.7.6
6565
community.mysql.mysql_query:
6666
query:
67-
- SELECT GROUP_CONCAT(USER, '@', HOST SEPARATOR ', ') AS users
67+
- SELECT GROUP_CONCAT(QUOTE(USER), '@', QUOTE(HOST) SEPARATOR ', ') AS users
6868
FROM mysql.user
6969
WHERE (length(password)=0
7070
OR password="")

0 commit comments

Comments
 (0)