From 553b4b0cd4c67dee0819f63e60a5546a0c66ce55 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 19 Jul 2018 21:14:29 -0700 Subject: [PATCH] password: Move commonpasswords.cdb to includes/password/ Similar to other non-php files used by various classes/libs. This leaves the serialized/ empty (apart from dotfiles), and as such the directory was removed. Change-Id: I538ffe0828843220ac4e161cf2e119deb9bd7ac0 --- includes/DefaultSettings.php | 2 +- .../password}/commonpasswords.cdb | Bin maintenance/createCommonPasswordCdb.php | 6 +++--- serialized/.gitignore | 3 --- serialized/.htaccess | 1 - .../includes/password/PasswordPolicyChecksTest.php | 2 +- 6 files changed, 5 insertions(+), 9 deletions(-) rename {serialized => includes/password}/commonpasswords.cdb (100%) delete mode 100644 serialized/.gitignore delete mode 100644 serialized/.htaccess diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 27769f973d..b8e6cf3e4a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -8820,7 +8820,7 @@ $wgSearchRunSuggestedQuery = true; * @since 1.27 * @var string path to file */ -$wgPopularPasswordFile = __DIR__ . '/../serialized/commonpasswords.cdb'; +$wgPopularPasswordFile = __DIR__ . '/password/commonpasswords.cdb'; /* * Max time (in seconds) a user-generated transaction can spend in writes. diff --git a/serialized/commonpasswords.cdb b/includes/password/commonpasswords.cdb similarity index 100% rename from serialized/commonpasswords.cdb rename to includes/password/commonpasswords.cdb diff --git a/maintenance/createCommonPasswordCdb.php b/maintenance/createCommonPasswordCdb.php index de611ec7de..0aa8ce89f7 100644 --- a/maintenance/createCommonPasswordCdb.php +++ b/maintenance/createCommonPasswordCdb.php @@ -1,6 +1,6 @@ addArg( 'inputfile', 'List of passwords (one per line) to use or - for stdin', true ); $this->addArg( 'output', - "Location to write CDB file to (Try $IP/serialized/commonpasswords.cdb)", + "Location to write CDB file to (Try $IP/includes/password/commonpasswords.cdb)", true ); } diff --git a/serialized/.gitignore b/serialized/.gitignore deleted file mode 100644 index 33b9f02a97..0000000000 --- a/serialized/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/allkeys.txt -/ucd.all.grouped.xml -/ucd.all.grouped.zip diff --git a/serialized/.htaccess b/serialized/.htaccess deleted file mode 100644 index 3a42882788..0000000000 --- a/serialized/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/tests/phpunit/includes/password/PasswordPolicyChecksTest.php b/tests/phpunit/includes/password/PasswordPolicyChecksTest.php index 5ddbe271eb..2d20f2c0ce 100644 --- a/tests/phpunit/includes/password/PasswordPolicyChecksTest.php +++ b/tests/phpunit/includes/password/PasswordPolicyChecksTest.php @@ -150,7 +150,7 @@ class PasswordPolicyChecksTest extends MediaWikiTestCase { global $IP; $this->setMwGlobals( [ 'wgSitename' => 'sitename', - 'wgPopularPasswordFile' => "$IP/serialized/commonpasswords.cdb" + 'wgPopularPasswordFile' => "$IP/includes/password/commonpasswords.cdb" ] ); $user = User::newFromName( 'username' ); $status = PasswordPolicyChecks::checkPopularPasswordBlacklist( PHP_INT_MAX, $user, $password ); -- 2.20.1