* file. It also avoids any allocation to prevent memory-exhaustion
* attacks via huge TCB shadow files. */
* file. It also avoids any allocation to prevent memory-exhaustion
* attacks via huge TCB shadow files. */
int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct spwd **res)
{
char path[20+NAME_MAX];
int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct spwd **res)
{
char path[20+NAME_MAX];
*s++ = 0; sp->sp_pwdp = s;
if (!(s = strchr(s, ':'))) continue;
*s++ = 0; sp->sp_pwdp = s;
if (!(s = strchr(s, ':'))) continue;