From 7b13533ba12ba42d56c0451ef59ec71ce836e747 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Thu, 24 Apr 2025 15:52:46 +0200 Subject: [PATCH] Cut the 3rd matching group as it fails to match roles without quotes The group purpose was to match the closing quotes. We don't need the value after the TO. So we can ignore this entirely. --- plugins/module_utils/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/module_utils/user.py b/plugins/module_utils/user.py index 9de1c6d..337cc67 100644 --- a/plugins/module_utils/user.py +++ b/plugins/module_utils/user.py @@ -662,7 +662,7 @@ def privileges_get(cursor, user, host, maria_role=False): if not maria_role: res = re.match("""GRANT (.+) ON (.+) TO (['`"]).*\\3@(['`"]).*\\4( IDENTIFIED BY PASSWORD (['`"]).+\\6)? ?(.*)""", grant[0]) else: - res = re.match("""GRANT (.+) ON (.+) TO (['`"]).*\\3""", grant[0]) + res = re.match("""GRANT (.+) ON (.+) TO .*""", grant[0]) if res is None: # If a user has roles assigned, we'll have one of priv tuples looking like