PERFORCE change 92523 for review
Robert Watson
rwatson at FreeBSD.org
Tue Feb 28 04:42:09 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=92523
Change 92523 by rwatson at rwatson_peppercorn on 2006/02/28 12:41:03
Test for auditon() system call and provide a compile-time definition
if it is available; this will make it possibly to not compile some
run-time audit tools (such as audit, auditd) and components of
libbsm on systems without the system calls -- otherwise you may get
linking errors due to undefined symbols.
Affected files ...
.. //depot/projects/trustedbsd/openbsm/configure#10 edit
.. //depot/projects/trustedbsd/openbsm/configure.ac#13 edit
Differences ...
==== //depot/projects/trustedbsd/openbsm/configure#10 (xtext) ====
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#11 .
+# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#12 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for OpenBSM 1.0a5.
#
@@ -22814,6 +22814,68 @@
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+# Systems may not define key audit system calls, in which case libbsm cannot
+# depend on them or it will generate link-time or run-time errors. Test for
+# just one.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <bsm/libbsm.h>
+
+int
+main ()
+{
+
+ int err;
+
+ err = auditon(0, NULL, 0);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AUDIT_SYSCALLS
+_ACEOF
+
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
ac_config_files="$ac_config_files Makefile bin/Makefile bin/audit/Makefile bin/auditd/Makefile bin/auditreduce/Makefile bin/praudit/Makefile bsm/Makefile libbsm/Makefile man/Makefile tools/Makefile"
==== //depot/projects/trustedbsd/openbsm/configure.ac#13 (text+ko) ====
@@ -3,7 +3,7 @@
AC_PREREQ(2.59)
AC_INIT([OpenBSM], [1.0a5], [trustedbsd-audit at TrustesdBSD.org],[openbsm])
-AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#12 $])
+AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#13 $])
AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_HEADER([config/config.h])
@@ -74,6 +74,20 @@
AC_DEFINE(HAVE_FULL_QUEUE_H,, Define if queue.h includes LIST_FIRST)
])
+# Systems may not define key audit system calls, in which case libbsm cannot
+# depend on them or it will generate link-time or run-time errors. Test for
+# just one.
+AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <bsm/libbsm.h>
+], [
+ int err;
+
+ err = auditon(0, NULL, 0);
+], [
+AC_DEFINE(HAVE_AUDIT_SYSCALLS,, Define if audit system calls present)
+])
+
AC_CONFIG_FILES([Makefile
bin/Makefile
bin/audit/Makefile
More information about the trustedbsd-cvs
mailing list