From bde5b4c310458db8b3b8f5a15bedded184a2acff Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Wed, 6 Dec 2023 21:42:17 +0100 Subject: libpam: treat NUL in passwd files correctly 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 --- modules/pam_localuser/tst-pam_localuser-retval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/pam_localuser') diff --git a/modules/pam_localuser/tst-pam_localuser-retval.c b/modules/pam_localuser/tst-pam_localuser-retval.c index 5581cecc..3d2c8a42 100644 --- a/modules/pam_localuser/tst-pam_localuser-retval.c +++ b/modules/pam_localuser/tst-pam_localuser-retval.c @@ -55,7 +55,7 @@ main(void) ASSERT_EQ(PAM_SUCCESS, pam_start_confdir(service_file, name, &conv, ".", &pamh)); ASSERT_NE(NULL, pamh); - ASSERT_EQ(PAM_SERVICE_ERR, pam_authenticate(pamh, 0)); + ASSERT_EQ(PAM_PERM_DENIED, pam_authenticate(pamh, 0)); ASSERT_EQ(PAM_SUCCESS, pam_end(pamh, 0)); pamh = NULL; @@ -105,7 +105,7 @@ main(void) ASSERT_EQ(PAM_SUCCESS, pam_start_confdir(service_file, name, &conv, ".", &pamh)); ASSERT_NE(NULL, pamh); - ASSERT_EQ(PAM_SERVICE_ERR, pam_authenticate(pamh, 0)); + ASSERT_EQ(PAM_PERM_DENIED, pam_authenticate(pamh, 0)); ASSERT_EQ(PAM_SUCCESS, pam_end(pamh, 0)); pamh = NULL; -- cgit v1.2.3