PERFORCE change 90986 for review

Wayne Salamon wsalamon at FreeBSD.org
Fri Feb 3 17:35:58 GMT 2006


http://perforce.freebsd.org/chv.cgi?CH=90986

Change 90986 by wsalamon at gretsch on 2006/02/03 17:35:22

	Add a function that determines whether a buffer contains a
	printable string.

Affected files ...

.. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_klib.c#2 edit
.. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_private.h#13 edit

Differences ...

==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_klib.c#2 (text+ko) ====

@@ -28,6 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <sys/ctype.h>
 #include <sys/param.h>
 #include <sys/fcntl.h>
 #include <sys/filedesc.h>
@@ -534,3 +535,21 @@
 		strlcpy(cpath, bufp, MAXPATHLEN);
 	}
 }
+
+/*
+ * Determine if an array contains a printable string, without the terminiating
+ * NULL character.
+ */
+int
+is_auditable_string(void *buf, int len)
+{
+	int i;
+	char *str;
+
+	str = (char *)buf;
+	for (i = 0; i < len; i++)
+		if (!isprint(str[i]))
+			return (0);
+
+	return (1);
+}

==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_private.h#13 (text+ko) ====

@@ -279,6 +279,7 @@
 int		 msgctl_to_event(int cmd);
 int		 semctl_to_event(int cmr);
 void		 canon_path(struct thread *td, char *path, char *cpath);
+int		 is_auditable_string(void *buf, int len);
 
 /*
  * Audit trigger events notify user space of kernel audit conditions
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list