aboutsummaryrefslogtreecommitdiff
path: root/libpam/pam_modutil_check_user.c
Commit message (Collapse)AuthorAgeFilesLines
* libpam: treat NUL in passwd files correctlyTobias Stoeckmann2023-12-061-35/+20
| | | | | | | | | | This already implies that the passwd file itself is broken. Yet do not skip lines by accident due to fgets limitations. As a positive side effect, arbitrarily long lines and user names are supported now as well. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* pam_modutil_check_user_in_passwd: avoid timing attacksDmitry V. Levin2020-06-161-1/+3
| | | | | | * libpam/pam_modutil_check_user.c (pam_modutil_check_user_in_passwd): Do not exit the file reading loop when the user is found, continue reading the file to avoid timing attacks.
* Move check_user_in_passwd from pam_localuser.c to pam_modutilFabrice Fontaine2020-06-151-0/+90
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> * modules/pam_localuser/pam_localuser.c: Include <security/pam_modutil.h>. (pam_sm_authenticate): Replace check_user_in_passwd with pam_modutil_check_user_in_passwd. (check_user_in_passwd): Rename to pam_modutil_check_user_in_passwd, move to ... * libpam/pam_modutil_check_user.c: ... new file. * libpam/Makefile.am (libpam_la_SOURCES): Add pam_modutil_check_user.c. * libpam/include/security/pam_modutil.h (pam_modutil_check_user_in_passwd): New function declaration. * libpam/libpam.map (LIBPAM_MODUTIL_1.4.1): New interface. Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>