From owner-p4-projects Wed May 8 12:44:24 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B686337B400; Wed, 8 May 2002 12:44:14 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 32D3B37B430 for ; Wed, 8 May 2002 12:44:11 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g48JiB366457 for perforce@freebsd.org; Wed, 8 May 2002 12:44:11 -0700 (PDT) (envelope-from arr@freebsd.org) Date: Wed, 8 May 2002 12:44:11 -0700 (PDT) Message-Id: <200205081944.g48JiB366457@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to arr@freebsd.org using -f From: "Andrew R. Reiter" Subject: PERFORCE change 11021 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=11021 Change 11021 by arr@arr_shibby on 2002/05/08 12:43:29 - Rewrite AUDIT_RECORD_ENQ into _audit_record_enq. - Change event time to a void * for the time being. - Change audit_write_thread to take an opaque pointer as an argument. Affected files ... ... //depot/projects/trustedbsd/audit/sys/sys/audit.h#30 edit Differences ... ==== //depot/projects/trustedbsd/audit/sys/sys/audit.h#30 (text+ko) ==== @@ -44,6 +44,8 @@ #include #include #include +#include +#include #include @@ -57,7 +59,11 @@ typedef u_char audit_status_t; typedef u_char audit_object_type_t; typedef void * audit_event_info_t; -typedef struct timespec audit_time_t; +typedef void * audit_time_t; + +extern struct mtx audit_q_mtx; +extern struct audit_record_list record_queue; +extern void *audit_h; #define AUDIT_RECORD_SZ (AUDIT_OBJ_LEN + AUDIT_SUBJ_LEN + AUDIT_HDR_LEN) @@ -104,16 +110,6 @@ #define AUDIT_SET_OBJECT_KPATH(obj, kpath) \ copystr((kpath), (obj)->ao_name, sizeof(obj)->ao_name, NULL) -extern struct mtx audit_q_mtx; -extern struct audit_record_list record_queue; - -#define AUDIT_RECORD_ENQ(ar) do { \ - mtx_lock(&audit_q_mtx); \ - TAILQ_INSERT_TAIL(&record_queue, (ar), ar_next); \ - mtx_unlock(&audit_q_mtx); \ - wakeup_one(&record_queue); \ -} while (0) - struct chmod_info { char ci_path[MAXPATHLEN]; mode_t ci_mode; @@ -234,12 +230,9 @@ printf("---[ HEADER ]---\n" "-[ Version: %u, Record ID: %u\n" "-[ Result: %s, errno: %d\n", - "-[ Time event occured: %x\n", ahp->ah_v, ahp->ah_id, - AUDIT_EV_RESULT(ahp->ah_evresult), ahp->ah_errno, - ahp->ah_evtime); + AUDIT_EV_RESULT(ahp->ah_evresult), ahp->ah_errno); } - typedef struct audit_subject { uid_t as_euid; /* Effective UID */ @@ -312,12 +305,25 @@ printf("----------------------------------------------------------\n"); } + +static __inline +void +_audit_record_enq(audit_record_t *ar) +{ + + mtx_lock(&audit_q_mtx); + TAILQ_INSERT_TAIL(&record_queue, ar, ar_next); + mtx_unlock(&audit_q_mtx); + swi_sched(audit_h, 0); +} + + void audit_init(void); void audit_shutdown(void); struct vnode *audit_write_init(const char *, struct thread *, struct ucred **); void audit_write_shutdown(struct vnode *, struct thread *, struct ucred *); audit_record_t *audit_record_init(int, size_t); -void audit_write_thread(void); +void audit_write_thread(void *); #endif /* !_SYS_AUDIT_H_ */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message