Fix for database names that contain colons

Bug fix: Permissions were not parsed correctly if the database name contains a colon (:) character. For example, a privilege string of "*.*:USAGE/`lnx-www-prod:wordpress`.*:ALL" would fail with "invalid privileges string: Invalid privileges specified: frozenset(['WORDPRESS`.*'])". This 1-line fix works around the problem.
This commit is contained in:
dramaley 2017-06-29 09:32:36 -05:00 committed by Brian Coca
parent f4f5c4d92a
commit 1fe608afbf

View file

@ -478,7 +478,7 @@ def privileges_unpack(priv, mode):
output = {}
privs = []
for item in priv.strip().split('/'):
pieces = item.strip().split(':')
pieces = item.strip().rsplit(':', 1)
dbpriv = pieces[0].rsplit(".", 1)
# Do not escape if privilege is for database or table, i.e.
# neither quote *. nor .*