Annotation of researchv10no/cmd/setlog.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * run a command with login name changed
        !             3:  */
        !             4: 
        !             5: #include <stdio.h>
        !             6: 
        !             7: main(argc, argv)
        !             8: int argc;
        !             9: char **argv;
        !            10: {
        !            11: 
        !            12:        if (argc < 3) {
        !            13:                fprintf(stderr, "usage: %s username command\n", argv[0]);
        !            14:                exit(1);
        !            15:        }
        !            16:        if (setlogname(argv[1]) < 0) {
        !            17:                perror("setlogname");
        !            18:                exit(1);
        !            19:        }
        !            20:        execvp(argv[2], &argv[2]);
        !            21:        perror(argv[2]);
        !            22:        exit(1);
        !            23: }

unix.superglobalmegacorp.com

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