summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_localuser/pam_localuser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/pam_localuser/pam_localuser.c b/modules/pam_localuser/pam_localuser.c
index 4e05350e..2020eced 100644
--- a/modules/pam_localuser/pam_localuser.c
+++ b/modules/pam_localuser/pam_localuser.c
@@ -106,6 +106,12 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED,
return PAM_SYSTEM_ERR;
}
+ if (strlen(user) > sizeof(name) - sizeof(":")) {
+ pam_syslog (pamh, LOG_ERR, "user name too long");
+ fclose(fp);
+ return PAM_SERVICE_ERR;
+ }
+
if (strchr(user, ':') != NULL) {
/*
* "root:x" is not a local user name even if the passwd file