aboutsummaryrefslogtreecommitdiffstats
path: root/lib/setup.php
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-06-08 12:42:35 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-06-08 12:42:35 +0200
commita7a861b2c6fc855abc0741691bebf975e255767c (patch)
tree2f3275187d5c123a8ddf045c734bcda4d7a3c791 /lib/setup.php
parent8c7fa15aaf98e31646e4306e7819d1d2b725a7e1 (diff)
downloadnextcloud-server-a7a861b2c6fc855abc0741691bebf975e255767c.tar.gz
nextcloud-server-a7a861b2c6fc855abc0741691bebf975e255767c.zip
backport the password salting fix.
a salt is generated during setup and used to salt the user password hases in the database backend
Diffstat (limited to 'lib/setup.php')
-rw-r--r--lib/setup.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/setup.php b/lib/setup.php
index 4c8c5670480..e1c1a110b38 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -73,6 +73,10 @@ class OC_Setup {
$dbtype='sqlite3';
}
+ //generate a random salt that is used to salt the local user passwords
+ $salt=mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000).mt_rand(1000,9000);
+ OC_Config::setValue('passwordsalt', $salt);
+
//write the config file
OC_Config::setValue('datadirectory', $datadir);
OC_Config::setValue('dbtype', $dbtype);