Skip to content

Commit

Permalink
Merge pull request #25177 from nextcloud/bugfix/noid/more-usable-mysq…
Browse files Browse the repository at this point in the history
…l-password

Only use alphanumeric chars for mysql password
  • Loading branch information
rullzer authored Jan 18, 2021
2 parents cfe098e + 76c7356 commit 80ed319
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/Setup/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use OCP\IDBConnection;
use OCP\ILogger;
use Doctrine\DBAL\Platforms\MySQL80Platform;
use OCP\Security\ISecureRandom;

class MySQL extends AbstractDatabase {
public $dbprettyname = 'MySQL/MariaDB';
Expand Down Expand Up @@ -165,7 +166,7 @@ private function createSpecificUser($username, $connection) {
$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);

Expand Down

0 comments on commit 80ed319

Please sign in to comment.