From owner-freebsd-audit@FreeBSD.ORG Tue May 27 06:55:48 2003 Return-Path: Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD61237B401 for ; Tue, 27 May 2003 06:55:48 -0700 (PDT) Received: from smtp02.syd.iprimus.net.au (smtp02.syd.iprimus.net.au [210.50.76.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3587D43F85 for ; Tue, 27 May 2003 06:55:48 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (210.50.249.110) by smtp02.syd.iprimus.net.au (7.0.015) id 3ECBEA34000EE898 for audit@FreeBSD.org; Tue, 27 May 2003 23:55:44 +1000 Received: by dilbert.robbins.dropbear.id.au (Postfix, from userid 1000) id A9EBDC90F; Tue, 27 May 2003 23:55:25 +1000 (EST) Date: Tue, 27 May 2003 23:55:25 +1000 From: Tim Robbins To: audit@FreeBSD.org Message-ID: <20030527235525.A47880@dilbert.robbins.dropbear.id.au> References: <200304220700.h3M70CM3058589@freefall.freebsd.org> <20030527084242.GB513@straylight.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030527084242.GB513@straylight.oblivion.bg>; from roam@ringlet.net on Tue, May 27, 2003 at 11:42:42AM +0300 Subject: Re: conf/51256: chkgrp should make sure the file is newline terminated X-BeenThere: freebsd-audit@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD Security Audit List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2003 13:55:49 -0000 On Tue, May 27, 2003 at 11:42:42AM +0300, Peter Pentchev wrote: > Could somebody take a look at this PR and the patch (quoted below), and > see if there's anything wrong with it or it may be committed? [...] > > if ((line = fgetln(gf, &len)) == NULL) > > break; > > + if (len > 0 && line[len - 1] != '\n' && line[len - 1] != '\r') { > > + warnx("%s: line %d: no newline character", gfn, n); > > + e++; > > + } [...] I think that it's unnecessary (and incorrect) to check for a '\r' character at the end of the line. Tim