Refix bug 1226 after revert
This patch properly fixes bug 1226 without introducing a breaking change to idempotency which was introduced in PR #1358 We can properly assign permissions to databases with a '.' in the name of the database as well as assign priviliges to all databases as specified with '*'
This commit is contained in:
parent
1b34f1a7ac
commit
52d364b74c
1 changed files with 5 additions and 0 deletions
|
@ -317,6 +317,11 @@ def privileges_unpack(priv):
|
||||||
privs = []
|
privs = []
|
||||||
for item in priv.strip().split('/'):
|
for item in priv.strip().split('/'):
|
||||||
pieces = item.strip().split(':')
|
pieces = item.strip().split(':')
|
||||||
|
dbpriv = pieces[0].rsplit(".", 1)
|
||||||
|
# Do not escape if privilege is for database '*' (all databases)
|
||||||
|
if dbpriv[0].strip('`') != '*':
|
||||||
|
pieces[0] = "`%s`.%s" % (dbpriv[0].strip('`'), dbpriv[1])
|
||||||
|
|
||||||
if '.' in pieces[0]:
|
if '.' in pieces[0]:
|
||||||
pieces[0] = pieces[0].split('.')
|
pieces[0] = pieces[0].split('.')
|
||||||
for idx, piece in enumerate(pieces):
|
for idx, piece in enumerate(pieces):
|
||||||
|
|
Loading…
Reference in a new issue