xref: /csrg-svn/old/whoami/whoami.c (revision 1167)
1*1167Sbill static char *sccsid = "@(#)whoami.c	4.1 (Berkeley) 10/01/80";
2*1167Sbill #include <pwd.h>
3*1167Sbill /*
4*1167Sbill  * whoami
5*1167Sbill  */
6*1167Sbill struct	passwd *getpwuid();
7*1167Sbill 
8*1167Sbill main()
9*1167Sbill {
10*1167Sbill 	register struct passwd *pp;
11*1167Sbill 
12*1167Sbill 	pp = getpwuid(getuid());
13*1167Sbill 	if (pp == 0) {
14*1167Sbill 		printf("Intruder alert.\n");
15*1167Sbill 		exit(1);
16*1167Sbill 	}
17*1167Sbill 	printf("%s\n", pp->pw_name);
18*1167Sbill 	exit(0);
19*1167Sbill }
20