Skip to content

Commit

Permalink
USER and HOST should be quoted (#443)
Browse files Browse the repository at this point in the history
USER and HOST should be quoted to avoid errors in drop user statement

Signed-off-by: Martin Neubert <[email protected]>
  • Loading branch information
neubi4 authored Apr 27, 2021
1 parent b12ee4d commit 284943b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/mysql_hardening/tasks/mysql_secure_installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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="")
Expand All @@ -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="")
Expand Down

0 comments on commit 284943b

Please sign in to comment.