]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only use alphanumeric chars for mysql password 25177/head
authorJoas Schilling <coding@schilljs.com>
Mon, 18 Jan 2021 11:03:52 +0000 (12:03 +0100)
committerJoas Schilling <coding@schilljs.com>
Mon, 18 Jan 2021 11:03:52 +0000 (12:03 +0100)
/ and + can cause problems with other tools that you might want to run on your Nextcloud database.

Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/Setup/MySQL.php

index 21339dc46d0d98769f28faf8bbad76455486a997..229d47160f587629c0fd855d5fa04dd4adcb7809 100644 (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);