"root:x" is not a local user name even if the passwd file contains
a line starting with "root:x:".
* modules/pam_localuser/pam_localuser.c (pam_sm_authenticate): Return
PAM_PERM_DENIED if the user name contains a colon.
---
modules/pam_localuser/pam_localuser.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules/pam_localuser/pam_localuser.c
b/modules/pam_localuser/pam_localuser.c
index 3633b535..96467eae 100644
--- a/modules/pam_localuser/pam_localuser.c
+++ b/modules/pam_localuser/pam_localuser.c
@@ -106,6 +106,15 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED,
return PAM_SYSTEM_ERR;
}
+ if (strchr(user, ':') != NULL) {
+ /*
+ * "root:x" is not a local user name even if the passwd file
+ * contains a line starting with "root:x:".
+ */
+ fclose(fp);
+ return PAM_PERM_DENIED;
+ }
+
/* scan the file, using fgets() instead of fgetpwent() because i
* don't want to mess with applications which call fgetpwent() */
ret = PAM_PERM_DENIED;
--
ldv