pas = getpwnam(user);
if (pas == NULL) {
- bb_perror_msg_and_die("failed to get uid for %s", user);
+ bb_perror_msg_and_die("cannot get uid for %s", user);
}
setenv("USER", pas->pw_name, 1);
setenv("HOME", pas->pw_dir, 1);
printf("%-10d %-10o", id, ipcp->mode & 0777);
- if ((pw = getpwuid(ipcp->cuid)))
- printf(" %-10s", pw->pw_name);
- else
- printf(" %-10d", ipcp->cuid);
- if ((gr = getgrgid(ipcp->cgid)))
- printf(" %-10s", gr->gr_name);
- else
- printf(" %-10d", ipcp->cgid);
-
- if ((pw = getpwuid(ipcp->uid)))
- printf(" %-10s", pw->pw_name);
- else
- printf(" %-10d", ipcp->uid);
- if ((gr = getgrgid(ipcp->gid)))
- printf(" %-10s\n", gr->gr_name);
- else
- printf(" %-10d\n", ipcp->gid);
+ pw = getpwuid(ipcp->cuid);
+ if (pw) printf(" %-10s", pw->pw_name);
+ else printf(" %-10d", ipcp->cuid);
+ gr = getgrgid(ipcp->cgid);
+ if (gr) printf(" %-10s", gr->gr_name);
+ else printf(" %-10d", ipcp->cgid);
+
+ pw = getpwuid(ipcp->uid);
+ if (pw) printf(" %-10s", pw->pw_name);
+ else printf(" %-10d", ipcp->uid);
+ gr = getgrgid(ipcp->gid);
+ if (gr) printf(" %-10s\n", gr->gr_name);
+ else printf(" %-10d\n", ipcp->gid);
}