From owner-p4-projects@FreeBSD.ORG Wed Aug 6 01:25:03 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BD1F11065671; Wed, 6 Aug 2008 01:25:03 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D435106564A for ; Wed, 6 Aug 2008 01:25:03 +0000 (UTC) (envelope-from snagg@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 515F08FC17 for ; Wed, 6 Aug 2008 01:25:03 +0000 (UTC) (envelope-from snagg@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m761P3OD001359 for ; Wed, 6 Aug 2008 01:25:03 GMT (envelope-from snagg@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m761P3ZO001357 for perforce@freebsd.org; Wed, 6 Aug 2008 01:25:03 GMT (envelope-from snagg@FreeBSD.org) Date: Wed, 6 Aug 2008 01:25:03 GMT Message-Id: <200808060125.m761P3ZO001357@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to snagg@FreeBSD.org using -f From: Vincenzo Iozzo To: Perforce Change Reviews Cc: Subject: PERFORCE change 146745 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2008 01:25:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=146745 Change 146745 by snagg@snagg_macosx on 2008/08/06 01:24:27 Add symlink(2) tests, some style fixes Affected files ... .. //depot/projects/soc2008/snagg-audit/tools/regression/audit/audit_pipe/audit_pipe_regression_test_utils.c#9 edit .. //depot/projects/soc2008/snagg-audit/tools/regression/audit/audit_pipe/audit_pipe_regression_test_utils.h#7 edit .. //depot/projects/soc2008/snagg-audit/tools/regression/audit/audit_pipe/specific-event/audit_pipe_event_symlink.c#1 add Differences ... ==== //depot/projects/soc2008/snagg-audit/tools/regression/audit/audit_pipe/audit_pipe_regression_test_utils.c#9 (text+ko) ==== @@ -141,8 +141,7 @@ str = string; - if((string = strsep(&str, "\\!!")) != NULL) - { + if((string = strsep(&str, "\\!!")) != NULL) { str +=2; return (str); } @@ -160,8 +159,7 @@ return (-1); str = string; - if((string = strsep(&str, ":**")) != NULL) - { + if((string = strsep(&str, ":**")) != NULL) { if(!strncmp(str, "**INT", 5)) return (INT_TYPE); if(!strncmp(str, "**CHAR",6)) @@ -347,6 +345,20 @@ } /* + * Check the text field of a bsm-token + */ +int check_text(au_text_t text, char *val) +{ + if(!text.len) + return (-1); + + if(!strncmp(text.text, val, text.len > strlen(val)? text.len: strlen(val))) + return (1); + + return (0); +} + +/* * Check the path field of a bsm-token */ int check_path(au_path_t path, char *val) @@ -399,6 +411,9 @@ return (0); } +/* + * Check attributes a file pointed by its path. + */ int check_attr_path(au_attr32_t attr, char *path) { struct stat s; ==== //depot/projects/soc2008/snagg-audit/tools/regression/audit/audit_pipe/audit_pipe_regression_test_utils.h#7 (text+ko) ==== @@ -107,6 +107,7 @@ struct audit_record rec); FILE *init_log(pid_t pid); void report_error(tokenstr_t tok, FILE *f); +int check_text(au_text_t text, char *val); int check_ret(au_ret32_t ret, int r, char *val); int check_path(au_path_t path, char *val); int check_arg(au_arg32_t arg, long val);