Skip to content

Commit

Permalink
Fix Issue where user couldnt change plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
C24-AK committed Feb 23, 2024
1 parent 29138e0 commit 4e48ee5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/puppet/provider/mysql_user/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ def plugin=(string)
end
elsif newer_than('mysql' => '5.7.6', 'percona' => '5.7.6', 'mariadb' => '10.2.0')
sql = "ALTER USER #{merged_name} IDENTIFIED WITH '#{string}'"
sql += " AS '#{@resource[:password_hash]}'" if string == 'mysql_native_password'
if string == 'mysql_native_password'
sql += " AS '#{@resource[:password_hash]}'"
elsif string == 'caching_sha2_password'
sql += " AS X'#{password_hash[2..-1]}'"
end
else
# See https://bugs.mysql.com/bug.php?id=67449
sql = "UPDATE mysql.user SET plugin = '#{string}'"
Expand Down

0 comments on commit 4e48ee5

Please sign in to comment.