Ensure TEMP privilege gets removed when expanding ALL.

ALL gets expanded to the list of VALID_PRIVS which includes
TEMPORARY and TEMP
The code that replaced TEMP with TEMPORARY didn't work with the
expansion
reviewable/pr18780/r1
Will Thames 11 years ago
parent 2a0f6c1cb3
commit 47cb92f74f

@ -490,10 +490,10 @@ def parse_role_attrs(role_attr_flags):
def normalize_privileges(privs, type_): def normalize_privileges(privs, type_):
new_privs = set(privs) new_privs = set(privs)
if 'ALL' in privs: if 'ALL' in new_privs:
new_privs.update(VALID_PRIVS[type_]) new_privs.update(VALID_PRIVS[type_])
new_privs.remove('ALL') new_privs.remove('ALL')
if 'TEMP' in privs: if 'TEMP' in new_privs:
new_privs.add('TEMPORARY') new_privs.add('TEMPORARY')
new_privs.remove('TEMP') new_privs.remove('TEMP')

Loading…
Cancel
Save