2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
15 #include <afs/afsutil.h>
17 #include "audit-api.h"
19 static FILE *auditout;
24 fprintf(auditout, "\n");
29 append_msg(const char *format, ...)
33 va_start(vaList, format);
34 vfprintf(auditout, format, vaList);
39 open_file(const char *fileName)
42 char oldName[MAXPATHLEN];
47 if ((lstat(fileName, &statbuf) == 0)
48 && (S_ISFIFO(statbuf.st_mode))) {
49 flags = O_WRONLY | O_NONBLOCK;
53 strcpy(oldName, fileName);
54 strcat(oldName, ".old");
55 renamefile(fileName, oldName);
56 flags = O_WRONLY | O_TRUNC | O_CREAT;
58 tempfd = open(fileName, flags, 0666);
60 auditout = fdopen(tempfd, "a");
62 printf("Warning: auditlog %s not writable, ignored.\n", fileName);
66 printf("Warning: auditlog %s not writable, ignored.\n", fileName);
73 print_interface_stats(FILE *out)
78 const struct osi_audit_ops audit_file_ops = {
82 &print_interface_stats,