PERFORCE change 152817 for review
Robert Watson
rwatson at FreeBSD.org
Tue Nov 11 12:58:16 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=152817
Change 152817 by rwatson at 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 <sys/types.h>
@@ -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 <sys/types.h>
@@ -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
More information about the p4-projects
mailing list