update sql-users with their corresponding password-hash-algorithm; remove a few notices for empty values in str_replace and others

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-07-17 12:03:37 +02:00
parent 57ae625d38
commit cfda35a36b
7 changed files with 39 additions and 18 deletions

View File

@@ -286,8 +286,8 @@ class MysqlsTest extends TestCase
$dbm = new \Froxlor\Database\DbManager(\Froxlor\FroxlorLogger::getInstanceOf());
$users = $dbm->getManager()->getAllSqlUsers(false);
foreach ($users as $user => $data) {
if (TRAVIS_CI == 1 && strtolower($user) == 'mariadb.sys') {
// travis seems to have a user for mariadb on version 10.4
if (strtolower($user) == 'mariadb.sys') {
// some systems seem to have a user for mariadb on version 10.4
// we do not want to test that one
continue;
}
@@ -302,7 +302,11 @@ class MysqlsTest extends TestCase
// grant privileges to another host
$testdata = $users['froxlor010'];
$dbm->getManager()->grantPrivilegesTo('froxlor010', $testdata['password'], '10.0.0.10', true);
$password = [
'password' => $testdata['password'],
'plugin' => $testdata['plugin']
];
$dbm->getManager()->grantPrivilegesTo('froxlor010', $password, '10.0.0.10', true);
// select all entries from mysql.user for froxlor010 to compare password-hashes
$sel_stmt = Database::prepare("SELECT * FROM mysql.user WHERE `User` = :usr");