xref: /titanic_41/usr/src/lib/libbsm/common/bsm.c (revision cde2885fdf538266ee2a3b08dee2d5075ce8fa2b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #include <sys/syscall.h>
27 #include <sys/types.h>
28 #include <bsm/audit.h>
29 #include <sys/socket.h>
30 #include <sys/param.h>
31 
32 const char *bsm_dom = TEXT_DOMAIN;
33 
34 int
35 auditdoor(int fd)
36 {
37 	return (syscall(SYS_auditsys, BSM_AUDITDOOR, fd));
38 }
39 
40 
41 int
42 audit(char *record, int length)
43 {
44 	return (syscall(SYS_auditsys, BSM_AUDIT, record, length));
45 }
46 
47 
48 int
49 getauid(au_id_t *auid)
50 {
51 	return (syscall(SYS_auditsys, BSM_GETAUID, auid));
52 }
53 
54 
55 int
56 setauid(au_id_t *auid)
57 {
58 	return (syscall(SYS_auditsys, BSM_SETAUID, auid));
59 }
60 
61 
62 int
63 getaudit(auditinfo_t *ai)
64 {
65 	return (syscall(SYS_auditsys, BSM_GETAUDIT, ai));
66 }
67 
68 int
69 getaudit_addr(auditinfo_addr_t *ai, int len)
70 {
71 	return (syscall(SYS_auditsys, BSM_GETAUDIT_ADDR, ai, len));
72 }
73 
74 
75 int
76 setaudit(auditinfo_t *ai)
77 {
78 	return (syscall(SYS_auditsys, BSM_SETAUDIT, ai));
79 }
80 
81 
82 int
83 setaudit_addr(auditinfo_addr_t *ai, int len)
84 {
85 	return (syscall(SYS_auditsys, BSM_SETAUDIT_ADDR, ai, len));
86 }
87 
88 
89 int
90 auditon(int cmd, caddr_t data, int length)
91 {
92 	return (syscall(SYS_auditsys, BSM_AUDITCTL, cmd, data, length));
93 }
94