From 55a20554f9cfb502e73a5d507828d3ce9aea1a8d Mon Sep 17 00:00:00 2001 From: Göran Uddeborg Date: Mon, 13 May 2024 15:12:36 +0200 Subject: libpam: make /etc/passwd checks 8 bit clean libpam/pam_modutil_check_user.c: explicitly convert the character read from /etc/passwd to type "char" to get the same signedness as the one compared with. Otherwise the functionality will depend on the (implementation defined) signedness of "char" on the platform built for. --- libpam/pam_modutil_check_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpam') diff --git a/libpam/pam_modutil_check_user.c b/libpam/pam_modutil_check_user.c index 92fc74b1..4034e59d 100644 --- a/libpam/pam_modutil_check_user.c +++ b/libpam/pam_modutil_check_user.c @@ -51,7 +51,7 @@ pam_modutil_check_user_in_passwd(pam_handle_t *pamh, */ for (p = user_name; *p != '\0'; p++) { c = fgetc(fp); - if (c == EOF || c == '\n' || c != *p) + if (c == EOF || c == '\n' || (char)c != *p) break; } -- cgit v1.2.3