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.
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.
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]
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #include <sys/types.h>
29 #include <bsm/adt_event.h>
31 #include <libnwam_priv.h>
34 * Record libnwam's audit events (enable, disable, update and remove profiles).
37 nwam_record_audit_event(const ucred_t
*ucr
, au_event_t eid
,
38 char *name
, char *descr_arg
, int status
, int error
)
40 adt_session_data_t
*ah
;
41 adt_event_data_t
*edata
;
43 if (adt_start_session(&ah
, NULL
, 0) != 0)
46 if (adt_set_from_ucred(ah
, ucr
, ADT_NEW
) != 0) {
47 (void) adt_end_session(ah
);
51 if ((edata
= adt_alloc_event(ah
, eid
)) == NULL
) {
52 (void) adt_end_session(ah
);
58 edata
->adt_nwam_enable
.profile_name
= name
;
59 edata
->adt_nwam_enable
.profile_type
= descr_arg
;
61 case ADT_nwam_disable
:
62 edata
->adt_nwam_disable
.profile_name
= name
;
63 edata
->adt_nwam_disable
.profile_type
= descr_arg
;
65 case ADT_netcfg_update
:
66 edata
->adt_netcfg_update
.object_name
= name
;
67 edata
->adt_netcfg_update
.parent_file
= descr_arg
;
69 case ADT_netcfg_remove
:
70 edata
->adt_netcfg_remove
.object_name
= name
;
71 edata
->adt_netcfg_remove
.parent_file
= descr_arg
;
77 (void) adt_put_event(edata
, status
, error
);
80 adt_free_event(edata
);
81 (void) adt_end_session(ah
);