Date: Fri, 3 Feb 2006 17:35:58 GMT From: Wayne Salamon <wsalamon@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 90986 for review Message-ID: <200602031735.k13HZw5x022286@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=90986 Change 90986 by wsalamon@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602031735.k13HZw5x022286>