• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/shell_cmds-179/id/

Lines Matching refs:pw

87 	struct passwd *pw;
166 pw = *argv ? who(*argv) : NULL;
168 if (Mflag && pw != NULL)
179 fullname(pw);
184 id = pw ? pw->pw_gid : rflag ? getgid() : getegid();
193 id = pw ? pw->pw_uid : rflag ? getuid() : geteuid();
194 if (nflag && (pw = getpwuid(id)))
195 (void)printf("%s\n", pw->pw_name);
202 group(pw, nflag);
212 pline(pw);
217 pretty(pw);
221 if (pw) {
222 id_print(pw, 1, 0, 0);
226 pw = getpwuid(id);
227 id_print(pw, 0, 1, 1);
233 pretty(struct passwd *pw)
239 if (pw) {
240 (void)printf("uid\t%s\n", pw->pw_name);
242 group(pw, 1);
247 pw = getpwuid(rid = getuid());
248 if (pw == NULL || strcmp(login, pw->pw_name))
250 if (pw)
251 (void)printf("uid\t%s\n", pw->pw_name);
256 if ((pw = getpwuid(eid)))
257 (void)printf("euid\t%s\n", pw->pw_name);
273 id_print(struct passwd *pw, int use_ggl, int p_euid, int p_egid)
287 if (pw == NULL) {
288 pw = getpwuid(getuid());
294 if (pw != NULL) {
295 uid = pw->pw_uid;
296 gid = pw->pw_gid;
303 if (use_ggl && pw != NULL) {
306 ngroups = getgrouplist_2(pw->pw_name, gid, &groups);
309 getgrouplist(pw->pw_name, gid, groups, &ngroups);
324 if (pw != NULL)
325 printf("uid=%u(%s)", uid, pw->pw_name);
333 if ((pw = getpwuid(euid)))
334 (void)printf("(%s)", pw->pw_name);
374 fullname(struct passwd *pw)
377 if (!pw) {
378 if ((pw = getpwuid(getuid())) == NULL)
382 (void)printf("%s\n", pw->pw_gecos);
386 group(struct passwd *pw, int nflag)
398 if (pw == NULL) {
399 pw = getpwuid(getuid());
403 if (pw) {
406 ngroups = getgrouplist_2(pw->pw_name, pw->pw_gid, &groups);
409 (void) getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
472 struct passwd *pw;
477 * Translate user argument into a pw pointer. First, try to
480 if ((pw = getpwnam(u)))
481 return(pw);
483 if (*u && !*ep && (pw = getpwuid(id)))
484 return(pw);
490 pline(struct passwd *pw)
493 if (!pw) {
494 if ((pw = getpwuid(getuid())) == NULL)
498 (void)printf("%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n", pw->pw_name,
499 pw->pw_passwd, pw->pw_uid, pw->pw_gid, pw->pw_class,
500 (long)pw->pw_change, (long)pw->pw_expire, pw->pw_gecos,
501 pw->pw_dir, pw->pw_shell);