diff options
author | Joas Schilling <coding@schilljs.com> | 2021-01-18 12:03:52 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-01-18 12:03:52 +0100 |
commit | 76c7356af9332cbc3be692566066bacdf8e9f4f2 (patch) | |
tree | 030fe48419874925790a4fd5fd2a0dc68ebdecef /lib | |
parent | 6d291c3c1934e97914a9c22e66355769efe3f6d0 (diff) | |
download | nextcloud-server-76c7356af9332cbc3be692566066bacdf8e9f4f2.tar.gz nextcloud-server-76c7356af9332cbc3be692566066bacdf8e9f4f2.zip |
Only use alphanumeric chars for mysql password
/ 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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Setup/MySQL.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index 21339dc46d0..229d47160f5 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -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); |