Merge pull request #23759 from lisa2lisa/iss23664

fixed the problem for not beable to revoke *.*, for more detail https…
This commit is contained in:
Justin Findlay 2015-05-15 11:38:38 -06:00
commit ddea822b02

View file

@ -1055,7 +1055,7 @@ def user_exists(user,
qry += ' AND Password = \'\''
elif password:
qry += ' AND Password = PASSWORD(%(password)s)'
args['password'] = password
args['password'] = str(password)
elif password_hash:
qry += ' AND Password = %(password)s'
args['password'] = password_hash
@ -1167,7 +1167,7 @@ def user_create(user,
args['host'] = host
if password is not None:
qry += ' IDENTIFIED BY %(password)s'
args['password'] = password
args['password'] = str(password)
elif password_hash is not None:
qry += ' IDENTIFIED BY PASSWORD %(password)s'
args['password'] = password_hash
@ -1721,6 +1721,11 @@ def grant_revoke(grant,
# _ and % are authorized on GRANT queries and should get escaped
# on the db name, but only if not requesting a table level grant
s_database = quote_identifier(dbc, for_grants=(table is '*'))
if dbc is '*':
# add revoke for *.*
# before the modification query send to mysql will looks like
# REVOKE SELECT ON `*`.* FROM %(user)s@%(host)s
s_database = dbc
if table is not '*':
table = quote_identifier(table)
# identifiers cannot be used as values, same thing for grants