From owner-freebsd-audit Fri Feb 16 6:24:23 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id 3CDDC37B67D for ; Fri, 16 Feb 2001 06:24:21 -0800 (PST) Received: from hamlet.nectar.com (hamlet.nectar.com [10.0.1.102]) by gw.nectar.com (Postfix) with ESMTP id 7E15A19380; Fri, 16 Feb 2001 08:24:20 -0600 (CST) Received: (from nectar@localhost) by hamlet.nectar.com (8.11.2/8.9.3) id f1GEOKi85658; Fri, 16 Feb 2001 08:24:20 -0600 (CST) (envelope-from nectar@spawn.nectar.com) Date: Fri, 16 Feb 2001 08:24:20 -0600 From: "Jacques A. Vidrine" To: Mike Heffner Cc: FreeBSD-audit , Nathan Ahlstrom Subject: Re: mail(1) cleanup patch Message-ID: <20010216082420.A85640@hamlet.nectar.com> Mail-Followup-To: "Jacques A. Vidrine" , Mike Heffner , FreeBSD-audit , Nathan Ahlstrom References: <20010215214346.A28110@spawn.nectar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mheffner@vt.edu on Thu, Feb 15, 2001 at 11:44:19PM -0500 X-Url: http://www.nectar.com/ Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Feb 15, 2001 at 11:44:19PM -0500, Mike Heffner wrote: > > On 16-Feb-2001 Jacques A. Vidrine wrote: > | Well, actually, it _is_ a macro -- which expands to an inline. But at > ... > > Alright, I redid the patch. I also axed copy() as it was just a hidden > strcpy(), and was only used in one place. > > http://filebox.vt.edu/users/mheffner/patches/mail.patch This looks good. There are always more nits :-) but mostly they were there before you arrived. Nothing earth-shattering, I think, but hey, ``while you are there'': Purely -audit fodder: = Are you certain that in each case where you've used snprintf/strlcpy, that truncation is harmless? Perhaps better to check. Stuff like `cp += strlcpy(...)' is particularly suspect. = Paranoia about strcpy->strlcpy is good, but then there are some calls that could be converted from strcat->strlcat. Stuff I couldn't keep to myself (I tried): = anyof() can be tossed, and strpbrk() used directly. = There's some inconsistent usage of err vs errx. = NOSTR, NIL, NONE, NOVAR, NOGRP, NOGE are misspellings of NULL. = creat is the ancient way of spelling open(..., O_CREAT|O_TRUNC|O_WRONLY, ...); Thanks for the hard work! Cheers, -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message