From owner-freebsd-stable@FreeBSD.ORG Wed Sep 20 20:59:07 2006 Return-Path: X-Original-To: freebsd-stable@FreeBSD.org Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 38FF816A407 for ; Wed, 20 Sep 2006 20:59:07 +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 8A71B43D70 for ; Wed, 20 Sep 2006 20:59:06 +0000 (GMT) (envelope-from csjp@FreeBSD.org) Received: (qmail 75557 invoked by uid 86); 20 Sep 2006 21:37:15 -0000 Received: from unknown (HELO ?127.0.0.1?) (204.112.0.40) by ems01.seccuris.com with SMTP; 20 Sep 2006 21:37:15 -0000 Message-ID: <4511AB9A.2020001@FreeBSD.org> Date: Wed, 20 Sep 2006 15:59:06 -0500 From: "Christian S.J. Peron" User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: Andriy Gapon References: <45101281.7090508@icyb.net.ua> <45101832.7010009@FreeBSD.org> <451019A0.4040602@icyb.net.ua> In-Reply-To: <451019A0.4040602@icyb.net.ua> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@FreeBSD.org Subject: Re: df -kP != df -Pk X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2006 20:59:07 -0000 FYI, I have taken care of this in -CURRENT Thanks for the report! csjp 2006-09-20 20:55:02 UTC FreeBSD src repository Modified files: bin/df df.c Log: Based on The Open Group Base Specifications Issue 6 IEEE Std 1003.1, our current implementation of df(1) is does not properly format the output under certain conditions. Right now -kP and -Pk are not the same thing. Further, when we set the BLOCKSIZE environment variable, we use "1k" instead of "1024", making the header display incorrectly. To quote the specification: "When both the -k and -P options are specified, the following header line shall be written (in the POSIX locale): "Filesystem 1024-blocks Used Available Capacity Mounted on\n" - If -P has been specified, check to make sure that -k has not already been specified, if so, simply break instead of clobbering the previous blocksize - Use 1024 instead of 1k to make the header POSIX compliant Reported by: Andriy Gapon Discussed with: bde, ru MFC after: 1 week Revision Changes Path 1.66 +11 -2 src/bin/df/df.c Andriy Gapon wrote: > on 19/09/2006 19:17 Christian S.J. Peron said the following: > >> Andriy Gapon wrote: >> >>> It seems that -P flag to df resets previously specified -k for no good >>> reason. POSIX expressly talks about -P and -k being used together. >>> http://www.opengroup.org/onlinepubs/009695399/utilities/df.html >>> >>> This is FreeBSD 6.1-RELEASE-p2 i386. >>> >>> >>> >> Please test the attached patch and let me know if it's good for you. >> >> Thanks for bringing this to our attention. >> > > Yes, the patch works very well. Thank you for the lightning-fast response. > > > -- Christian S.J. Peron csjp@FreeBSD.ORG FreeBSD Committer FreeBSD Security Team