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

@@ -124,9 +124,7 @@ int id_main(int argc UNUSED_PARAM, char **argv)
username = argv[optind];
if (username) {
struct passwd *p = getpwnam(username);
if (!p)
bb_error_msg_and_die("unknown user %s", username);
struct passwd *p = xgetpwnam(username);
euid = ruid = p->pw_uid;
egid = rgid = p->pw_gid;
} else {