aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-09-24 16:20:04 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-09-26 13:04:58 +0000
commit9668f48bd7f1fb8df726e77492c8c344c3e4c74a (patch)
tree55ea7e24a47a376b227bea57b55d9fad46ed2a44 /apps
parente4a564392ed820f8ea48634a5cf4f2e699409680 (diff)
downloadnextcloud-server-9668f48bd7f1fb8df726e77492c8c344c3e4c74a.tar.gz
nextcloud-server-9668f48bd7f1fb8df726e77492c8c344c3e4c74a.zip
fix: Use hashed password in files_external settingsbackport/48359/stable30
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php
index ca1c9ca2bee..f11dab2785f 100644
--- a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php
+++ b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php
@@ -19,6 +19,7 @@ use OCP\Security\ICredentialsManager;
*/
class GlobalAuth extends AuthMechanism {
public const CREDENTIALS_IDENTIFIER = 'password::global';
+ private const PWD_PLACEHOLDER = '************************';
/** @var ICredentialsManager */
protected $credentialsManager;
@@ -41,11 +42,18 @@ class GlobalAuth extends AuthMechanism {
'password' => ''
];
} else {
+ $auth['password'] = self::PWD_PLACEHOLDER;
return $auth;
}
}
public function saveAuth($uid, $user, $password) {
+ // Use old password if it has not changed.
+ if ($password === self::PWD_PLACEHOLDER) {
+ $auth = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
+ $password = $auth['password'];
+ }
+
$this->credentialsManager->store($uid, self::CREDENTIALS_IDENTIFIER, [
'user' => $user,
'password' => $password