return pw;
}
-/* xgetgrnam too? */
+struct group* FAST_FUNC xgetgrnam(const char *name)
+{
+ struct group *gr = getgrnam(name);
+ if (!gr)
+ bb_error_msg_and_die("unknown group %s", name);
+ return gr;
+}
+
struct passwd* FAST_FUNC xgetpwuid(uid_t uid)
{
{
struct group *mygroup;
- mygroup = getgrnam(name);
- if (mygroup == NULL)
- bb_error_msg_and_die("unknown group %s", name);
-
+ mygroup = xgetgrnam(name);
return mygroup->gr_gid;
}