2
* Audit helper functions used throughout shadow
4
* Copyright (C) 2005, Red Hat, Inc.
2
* Copyright (c) 2005 , Red Hat, Inc.
3
* Copyright (c) 2005 , Tomasz Kłoczko
4
* Copyright (c) 2008 , Nicolas François
6
7
* Redistribution and use in source and binary forms, with or without
7
8
* modification, are permitted provided that the following conditions
11
12
* 2. Redistributions in binary form must reproduce the above copyright
12
13
* notice, this list of conditions and the following disclaimer in the
13
14
* documentation and/or other materials provided with the distribution.
14
* 3. Neither the name of Julianne F. Haugh nor the names of its contributors
15
* may be used to endorse or promote products derived from this software
16
* without specific prior written permission.
15
* 3. The name of the copyright holders or contributors may not be used to
16
* endorse or promote products derived from this software without
17
* specific prior written permission.
18
* THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND
19
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
* ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE
22
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
19
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
* Audit helper functions used throughout shadow
32
37
#include <config.h>
69
76
* result - 1 is "success" and 0 is "failed"
71
78
void audit_logger (int type, const char *pgname, const char *op,
72
const char *name, unsigned int id, int result)
79
const char *name, unsigned int id,
80
shadow_audit_result result)
77
85
audit_log_acct_message (audit_fd, type, NULL, op, name, id,
78
NULL, NULL, NULL, result);
86
NULL, NULL, NULL, (int) result);
90
void audit_logger_message (const char *message, shadow_audit_result result)
95
audit_log_user_message (audit_fd,
81
105
#else /* WITH_AUDIT */
82
106
extern int errno; /* warning: ANSI C forbids an empty source file */
83
107
#endif /* WITH_AUDIT */