From owner-p4-projects@FreeBSD.ORG Fri Dec 19 12:42:58 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 332BE1065675; Fri, 19 Dec 2008 12:42:58 +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 E998A106564A for ; Fri, 19 Dec 2008 12:42:57 +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 D69578FC1F for ; Fri, 19 Dec 2008 12:42:57 +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 mBJCgvkF097609 for ; Fri, 19 Dec 2008 12:42:57 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 mBJCgvYo097607 for perforce@freebsd.org; Fri, 19 Dec 2008 12:42:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Fri, 19 Dec 2008 12:42:57 GMT Message-Id: <200812191242.mBJCgvYo097607@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 154996 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: Fri, 19 Dec 2008 12:42:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=154996 Change 154996 by rwatson@rwatson_cinnamon on 2008/12/19 12:42:02 Don't use sys/endian.h unless be32enc becomes available as a result of including it; FreeBSD 4.x's sys/endian.h is not capable enough to meet our requirements, so must use our compat/endian.h there. Affected files ... .. //depot/projects/trustedbsd/openbsm/config/config.h.in#16 edit .. //depot/projects/trustedbsd/openbsm/configure#45 edit .. //depot/projects/trustedbsd/openbsm/configure.ac#47 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#59 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#85 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/config/config.h.in#16 (text+ko) ==== @@ -6,6 +6,9 @@ /* Define if audit system calls present */ #undef HAVE_AUDIT_SYSCALLS +/* Define if be32enc is present */ +#undef HAVE_BE32ENC + /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO ==== //depot/projects/trustedbsd/openbsm/configure#45 (xtext) ==== @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#45 . +# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#46 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for OpenBSM 1.1alpha4. # @@ -23032,6 +23032,66 @@ fi +# +# There are a wide variety of endian macros and functions in the wild; we try +# to use the native support if it defines be32enc(), but otherwise have to +# use our own. +# +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + be32enc(NULL, 1); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_BE32ENC +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + # Check to see if Mach IPC is used for trigger messages. If so, use Mach IPC # instead of the default for sending trigger messages to the audit components. { echo "$as_me:$LINENO: checking for /usr/include/mach/audit_triggers.defs" >&5 ==== //depot/projects/trustedbsd/openbsm/configure.ac#47 (text+ko) ==== @@ -3,7 +3,7 @@ AC_PREREQ(2.59) AC_INIT([OpenBSM], [1.1alpha4], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) -AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#46 $]) +AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#47 $]) AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER([config/config.h]) @@ -121,6 +121,20 @@ ]) AM_CONDITIONAL(HAVE_AUDIT_SYSCALLS, $have_audit_syscalls) +# +# There are a wide variety of endian macros and functions in the wild; we try +# to use the native support if it defines be32enc(), but otherwise have to +# use our own. +# +AC_TRY_LINK([ + #include + #include +], [ + be32enc(NULL, 1); +], [ +AC_DEFINE(HAVE_BE32ENC,, Define if be32enc is present) +]) + # Check to see if Mach IPC is used for trigger messages. If so, use Mach IPC # instead of the default for sending trigger messages to the audit components. AC_CHECK_FILE([/usr/include/mach/audit_triggers.defs], [ ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#59 (text+ko) ==== @@ -32,15 +32,15 @@ * 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_io.c#58 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#59 $ */ #include #include -#ifdef HAVE_SYS_ENDIAN_H +#if defined(HAVE_SYS_ENDIAN_H) && defined(HAVE_BE32ENC) #include -#else /* !HAVE_SYS_ENDIAN_H */ +#else /* !HAVE_SYS_ENDIAN_H || !HAVE_BE32ENC */ #ifdef HAVE_MACHINE_ENDIAN_H #include #else /* !HAVE_MACHINE_ENDIAN_H */ @@ -51,7 +51,7 @@ #endif /* !HAVE_ENDIAN_H */ #endif /* !HAVE_MACHINE_ENDIAN_H */ #include -#endif /* !HAVE_SYS_ENDIAN_H */ +#endif /* !HAVE_SYS_ENDIAN_H || !HAVE_BE32ENC */ #ifdef HAVE_FULL_QUEUE_H #include #else /* !HAVE_FULL_QUEUE_H */ ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#85 (text+ko) ==== @@ -30,15 +30,15 @@ * 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#84 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#85 $ */ #include #include -#ifdef HAVE_SYS_ENDIAN_H +#if defined(HAVE_SYS_ENDIAN_H) && defined(HAVE_BE32ENC) #include -#else /* !HAVE_SYS_ENDIAN_H */ +#else /* !HAVE_SYS_ENDIAN_H || !HAVE_BE32ENC */ #ifdef HAVE_MACHINE_ENDIAN_H #include #else /* !HAVE_MACHINE_ENDIAN_H */ @@ -49,7 +49,7 @@ #endif /* !HAVE_ENDIAN_H */ #endif /* !HAVE_MACHINE_ENDIAN_H */ #include -#endif /* !HAVE_SYS_ENDIAN_H */ +#endif /* !HAVE_SYS_ENDIAN_H || !HAVE_BE32ENC */ #ifdef HAVE_FULL_QUEUE_H #include #else /* !HAVE_FULL_QUEUE_H */