From owner-freebsd-audit Thu Oct 12 19:51: 3 2000 Delivered-To: freebsd-audit@freebsd.org Received: from green.dyndns.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 2F3DD37B502; Thu, 12 Oct 2000 19:51:00 -0700 (PDT) Received: from localhost (cgghxz@localhost [127.0.0.1] (may be forged)) by green.dyndns.org (8.11.0/8.11.0) with ESMTP id e9D2ot578378; Thu, 12 Oct 2000 22:50:57 -0400 (EDT) (envelope-from green@FreeBSD.org) Message-Id: <200010130250.e9D2ot578378@green.dyndns.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: Robert Watson Cc: freebsd-audit@FreeBSD.org Subject: Re: Audit request: capability text format handling In-Reply-To: Message from Robert Watson of "Thu, 12 Oct 2000 13:29:44 EDT." From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 12 Oct 2000 22:50:54 -0400 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Robert Watson wrote: > > I'm about to start committing updates to the libposix1e capability > support, and this will include addition of two new routines: > cap_from_text() and cap_to_text(). While I'm relatively confident about > most of my C code, string parsing and generation code is always worthy of > another set of eyes. If someone wants to peruse it and give me a nice > green check (or a nasty red X), it's at: > > http://www.watson.org/~robert/cap_text.c > > I didn't come up with the text format, I just parse it, before anyone asks > :-). I don't see anything at all wrong with it. Seems fine, except for a few fringe issues to make things "nicer"... :) The parsing itself is very straightforward and as such easy to be sure of. Okay, defines are generally evil. In this case, the defines can be const size_t declarations. Also, the const char *'s instead of defines are good, but it makes it less readable (for me, at least) when they're lower-cased. I don't see the purpose of having both large arrays when the information is duplicated. I think cache affinity would be better just using the one array (info) anyway. Also, for the stack-allocated string buffers, it's nicer to use sizeof instead of the magic constant. Hope you don't mind the style critique. Congrats on core =) -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message