Annotation of src/usr.bin/sudo/audit.c, Revision 1.2
1.2 ! krw 1: /* $OpenBSD$ */
1.1 millert 2: /*
3: * Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com>
4: *
5: * Permission to use, copy, modify, and distribute this software for any
6: * purpose with or without fee is hereby granted, provided that the above
7: * copyright notice and this permission notice appear in all copies.
8: *
9: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16: */
17:
18: #include <config.h>
19:
20: #include <sys/types.h>
21: #include <stdio.h>
22: #ifdef STDC_HEADERS
23: # include <stdlib.h>
24: # include <stddef.h>
25: #else
26: # ifdef HAVE_STDLIB_H
27: # include <stdlib.h>
28: # endif
29: #endif /* STDC_HEADERS */
30: #ifdef __STDC__
31: # include <stdarg.h>
32: #else
33: # include <varargs.h>
34: #endif
35:
36: #include "compat.h"
37: #include "logging.h"
38:
39: #ifdef HAVE_BSM_AUDIT
40: # include "bsm_audit.h"
41: #endif
42:
43: void
44: #ifdef __STDC__
45: audit_success(char **exec_args)
46: #else
47: audit_success(exec_args)
48: const char **exec_args;
49: #endif
50: {
51: #ifdef HAVE_BSM_AUDIT
52: bsm_audit_success(exec_args);
53: #endif
54: }
55:
56: void
57: #ifdef __STDC__
58: audit_failure(char **exec_args, char const *const fmt, ...)
59: #else
60: audit_failure(exec_args, fmt, va_alist)
61: const char **exec_args;
62: char const *const fmt;
63: va_dcl
64: #endif
65: {
66: va_list ap;
67:
68: #ifdef __STDC__
69: va_start(ap, fmt);
70: #else
71: va_start(ap);
72: #endif
73: #ifdef HAVE_BSM_AUDIT
74: bsm_audit_failure(exec_args, fmt, ap);
75: #endif
76: va_end(ap);
77: }