summaryrefslogtreecommitdiff
path: root/modules/pam_unix
diff options
context:
space:
mode:
authorFlorian Best <best@univention.de>2019-06-26 23:13:13 +0200
committerTomáš Mráz <t8m@users.noreply.github.com>2019-06-27 18:23:16 +0200
commit5154aabe8aac27d569059cad3332cd12c7442a8a (patch)
treedd628698ea434e85d7f35a7876f1bd9193515c28 /modules/pam_unix
parent65816326c285c5d5eec51766e1de329f177c28f7 (diff)
Restrict password length when changing password
Diffstat (limited to 'modules/pam_unix')
-rw-r--r--modules/pam_unix/pam_unix_passwd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/pam_unix/pam_unix_passwd.c b/modules/pam_unix/pam_unix_passwd.c
index df4c1233..4d2f5e2c 100644
--- a/modules/pam_unix/pam_unix_passwd.c
+++ b/modules/pam_unix/pam_unix_passwd.c
@@ -576,7 +576,11 @@ static int _pam_unix_approve_pass(pam_handle_t * pamh
return PAM_AUTHTOK_ERR;
}
}
- if (off(UNIX__IAMROOT, ctrl)) {
+
+ if (strlen(pass_new) > MAX_PASS) {
+ remark = _("You must choose a shorter password.");
+ D(("length exceeded [%s]", remark));
+ } else if (off(UNIX__IAMROOT, ctrl)) {
if (strlen(pass_new) < pass_min_len)
remark = _("You must choose a longer password.");
D(("length check [%s]", remark));