Deleted Added
sdiff udiff text old ( 38468 ) new ( 48566 )
full compact
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)id.c 8.2 (Berkeley) 2/16/94";
43#endif
44static const char rcsid[] =
45 "$Id: id.c,v 1.7 1998/08/21 06:47:58 obrien Exp $";
46#endif /* not lint */
47
48#include <sys/param.h>
49
50#include <err.h>
51#include <grp.h>
52#include <pwd.h>
53#include <stdio.h>

--- 122 unchanged lines hidden (view full) ---

176 pw = getpwuid(rid = getuid());
177 if (pw == NULL || strcmp(login, pw->pw_name))
178 (void)printf("login\t%s\n", login);
179 if (pw)
180 (void)printf("uid\t%s\n", pw->pw_name);
181 else
182 (void)printf("uid\t%u\n", rid);
183
184 if ((eid = geteuid()) != rid) {
185 if ((pw = getpwuid(eid)))
186 (void)printf("euid\t%s\n", pw->pw_name);
187 else
188 (void)printf("euid\t%u\n", eid);
189 }
190 if ((rid = getgid()) != (eid = getegid())) {
191 if ((gr = getgrgid(rid)))
192 (void)printf("rgid\t%s\n", gr->gr_name);
193 else
194 (void)printf("rgid\t%u\n", rid);
195 }
196 (void)printf("groups\t");
197 group(NULL, 1);
198 }
199}
200
201void
202current()
203{

--- 154 unchanged lines hidden ---