Skip to content

Commit b133766

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1' into 'stable-3.1'
Add check for mysql-plugin validate_password to allow passwords as hashes (Fixes #4777) See merge request !635
2 parents 84bc40b + 5ffb6be commit b133766

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

install/lib/installer_base.lib.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ public function configure_database() {
234234
die();
235235
}
236236

237+
$unwanted_sql_plugins = array('validate_password');
238+
$sql_plugins = $inst->db->queryAllRecords("SELECT plugin_name FROM information_schema.plugins WHERE plugin_status='ACTIVE' AND plugin_name IN ?", $unwanted_sql_plugins);
239+
if(is_array($sql_plugins) && !empty($sql_plugins)) {
240+
foreach ($sql_plugins as $plugin) echo "Login in to MySQL and disable $plugin[plugin_name] with:\n\n UNINSTALL PLUGIN $plugin[plugin_name];";
241+
die();
242+
}
243+
237244
//** Create the database
238245
if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CHARACTER SET ?', $conf['mysql']['database'], $conf['mysql']['charset'])) {
239246
$this->error('Unable to create MySQL database: '.$conf['mysql']['database'].'.');

install/lib/update.lib.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ function updateDbAndIni() {
132132
die();
133133
}
134134

135+
$unwanted_sql_plugins = array('validate_password');
136+
$sql_plugins = $inst->db->queryAllRecords("SELECT plugin_name FROM information_schema.plugins WHERE plugin_status='ACTIVE' AND plugin_name IN ?", $unwanted_sql_plugins);
137+
if(is_array($sql_plugins) && !empty($sql_plugins)) {
138+
foreach ($sql_plugins as $plugin) echo "Login in to MySQL and disable $plugin[plugin_name] with:\n\n UNINSTALL PLUGIN $plugin[plugin_name];";
139+
die();
140+
}
141+
135142
//* Update $conf array with values from the server.ini that shall be preserved
136143
$tmp = $inst->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . '.server', $conf['server_id']);
137144
$ini_array = ini_to_array(stripslashes($tmp['config']));

server/plugins-available/mysql_clientdb_plugin.inc.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,20 @@ function onLoad() {
7373

7474
function process_host_list($action, $database_name, $database_user, $database_password, $host_list, $link, $database_rename_user = '', $user_access_mode = 'rw') {
7575
global $app;
76-
76+
77+
// check mysql-plugins
78+
$unwanted_sql_plugins = array('validate_password'); // strict-password-validation
79+
$temp = "'".implode("','", $unwanted_sql_plugins)."'";
80+
$result = $link->query("SELECT plugin_name FROM information_schema.plugins WHERE plugin_status='ACTIVE' AND plugin_name IN ($temp)");
81+
if($result) {
82+
while ($row = $result->fetch_assoc()) {
83+
$sql_plugins[] = $row['plugin_name'];
84+
}
85+
$result->free();
86+
foreach ($sql_plugins as $plugin) $app->log("MySQL-Plugin $plugin[plugin_name] enabled - can not execute function process_host_list", LOGLEVEL_ERROR);
87+
return false;
88+
}
89+
7790
if(!$user_access_mode) $user_access_mode = 'rw';
7891
$action = strtoupper($action);
7992

0 commit comments

Comments
 (0)