Raise limit for passwd and shadow entry length
Moreover, include checks to prevent writing entries longer than the length limit. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1422497 Signed-off-by: Tomáš Mráz <tm@t8m.info> Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
This commit is contained in:
committed by
Iker Pedrosa
parent
fbf275da19
commit
16afe18142
+4
-1
@@ -56,7 +56,10 @@ static int passwd_put (const void *ent, FILE * file)
|
||||
|| (pw->pw_gid == (gid_t)-1)
|
||||
|| (valid_field (pw->pw_gecos, ":\n") == -1)
|
||||
|| (valid_field (pw->pw_dir, ":\n") == -1)
|
||||
|| (valid_field (pw->pw_shell, ":\n") == -1)) {
|
||||
|| (valid_field (pw->pw_shell, ":\n") == -1)
|
||||
|| (strlen (pw->pw_name) + strlen (pw->pw_passwd) +
|
||||
strlen (pw->pw_gecos) + strlen (pw->pw_dir) +
|
||||
strlen (pw->pw_shell) + 100 > PASSWD_ENTRY_MAX_LENGTH)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user