Deleted Added
full compact
login_audit.c (155312) login_audit.c (169342)
1/*
2 * Copyright (c) 2005 Apple Computer, Inc.
3 * All rights reserved.
4 *
5 * @APPLE_BSD_LICENSE_HEADER_START@
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 18 unchanged lines hidden (view full) ---

27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * @APPLE_BSD_LICENSE_HEADER_END@
32 */
33
34#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2005 Apple Computer, Inc.
3 * All rights reserved.
4 *
5 * @APPLE_BSD_LICENSE_HEADER_START@
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 18 unchanged lines hidden (view full) ---

27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * @APPLE_BSD_LICENSE_HEADER_END@
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/usr.bin/login/login_audit.c 155312 2006-02-04 20:20:02Z wsalamon $");
35__FBSDID("$FreeBSD: head/usr.bin/login/login_audit.c 169342 2007-05-07 11:01:36Z dwmalone $");
36
37#include <sys/types.h>
38
39#include <bsm/libbsm.h>
40#include <bsm/audit_uevents.h>
41
42#include <err.h>
43#include <errno.h>
44#include <pwd.h>
45#include <stdio.h>
36
37#include <sys/types.h>
38
39#include <bsm/libbsm.h>
40#include <bsm/audit_uevents.h>
41
42#include <err.h>
43#include <errno.h>
44#include <pwd.h>
45#include <stdio.h>
46#include <strings.h>
47#include <unistd.h>
46
47#include "login.h"
48
49/*
50 * Audit data
51 */
52static au_tid_t tid;
53

--- 50 unchanged lines hidden (view full) ---

104 errx(1, "login: Audit Record was not committed.");
105}
106
107/*
108 * The following tokens are included in the audit record for failed
109 * login attempts: header, subject, text, return.
110 */
111void
48
49#include "login.h"
50
51/*
52 * Audit data
53 */
54static au_tid_t tid;
55

--- 50 unchanged lines hidden (view full) ---

106 errx(1, "login: Audit Record was not committed.");
107}
108
109/*
110 * The following tokens are included in the audit record for failed
111 * login attempts: header, subject, text, return.
112 */
113void
112au_login_fail(char *errmsg, int na)
114au_login_fail(const char *errmsg, int na)
113{
114 token_t *tok;
115 int aufd;
116 long au_cond;
117 uid_t uid;
118 gid_t gid;
119 pid_t pid = getpid();
120

--- 44 unchanged lines hidden (view full) ---

165 * The following tokens are included in the audit record for a logout:
166 * header, subject, return.
167 */
168void
169audit_logout(void)
170{
171 token_t *tok;
172 int aufd;
115{
116 token_t *tok;
117 int aufd;
118 long au_cond;
119 uid_t uid;
120 gid_t gid;
121 pid_t pid = getpid();
122

--- 44 unchanged lines hidden (view full) ---

167 * The following tokens are included in the audit record for a logout:
168 * header, subject, return.
169 */
170void
171audit_logout(void)
172{
173 token_t *tok;
174 int aufd;
173 au_mask_t aumask;
174 auditinfo_t auinfo;
175 uid_t uid = pwd->pw_uid;
176 gid_t gid = pwd->pw_gid;
177 pid_t pid = getpid();
178 long au_cond;
179
180 /* If we are not auditing, don't cut an audit record; just return. */
181 if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) {
182 if (errno == ENOSYS)

--- 22 unchanged lines hidden ---
175 uid_t uid = pwd->pw_uid;
176 gid_t gid = pwd->pw_gid;
177 pid_t pid = getpid();
178 long au_cond;
179
180 /* If we are not auditing, don't cut an audit record; just return. */
181 if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) {
182 if (errno == ENOSYS)

--- 22 unchanged lines hidden ---