Skip to content

Commit 6e91736

Browse files
Merge pull request #34534 from nextcloud/backport/34500/stable22
[stable22] Fix password length limitation
2 parents 81081ff + 32f704b commit 6e91736

6 files changed

Lines changed: 14 additions & 7 deletions

File tree

apps/provisioning_api/lib/Controller/UsersController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ public function addUser(string $userid,
382382
}
383383

384384
$generatePasswordResetToken = false;
385+
if (strlen($password) > 469) {
386+
throw new OCSException('Invalid password value', 101);
387+
}
385388
if ($password === '') {
386389
if ($email === '') {
387390
throw new OCSException('To send a password link to the user an email address is required.', 108);
@@ -827,6 +830,9 @@ public function editUser(string $userId, string $key, string $value): DataRespon
827830
break;
828831
case self::USER_FIELD_PASSWORD:
829832
try {
833+
if (strlen($value) > 469) {
834+
throw new OCSException('Invalid password value', 102);
835+
}
830836
if (!$targetUser->canChangePassword()) {
831837
throw new OCSException('Setting the password is not supported by the users backend', 103);
832838
}

apps/settings/js/vue-settings-apps-users-management.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-apps-users-management.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-users.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-users.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/src/components/UserList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
ref="newuserpassword"
5757
v-model="newUser.password"
5858
:minlength="minPasswordLength"
59+
:maxlength="469"
5960
:placeholder="t('settings', 'Password')"
6061
:required="newUser.mailAddress===''"
6162
autocapitalize="none"

0 commit comments

Comments
 (0)