mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix mysql grant comparisons by stripping both of escape characters and quotes. Fixes #26920
This commit is contained in:
parent
8f1ba2fa26
commit
00d13f05c4
1 changed files with 3 additions and 1 deletions
|
@ -1622,8 +1622,10 @@ def grant_exists(grant,
|
|||
if not target_tokens: # Avoid the overhead of re-calc in loop
|
||||
target_tokens = _grant_to_tokens(target)
|
||||
grant_tokens = _grant_to_tokens(grant)
|
||||
grant_tokens_database = grant_tokens['database'].replace('"', '').replace('\\', '').replace('`', '')
|
||||
target_tokens_database = target_tokens['database'].replace('"', '').replace('\\', '').replace('`', '')
|
||||
if grant_tokens['user'] == target_tokens['user'] and \
|
||||
grant_tokens['database'] == target_tokens['database'] and \
|
||||
grant_tokens_database == target_tokens_database and \
|
||||
grant_tokens['host'] == target_tokens['host'] and \
|
||||
set(grant_tokens['grant']) == set(target_tokens['grant']):
|
||||
return True
|
||||
|
|
Loading…
Add table
Reference in a new issue