mirror of
https://github.com/linux-pam/linux-pam.git
synced 2024-11-23 09:43:36 +08:00
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.
This commit is contained in:
parent
99888b2566
commit
55a20554f9
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user