From owner-p4-projects@FreeBSD.ORG Tue Jan 31 17:56:05 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 D2CB716A423; Tue, 31 Jan 2006 17:56:04 +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 9301816A420 for ; Tue, 31 Jan 2006 17:56:04 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A9F643D45 for ; Tue, 31 Jan 2006 17:56:04 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0VHu4lP060617 for ; Tue, 31 Jan 2006 17:56:04 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0VHu3Su060614 for perforce@freebsd.org; Tue, 31 Jan 2006 17:56:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 31 Jan 2006 17:56:03 GMT Message-Id: <200601311756.k0VHu3Su060614@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90812 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: Tue, 31 Jan 2006 17:56:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=90812 Change 90812 by rwatson@rwatson_zoo on 2006/01/31 17:55:49 Restructure audit_class parsing to match other bsm database parsers. Remove inconsistent white space. Remove undesirable comment. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#11 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#13 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#11 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#11 (text+ko) ==== @@ -27,7 +27,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#10 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#11 $ */ #include @@ -104,19 +104,21 @@ while (1) { if (fgets(linestr, AU_LINE_MAX, fp) == NULL) return (NULL); - if (linestr[0] != '#') - break; - } - /* Remove trailing new line character. */ - if ((nl = strrchr(linestr, '\n')) != NULL) - *nl = '\0'; + /* Skip comments. */ + if (linestr[0] == '#') + continue; - tokptr = linestr; + /* Remove trailing new line character. */ + if ((nl = strrchr(linestr, '\n')) != NULL) + *nl = '\0'; - /* Parse tokptr to au_class_ent components. */ - if (classfromstr(tokptr, c) == NULL) - return (NULL); + /* Parse tokptr to au_class_ent components. */ + tokptr = linestr; + if (classfromstr(tokptr, c) == NULL) + return (NULL); + break; + } return (c); } ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#13 (text+ko) ==== @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#12 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#13 $ */ #include @@ -78,7 +78,6 @@ if (linestr[0] == '#') continue; - /* Remove trailing new line character. */ if ((nl = strrchr(linestr, '\n')) != NULL) *nl = '\0'; ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#11 (text+ko) ==== @@ -27,7 +27,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#10 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#11 $ */ #include @@ -145,13 +145,7 @@ if (linestr[0] == '#') continue; - /* - * Get the next event structure. - * - * XXXRW: Perhaps we should keep reading lines until we find - * a valid one, rather than stopping when we hit an invalid - * one? - */ + /* Get the next event structure. */ if (eventfromstr(linestr, e) == NULL) return (NULL); break;