Skip to content

Commit 8b598f6

Browse files
committed
Fix Issue where single quote is generated in authentication string
1 parent f333263 commit 8b598f6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/puppet/provider/mysql_user/mysql.rb

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def self.instances
2525
x509_issuer, x509_subject, @password, @plugin, @authentication_string = mysql_caller(query, 'regular').chomp.split(%r{\t})
2626

2727
if @plugin == 'caching_sha2_password'
28+
# Escaping all single quotes to prevent errors when password generated it
29+
@password = @password.gsub("'"){"\\'"}
2830
@password = mysql_caller("SELECT CONCAT('0x',HEX('#{@password}'))", 'regular').chomp
2931
end
3032

0 commit comments

Comments
 (0)