From owner-freebsd-standards@FreeBSD.ORG Wed Sep 20 20:56:26 2006 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C0C4A16A403 for ; Wed, 20 Sep 2006 20:56:26 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from ems01.seccuris.com (ems01.seccuris.com [204.112.0.35]) by mx1.FreeBSD.org (Postfix) with SMTP id 4434943D5E for ; Wed, 20 Sep 2006 20:56:26 +0000 (GMT) (envelope-from csjp@FreeBSD.org) Received: (qmail 75297 invoked by uid 86); 20 Sep 2006 21:34:35 -0000 Received: from unknown (HELO ?127.0.0.1?) (204.112.0.40) by ems01.seccuris.com with SMTP; 20 Sep 2006 21:34:35 -0000 Message-ID: <4511AAF9.1050804@FreeBSD.org> Date: Wed, 20 Sep 2006 15:56:25 -0500 From: "Christian S.J. Peron" User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: Toby Peterson References: <45101C0E.4010202@FreeBSD.org> <20060920172920.B59572@delplex.bde.org> <5EF9942D-B040-4BAC-9679-7CA909024A55@apple.com> In-Reply-To: <5EF9942D-B040-4BAC-9679-7CA909024A55@apple.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-standards@freebsd.org Subject: Re: [Fwd: Re: df -kP != df -Pk] X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2006 20:56:26 -0000 Toby Peterson wrote: > On 20 September 2006, at 01.04.42, Bruce Evans wrote: > >> On Tue, 19 Sep 2006, Christian S.J. Peron wrote: >> >>> Anyone have any objections to me committing this patch? >> >> % @@ -123,6 +123,7 @@ >> % case 'b': >> % /* FALLTHROUGH */ >> % case 'P': >> % + Pflag++; >> >> Why not just "if (kflag) break;" here? >> >> % putenv("BLOCKSIZE=512"); >> % hflag = 0; >> % break; >> % @@ -171,6 +173,12 @@ >> % argc -= optind; >> % argv += optind; >> % % + /* >> % + * POSIX specifies that if both -P and -k options are used >> together a >> % + * 1k blocksize should be used. >> % + */ >> % + if (Pflag != 0 && kflag != 0) >> % + putenv("BLOCKSIZE=1k"); >> >> Then this would not be needed (except for the comment). >> >> POSIX actually requires BLOCKSIZE to be set to 1024, not to 1k, so >> that the >> header says 1024 and not 1k. df -k causes the wrong output now and the >> above preserves this bug. > > This is essentially what our (Apple's) patches to df do. -P does > nothing if -k is set, and -k sets BLOCKSIZE=1024. > > - Toby > > I just committed this to -CURRENT, as we as changing "1k" to "1024". -- Christian S.J. Peron csjp@FreeBSD.ORG FreeBSD Committer FreeBSD Security Team