Skip to content

Commit

Permalink
USER and HOST should be quoted
Browse files Browse the repository at this point in the history
USER and HOST should be quoted to avoid errors in drop user statement
  • Loading branch information
neubi4 authored Apr 27, 2021
1 parent b12ee4d commit de55524
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 de55524

Please sign in to comment.