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