Add config option to force use of some authentication plugin

This commit is contained in:
Jamie Cameron
2023-07-12 16:55:03 -07:00
parent 48eb29e547
commit eb79f4c169
2 changed files with 12 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ encoding=Encoding for database content,3,Default (from current language)
max_dbs=Maximum number of databases and tables, indexes and views to display,0,5
max_text=Maximum display length for text fields,3,Unlimited
charset=Character set for MySQL data,15,charset
auth_plugin=Force use of authentication plugin,3,System default
line2=System configuration,11
mysqlshow=Path to mysqlshow command,0
mysqladmin=Path to mysqladmin command,0

View File

@@ -1620,13 +1620,18 @@ return $sql;
sub get_mysql_plugin
{
my ($query) = @_;
my @plugin = &execute_sql($master_db,
"show variables LIKE '%default_authentication_plugin%'");
my $plugin = $plugin[0]->{'data'}->[0]->[1];
if ($plugin && $query) {
$plugin = " with $plugin ";
if ($config{'auth_plugin'}) {
return " with $config{'auth_plugin'}";
}
else {
my @plugin = &execute_sql($master_db,
"show variables LIKE '%default_authentication_plugin%'");
my $plugin = $plugin[0]->{'data'}->[0]->[1];
if ($plugin && $query) {
$plugin = " with $plugin ";
}
return $plugin;
}
return $plugin;
}
# perms_column_to_privilege_map(col)