Annotation of 43BSD/ucb/whoami.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1980 Regents of the University of California.
                      3:  * All rights reserved.  The Berkeley software License Agreement
                      4:  * specifies the terms and conditions for redistribution.
                      5:  */
                      6: 
                      7: #ifndef lint
                      8: char copyright[] =
                      9: "@(#) Copyright (c) 1980 Regents of the University of California.\n\
                     10:  All rights reserved.\n";
                     11: #endif not lint
                     12: 
                     13: #ifndef lint
                     14: static char sccsid[] = "@(#)whoami.c   5.1 (Berkeley) 5/31/85";
                     15: #endif not lint
                     16: 
                     17: #include <pwd.h>
                     18: /*
                     19:  * whoami
                     20:  */
                     21: struct passwd *getpwuid();
                     22: 
                     23: main()
                     24: {
                     25:        register struct passwd *pp;
                     26: 
                     27:        pp = getpwuid(geteuid());
                     28:        if (pp == 0) {
                     29:                printf("Intruder alert.\n");
                     30:                exit(1);
                     31:        }
                     32:        printf("%s\n", pp->pw_name);
                     33:        exit(0);
                     34: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.