Annotation of cci/usr/src/etc/auditoff.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * $Header: auditoff.c,v 1.1 85/07/08 08:29:01 root Exp $
        !             3:  *
        !             4:  * $Log:       auditoff.c,v $
        !             5:  * Revision 1.1  85/07/08  08:29:01  root
        !             6:  * Initial revision
        !             7:  * 
        !             8:  * Revision 1.3  84/10/08  16:34:51  guy
        !             9:  * Changed not to bother checking whether the user is superuser or not
        !            10:  * (the "auditoff" call will check that), and to print the reason why
        !            11:  * an "auditoff" call failed.
        !            12:  * 
        !            13:  * Revision 1.2  84/03/10  17:01:10  brian
        !            14:  * Added code to clear log of currently active log file.
        !            15:  * 
        !            16:  */
        !            17: 
        !            18: static char rcsid[] = "$Header: auditoff.c,v 1.1 85/07/08 08:29:01 root Exp $";
        !            19: 
        !            20: /*
        !            21:  *     auditon - calls 'audon' syscall with super-user privileges
        !            22:  */
        !            23: #include <sys/types.h>
        !            24: #include <sys/stat.h>
        !            25: #include <errno.h>
        !            26: #include <stdio.h>
        !            27: #define        ROOT 0
        !            28: #define        ERROR   -1
        !            29: #define AUDFILELOG "/usr/adm/audfile.log"
        !            30: 
        !            31: char *audfile;
        !            32: struct stat buf;
        !            33: int    uid;
        !            34: 
        !            35: main(argc,argv)
        !            36: int argc;
        !            37: char **argv;
        !            38: {
        !            39: extern int errno;
        !            40:        if(audon((char *)0) == ERROR) {
        !            41:                if(errno == EINVAL)
        !            42:                    fprintf(stderr,"%s: auditing was not enabled\n",argv[0]);
        !            43:                else {
        !            44:                    fprintf(stderr,"%s: ", argv[0]);
        !            45:                    perror("auditing not disabled");
        !            46:                }
        !            47:                exit(1);
        !            48:        }
        !            49:        unlink(AUDFILELOG);
        !            50: exit(0);
        !            51: 
        !            52: }

unix.superglobalmegacorp.com

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