diff options
author | J0WI <J0WI@users.noreply.github.com> | 2021-07-07 17:52:46 +0200 |
---|---|---|
committer | J0WI <J0WI@users.noreply.github.com> | 2021-07-08 15:11:31 +0200 |
commit | 3b656446afcac16b53aeb5906cb0d2dd57a23d7e (patch) | |
tree | 05ef4885ca0010e1253acf718cb1567e1d82fc03 /lib/private/Setup | |
parent | 040bc04287dd955194aaa9ec53d69e95d5bb5385 (diff) | |
download | nextcloud-server-3b656446afcac16b53aeb5906cb0d2dd57a23d7e.tar.gz nextcloud-server-3b656446afcac16b53aeb5906cb0d2dd57a23d7e.zip |
Introduce ISecureRandom::CHAR_ALPHANUMERIC
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
Diffstat (limited to 'lib/private/Setup')
-rw-r--r-- | lib/private/Setup/MySQL.php | 2 | ||||
-rw-r--r-- | lib/private/Setup/PostgreSQL.php | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index d1ca790adda..8a12465fd8d 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -162,7 +162,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, ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER); + $this->dbPassword = $this->random->generate(30, ISecureRandom::CHAR_ALPHANUMERIC); $this->createDBUser($connection); diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php index bd4ef63d0ab..bc24909dc3d 100644 --- a/lib/private/Setup/PostgreSQL.php +++ b/lib/private/Setup/PostgreSQL.php @@ -31,6 +31,7 @@ namespace OC\Setup; use OC\DatabaseException; use OC\DB\Connection; use OC\DB\QueryBuilder\Literal; +use OCP\Security\ISecureRandom; class PostgreSQL extends AbstractDatabase { public $dbprettyname = 'PostgreSQL'; @@ -66,7 +67,7 @@ class PostgreSQL extends AbstractDatabase { //add prefix to the postgresql user name to prevent collisions $this->dbUser = 'oc_' . strtolower($username); //create a new password so we don't need to store the admin config in the config file - $this->dbPassword = \OC::$server->getSecureRandom()->generate(30, \OCP\Security\ISecureRandom::CHAR_LOWER . \OCP\Security\ISecureRandom::CHAR_DIGITS); + $this->dbPassword = \OC::$server->getSecureRandom()->generate(30, ISecureRandom::CHAR_ALPHANUMERIC); $this->createDBUser($connection); } |