From owner-p4-projects@FreeBSD.ORG Tue Nov 11 20:58:16 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 630D7106567A; Tue, 11 Nov 2008 20:58:16 +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 286D51065677 for ; Tue, 11 Nov 2008 20:58:16 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0C1198FC0A for ; Tue, 11 Nov 2008 20:58:16 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mABKwF8c070141 for ; Tue, 11 Nov 2008 20:58:15 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mABKwFFX070139 for perforce@freebsd.org; Tue, 11 Nov 2008 20:58:15 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 11 Nov 2008 20:58:15 GMT Message-Id: <200811112058.mABKwFFX070139@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 152817 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, 11 Nov 2008 20:58:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=152817 Change 152817 by rwatson@rwatson_lethe on 2008/11/11 20:57:53 Don't use auditon(2) on systems without HAVE_AUDIT_SYSCALLS defined, and exclude certain use of extended headers where that is implicit. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#31 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#72 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#31 (text+ko) ==== @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#30 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#31 $ */ #include @@ -213,6 +213,7 @@ struct auditinfo_addr aia; struct timeval tm; +#ifdef HAVE_AUDIT_SYSCALLS /* * Grab the size of the address family stored in the kernel's audit * state. @@ -222,9 +223,11 @@ if (auditon(A_GETKAUDIT, &aia, sizeof(aia)) < 0) { if (errno != ENOSYS) return (-1); +#endif /* HAVE_AUDIT_SYSCALLS */ tot_rec_size = rec->len + AUDIT_HEADER_SIZE + AUDIT_TRAILER_SIZE; header = au_to_header(tot_rec_size, event, 0); +#ifdef HAVE_AUDIT_SYSCALLS } else { if (gettimeofday(&tm, NULL) < 0) return (-1); @@ -251,6 +254,7 @@ else header = au_to_header(tot_rec_size, event, 0); } +#endif /* HAVE_AUDIT_SYSCALLS */ if (header == NULL) return (-1); ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#72 (text+ko) ==== @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#71 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#72 $ */ #include @@ -1396,6 +1396,7 @@ } #if !defined(KERNEL) && !defined(_KERNEL) +#ifdef HAVE_AUDIT_SYSCALLS token_t * au_to_header32_ex(int rec_size, au_event_t e_type, au_emod_t e_mod) { @@ -1411,6 +1412,7 @@ } return (au_to_header32_ex_tm(rec_size, e_type, e_mod, tm, &aia)); } +#endif /* HAVE_AUDIT_SYSCALLS */ token_t * au_to_header32(int rec_size, au_event_t e_type, au_emod_t e_mod) @@ -1440,13 +1442,15 @@ return (au_to_header32(rec_size, e_type, e_mod)); } +#ifdef HAVE_AUDIT_SYSCALLS token_t * au_to_header_ex(int rec_size, au_event_t e_type, au_emod_t e_mod) { return (au_to_header32_ex(rec_size, e_type, e_mod)); } -#endif +#endif /* HAVE_AUDIT_SYSCALLS */ +#endif /* !defined(KERNEL) && !defined(_KERNEL) */ /* * token ID 1 byte