File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / usr / src / etc / auditoff.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:24:19 2019 UTC (6 years, 11 months ago) by root
Branches: bsd, MAIN
CVS tags: v12b, v121, HEAD
Power 6/32 Unix version 1.2b

/*
 * $Header: /var/lib/cvsd/repos/cci/cci/usr/src/etc/auditoff.c,v 1.1.1.1 2019/07/28 12:24:19 root Exp $
 *
 * $Log: auditoff.c,v $
 * Revision 1.1.1.1  2019/07/28 12:24:19  root
 * Power 6/32 Unix version 1.2b
 *
 * Revision 1.1  85/07/08  08:29:01  root
 * Initial revision
 * 
 * Revision 1.3  84/10/08  16:34:51  guy
 * Changed not to bother checking whether the user is superuser or not
 * (the "auditoff" call will check that), and to print the reason why
 * an "auditoff" call failed.
 * 
 * Revision 1.2  84/03/10  17:01:10  brian
 * Added code to clear log of currently active log file.
 * 
 */

static char rcsid[] = "$Header: /var/lib/cvsd/repos/cci/cci/usr/src/etc/auditoff.c,v 1.1.1.1 2019/07/28 12:24:19 root Exp $";

/*
 *	auditon - calls 'audon' syscall with super-user privileges
 */
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdio.h>
#define	ROOT 0
#define	ERROR	-1
#define AUDFILELOG "/usr/adm/audfile.log"

char *audfile;
struct stat buf;
int	uid;

main(argc,argv)
int argc;
char **argv;
{
extern int errno;
	if(audon((char *)0) == ERROR) {
		if(errno == EINVAL)
		    fprintf(stderr,"%s: auditing was not enabled\n",argv[0]);
		else {
		    fprintf(stderr,"%s: ", argv[0]);
		    perror("auditing not disabled");
		}
		exit(1);
	}
	unlink(AUDFILELOG);
exit(0);

}

unix.superglobalmegacorp.com

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