Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Mar 2017 12:35:56 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r316271 - head/sys/security/audit
Message-ID:  <201703301235.v2UCZuBD060521@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rwatson
Date: Thu Mar 30 12:35:56 2017
New Revision: 316271
URL: https://svnweb.freebsd.org/changeset/base/316271

Log:
  Don't ifdef KDTRACE_HOOKS struct, variable, and function prototype
  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

Modified:
  head/sys/security/audit/audit_private.h

Modified: head/sys/security/audit/audit_private.h
==============================================================================
--- head/sys/security/audit/audit_private.h	Thu Mar 30 08:43:56 2017	(r316270)
+++ head/sys/security/audit/audit_private.h	Thu Mar 30 12:35:56 2017	(r316271)
@@ -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);
@@ -401,7 +399,6 @@ 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) */
@@ -409,7 +406,6 @@ struct evname_elem {
 	/* 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)
@@ -424,7 +420,6 @@ typedef	void	(*au_evnamemap_callback_t)(
  * 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,
@@ -433,7 +428,6 @@ extern int	(*dtaudit_hook_commit)(struct
 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>
@@ -457,9 +451,7 @@ au_class_t	 au_event_class(au_event_t ev
 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703301235.v2UCZuBD060521>