From owner-p4-projects@FreeBSD.ORG Fri Feb 3 17:35:59 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D267916A423; Fri, 3 Feb 2006 17:35:58 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EAA016A420 for ; Fri, 3 Feb 2006 17:35:58 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5122F43D46 for ; Fri, 3 Feb 2006 17:35:58 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k13HZwSv022289 for ; Fri, 3 Feb 2006 17:35:58 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k13HZw5x022286 for perforce@freebsd.org; Fri, 3 Feb 2006 17:35:58 GMT (envelope-from wsalamon@computer.org) Date: Fri, 3 Feb 2006 17:35:58 GMT Message-Id: <200602031735.k13HZw5x022286@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 90986 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: Fri, 03 Feb 2006 17:35:59 -0000 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 #include #include #include @@ -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