From owner-freebsd-audit@FreeBSD.ORG Tue Jun 3 18:05:20 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 BA08537B401 for ; Tue, 3 Jun 2003 18:05:20 -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 25DA843F3F for ; Tue, 3 Jun 2003 18:05:20 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (203.134.172.104) by smtp02.syd.iprimus.net.au (7.0.015) id 3ECBEA3400210370 for audit@FreeBSD.org; Wed, 4 Jun 2003 11:05:17 +1000 Received: by dilbert.robbins.dropbear.id.au (Postfix, from userid 1000) id B6755C90F; Wed, 4 Jun 2003 11:01:25 +1000 (EST) Date: Wed, 4 Jun 2003 11:01:25 +1000 From: Tim Robbins To: audit@FreeBSD.org Message-ID: <20030604110125.A41509@dilbert.robbins.dropbear.id.au> References: <200304220700.h3M70CM3058589@freefall.freebsd.org> <20030527084242.GB513@straylight.oblivion.bg> <20030527235525.A47880@dilbert.robbins.dropbear.id.au> <20030527142122.GG513@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: <20030527142122.GG513@straylight.oblivion.bg>; from roam@ringlet.net on Tue, May 27, 2003 at 05:21:22PM +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: Wed, 04 Jun 2003 01:05:21 -0000 On Tue, May 27, 2003 at 05:21:22PM +0300, Peter Pentchev wrote: > On Tue, May 27, 2003 at 11:55:25PM +1000, Tim Robbins wrote: > > 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. > > Okay, this might have been a bad habit of processing files that came > from Over There ;) So.. how about the patch with only the '\n' check, > then? Yes, it looks fine now. Sorry for taking so long to get back to you about this. Tim