Since we expect the entry to still be valid after calling into PAM,
which may call getpwnam() itself, we need to use getpwnam_r().
MFC after: 1 week
Sponsored by: Klara, Inc.
Differential D43376
login: Use getpwnam_r() instead of getpwnam(). des on Jan 9 2024, 6:09 PM. Authored by Tags None Referenced Files
Details Since we expect the entry to still be valid after calling into PAM, MFC after: 1 week
Diff Detail
Event TimelineComment Actions We call pam_setcred() after calling getpwnam() and expect pwd to still be valid afterwards. PAM modules frequently also call getpwnam(). The only reason this hasn't gotten us into trouble yet is that they usually look up the same user, so even though pwd gets clobbered it still contains the correct data. |