Skip to content

Commit

Permalink
Don't ifdef KDTRACE_HOOKS struct, variable, and function prototype
Browse files Browse the repository at this point in the history
definitions for the DTrace audit provider, so that the dtaudit module
can compile in the absence of kernel DTrace support.  This doesn't
really make run-time sense (since the binary dependencies for the
module won't be present), but it allows the dtaudit module to compile
successfully regardless of the kernel configuration.

MFC after:	3 weeks
Sponsored by:	DARPA, AFRL
Reported by:	kib
  • Loading branch information
rwatson committed Mar 30, 2017
1 parent 9532aae commit 7cad64f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions sys/security/audit/audit_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,7 @@ struct kaudit_record {
void *k_udata; /* User data. */
u_int k_ulen; /* User data length. */
struct uthread *k_uthread; /* Audited thread. */
#ifdef KDTRACE_HOOKS
void *k_dtaudit_state;
#endif
TAILQ_ENTRY(kaudit_record) k_q;
};
TAILQ_HEAD(kaudit_queue, kaudit_record);
Expand Down Expand Up @@ -401,15 +399,13 @@ struct evname_elem {
LIST_ENTRY(evname_elem) ene_entry; /* (m) */
struct mtx ene_lock;

#ifdef KDTRACE_HOOKS
/* DTrace probe IDs; 0 if not yet registered. */
uint32_t ene_commit_probe_id; /* (M) */
uint32_t ene_bsm_probe_id; /* (M) */

/* Flags indicating if the probes enabled or not. */
int ene_commit_probe_enabled; /* (M) */
int ene_bsm_probe_enabled; /* (M) */
#endif
};

#define EVNAME_LOCK(ene) mtx_lock(&(ene)->ene_lock)
Expand All @@ -424,7 +420,6 @@ typedef void (*au_evnamemap_callback_t)(struct evname_elem *ene);
* DTrace audit provider (dtaudit) hooks -- to be set non-NULL when the audit
* provider is loaded and ready to be called into.
*/
#ifdef KDTRACE_HOOKS
extern void *(*dtaudit_hook_preselect)(au_id_t auid, au_event_t event,
au_class_t class);
extern int (*dtaudit_hook_commit)(struct kaudit_record *kar,
Expand All @@ -433,7 +428,6 @@ extern int (*dtaudit_hook_commit)(struct kaudit_record *kar,
extern void (*dtaudit_hook_bsm)(struct kaudit_record *kar, au_id_t auid,
au_event_t event, au_class_t class, int sorf,
void *bsm_data, size_t bsm_len);
#endif /* !KDTRACE_HOOKS */

#include <sys/fcntl.h>
#include <sys/kernel.h>
Expand All @@ -457,9 +451,7 @@ au_class_t au_event_class(au_event_t event);
void au_evnamemap_init(void);
void au_evnamemap_insert(au_event_t event, const char *name);
void au_evnamemap_foreach(au_evnamemap_callback_t callback);
#ifdef KDTRACE_HOOKS
struct evname_elem *au_evnamemap_lookup(au_event_t event);
#endif
int au_event_name(au_event_t event, char *name);
au_event_t audit_ctlname_to_sysctlevent(int name[], uint64_t valid_arg);
au_event_t audit_flags_and_error_to_openevent(int oflags, int error);
Expand Down

0 comments on commit 7cad64f

Please sign in to comment.