Merge pull request #25177 from nextcloud/bugfix/noid/more-usable-mysql-password

Only use alphanumeric chars for mysql password
This commit is contained in:
Roeland Jago Douma 2021-01-18 12:55:30 +01:00 committed by GitHub
commit 80ed3193c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -36,6 +36,7 @@ use OC\DB\MySqlTools;
use OCP\IDBConnection;
use OCP\ILogger;
use Doctrine\DBAL\Platforms\MySQL80Platform;
use OCP\Security\ISecureRandom;
class MySQL extends AbstractDatabase {
public $dbprettyname = 'MySQL/MariaDB';
@ -165,7 +166,7 @@ class MySQL extends AbstractDatabase {
$this->dbUser = $adminUser;
//create a random password so we don't need to store the admin password in the config file
$this->dbPassword = $this->random->generate(30);
$this->dbPassword = $this->random->generate(30, ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER);
$this->createDBUser($connection);