From owner-p4-projects@FreeBSD.ORG Tue Jul 14 19:48:45 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E439B10657B0; Tue, 14 Jul 2009 19:48:44 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DD1D10657A9 for ; Tue, 14 Jul 2009 19:48:44 +0000 (UTC) (envelope-from marinosi@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 80A3D8FC28 for ; Tue, 14 Jul 2009 19:48:44 +0000 (UTC) (envelope-from marinosi@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6EJmiaV035022 for ; Tue, 14 Jul 2009 19:48:44 GMT (envelope-from marinosi@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6EJmixE035020 for perforce@freebsd.org; Tue, 14 Jul 2009 19:48:44 GMT (envelope-from marinosi@FreeBSD.org) Date: Tue, 14 Jul 2009 19:48:44 GMT Message-Id: <200907141948.n6EJmixE035020@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marinosi@FreeBSD.org using -f From: Ilias Marinos To: Perforce Change Reviews Cc: Subject: PERFORCE change 166100 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2009 19:48:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=166100 Change 166100 by marinosi@marinosi_redrum on 2009/07/14 19:48:28 Fixed some bugs. Affected files ... .. //depot/projects/soc2009/marinosi_appaudit/src/sys/bsm/audit_internal.h#4 edit .. //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit.c#9 edit .. //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_slice.c#5 edit .. //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_slice.h#7 edit .. //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_syscalls.c#5 edit Differences ... ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/bsm/audit_internal.h#4 (text) ==== @@ -143,7 +143,7 @@ * trailer magic number 2 bytes * record byte count 4 bytes */ -truct bsm_rec_tlr { +struct bsm_rec_tlr { u_char token_id; u_int16_t trailer_num; u_int32_t rec_byte_count; ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit.c#9 (text) ==== @@ -730,8 +730,9 @@ void audit_slice_commit_rec(void *rec, struct audit_slice *as) { - struct kaudit_record *ar; - struct thread *td; + struct kaudit_record *ar = NULL; + struct thread *td = NULL; /* CHECK THIS */ + int error; @@ -746,9 +747,10 @@ * XXXAUDIT: Maybe AUE_AUDIT in the system call context and * special pre-select handling? */ - td->td_ar = audit_new(AUE_NULL, td); + td->td_ar = audit_new(AUE_NULL, td, as); if (td->td_ar == NULL) - return (ENOTSUP); + //return (ENOTSUP); + return; td->td_pflags |= TDP_AUDITREC; ar = td->td_ar; } ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_slice.c#5 (text+ko) ==== @@ -45,9 +45,11 @@ #include #include /* uio struct */ #include +#include #include +#include @@ -158,17 +160,18 @@ int c, error = 0; u_int32_t recsz = 0; int nbytes = 0; /*Remaining bytes */ - void *audit_slice_dev_buf, *as_rec; + struct bsm_rec_hdr *audit_slice_dev_buf; struct audit_slice *as; + void *as_rec; as = dev->si_drv1; /* Safe malloc the pagesz of the system.*/ - audit_slice_dev_buf = (void *)malloc(sizeof(struct bsm_rec_hdr), + audit_slice_dev_buf = malloc(sizeof(*audit_slice_dev_buf), M_TEMP, M_WAITOK); while (uio->uio_resid > 0) { - c = MIN((int)uio->uio_resid, sizeof(struct bsm_rec_hdr)); + c = MIN((int)uio->uio_resid, sizeof(*audit_slice_dev_buf)); if ( c == (int)uio->uio_resid ) break; ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_slice.h#7 (text+ko) ==== @@ -193,3 +193,4 @@ void audit_slice_create(char *name); void audit_slice_destroy(struct audit_slice *as); void audit_slice_cdev_init(struct audit_slice *as); +void audit_slice_commit_rec(void *rec, struct audit_slice *as); ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit_syscalls.c#5 (text) ==== @@ -96,7 +96,7 @@ * XXXAUDIT: Maybe AUE_AUDIT in the system call context and * special pre-select handling? */ - td->td_ar = audit_new(AUE_NULL, td); + td->td_ar = audit_new(AUE_NULL, td, audit_base_slice); if (td->td_ar == NULL) return (ENOTSUP); td->td_pflags |= TDP_AUDITREC;