|
|
1.1 ! root 1: static char *sccsid = "@(#)whoami.c 4.1 (Berkeley) 10/1/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: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.