xref: /csrg-svn/old/whoami/whoami.c (revision 17422)
1*17422Sralph static char *sccsid = "@(#)whoami.c	4.2 (Berkeley) 11/26/84";
21167Sbill #include <pwd.h>
31167Sbill /*
41167Sbill  * whoami
51167Sbill  */
61167Sbill struct	passwd *getpwuid();
71167Sbill 
81167Sbill main()
91167Sbill {
101167Sbill 	register struct passwd *pp;
111167Sbill 
12*17422Sralph 	pp = getpwuid(geteuid());
131167Sbill 	if (pp == 0) {
141167Sbill 		printf("Intruder alert.\n");
151167Sbill 		exit(1);
161167Sbill 	}
171167Sbill 	printf("%s\n", pp->pw_name);
181167Sbill 	exit(0);
191167Sbill }
20