libbb: introduce and use xgetpwnam. ~ -150 bytes.

This commit is contained in:
Denis Vlasenko
2008-12-03 19:05:55 +00:00
parent ac1c96f673
commit d7a805efaf
8 changed files with 17 additions and 20 deletions

View File

@ -223,9 +223,7 @@ static int tftp_protocol(
}
if (user_opt) {
struct passwd *pw = getpwnam(user_opt);
if (!pw)
bb_error_msg_and_die("unknown user %s", user_opt);
struct passwd *pw = xgetpwnam(user_opt);
change_identity(pw); /* initgroups, setgid, setuid */
}
}