summaryrefslogtreecommitdiffstats
path: root/contrib/openbsm/libbsm/bsm_event.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-08-26 08:04:15 +0000
committerrwatson <rwatson@FreeBSD.org>2006-08-26 08:04:15 +0000
commit3dabba580bd939eae90efba54984d0c4de64eb3e (patch)
tree9d401b2c636de718f11aeab3de77ee3078b8e5b6 /contrib/openbsm/libbsm/bsm_event.c
parent02d6c5b525eb33f2cb80e79944dc5182be119e2c (diff)
downloadFreeBSD-src-3dabba580bd939eae90efba54984d0c4de64eb3e.zip
FreeBSD-src-3dabba580bd939eae90efba54984d0c4de64eb3e.tar.gz
Vendor import of OpenBSM 1.0 alpha 9, with the following change history
notes since the last import: OpenBSM 1.0 alpha 9 - Rename many OpenBSM-specific constants and API elements containing the strings "BSM" and "bsm" to "AUDIT" and "audit", observing that this is true for almost all existing constants and APIs. - Instead of passing a per-instance cookie directly into all audit filter APIs, pass in the audit filter daemon state pointer, which is then used by the module using an audit_filter_{get,set}cookie() API. This will allow future service APIs provided by the filter daemon to maintain their own state -- for example, per-module preselection state. OpenBSM 1.0 alpha 8 - Correct typo in definition of AUR_INT. - Adopt OpenSolaris constant values for AUDIT_* configuration flags. - Arguments to au_to_exec_args() and au_to_exec_env() no longer const. - Add kernel versions of au_to_exec_args() and au_to_exec_env(). - Fix exec argument type that is printed for env strings from 'arg' to 'env'. - New OpenBSM token version number assigned, constants added for other commonly seen version numbers. - OpenBSM-specific events assigned numbers in the 43xxx range to avoid future collisions with Solaris. Darwin events renamed to AUE_DARWIN_foo, as they are now deprecated numberings. - autoconf now detects clock_gettime(), which is not available on Darwin. - praudit output fixes relating to arg32 and arg64 tokens. - Maximum record size updated to 64k-1 to match Solaris record size limit. - Various style and comment cleanups in include files. This is an MFC candidate to RELENG_6. Obtained from: TrustedBSD Project
Diffstat (limited to 'contrib/openbsm/libbsm/bsm_event.c')
-rw-r--r--contrib/openbsm/libbsm/bsm_event.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/contrib/openbsm/libbsm/bsm_event.c b/contrib/openbsm/libbsm/bsm_event.c
index 6e22e4c..6dd4db4 100644
--- a/contrib/openbsm/libbsm/bsm_event.c
+++ b/contrib/openbsm/libbsm/bsm_event.c
@@ -27,7 +27,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_event.c#11 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#12 $
*/
#include <bsm/libbsm.h>
@@ -62,27 +62,32 @@ eventfromstr(char *str, struct au_event_ent *e)
evdesc = strtok_r(NULL, eventdelim, &last);
evclass = strtok_r(NULL, eventdelim, &last);
- if ((evno == NULL) || (evname == NULL) || (evdesc == NULL) ||
- (evclass == NULL))
+ if ((evno == NULL) || (evname == NULL))
return (NULL);
if (strlen(evname) >= AU_EVENT_NAME_MAX)
return (NULL);
strcpy(e->ae_name, evname);
- if (strlen(evdesc) >= AU_EVENT_DESC_MAX)
- return (NULL);
- strcpy(e->ae_desc, evdesc);
+ if (evdesc != NULL) {
+ if (strlen(evdesc) >= AU_EVENT_DESC_MAX)
+ return (NULL);
+ strcpy(e->ae_desc, evdesc);
+ } else
+ strcpy(e->ae_desc, "");
e->ae_number = atoi(evno);
/*
* Find out the mask that corresponds to the given list of classes.
*/
- if (getauditflagsbin(evclass, &evmask) != 0)
+ if (evclass != NULL) {
+ if (getauditflagsbin(evclass, &evmask) != 0)
+ e->ae_class = AU_NULL;
+ else
+ e->ae_class = evmask.am_success;
+ } else
e->ae_class = AU_NULL;
- else
- e->ae_class = evmask.am_success;
return (e);
}
OpenPOWER on IntegriCloud