mysql_user: make sure current_pass_hash is a string before using it in comparison (#64059)

* make sure current_pass_hash is a string before using it in comparison

* add changelogs/fragments file

* fix changelogs/fragments file: it is actually a bugfix, not a minor change
pull/66772/head
Roman Haefeli 5 years ago committed by jctanner
parent 9df9ed4cd3
commit 4d1e21bf18

@ -0,0 +1,2 @@
bugfixes:
- mysql_user - make sure current_pass_hash is a string before using it in comparison (https://github.com/ansible/ansible/issues/60567).

@ -390,6 +390,8 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
FROM mysql.user WHERE user = %%s AND host = %%s
""" % (colA[0], colA[0], colB[0], colB[0]), (user, host))
current_pass_hash = cursor.fetchone()[0]
if isinstance(current_pass_hash, bytes):
current_pass_hash = current_pass_hash.decode('ascii')
if encrypted:
encrypted_password = password

Loading…
Cancel
Save