PERFORCE change 146745 for review
Vincenzo Iozzo
snagg at FreeBSD.org
Wed Aug 6 01:25:04 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=146745
Change 146745 by snagg at 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);
More information about the p4-projects
mailing list