libbb: introduce and use xgetpwnam. ~ -150 bytes.
This commit is contained in:
@ -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 */
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user