From owner-freebsd-standards@FreeBSD.ORG Tue Sep 19 16:34:27 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 6E3FC16A412 for ; Tue, 19 Sep 2006 16:34:27 +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 4B3BD43D6D for ; Tue, 19 Sep 2006 16:34:22 +0000 (GMT) (envelope-from csjp@FreeBSD.org) Received: (qmail 49830 invoked by uid 86); 19 Sep 2006 17:11:58 -0000 Received: from unknown (HELO ?127.0.0.1?) (204.112.0.40) by ems01.seccuris.com with SMTP; 19 Sep 2006 17:11:58 -0000 Message-ID: <45101C0E.4010202@FreeBSD.org> Date: Tue, 19 Sep 2006 11:34:22 -0500 From: "Christian S.J. Peron" User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: freebsd-standards@FreeBSD.org Content-Type: multipart/mixed; boundary="------------060507050802060600000403" Cc: Subject: [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: Tue, 19 Sep 2006 16:34:27 -0000 This is a multi-part message in MIME format. --------------060507050802060600000403 Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit Anyone have any objections to me committing this patch? -------- Original Message -------- Subject: Re: df -kP != df -Pk Date: Tue, 19 Sep 2006 11:17:54 -0500 From: Christian S.J. Peron To: Andriy Gapon CC: freebsd-stable@freebsd.org References: <45101281.7090508@icyb.net.ua> 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. -- Christian S.J. Peron csjp@FreeBSD.ORG FreeBSD Committer FreeBSD Security Team --------------060507050802060600000403 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="df.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="df.c.diff" ? df ? df.1.gz ? df.c.diff Index: df.c =================================================================== RCS file: /home/ncvs/src/bin/df/df.c,v retrieving revision 1.64 diff -u -r1.64 df.c --- df.c 10 Jan 2005 08:39:21 -0000 1.64 +++ df.c 19 Sep 2006 16:14:37 -0000 @@ -93,7 +93,7 @@ return (a > b ? a : b); } -static int aflag = 0, cflag, hflag, iflag, nflag; +static int aflag = 0, cflag, hflag, kflag, iflag, nflag, Pflag; static struct ufs_args mdev; int @@ -123,6 +123,7 @@ case 'b': /* FALLTHROUGH */ case 'P': + Pflag++; putenv("BLOCKSIZE=512"); hflag = 0; break; @@ -143,6 +144,7 @@ iflag = 1; break; case 'k': + kflag++; putenv("BLOCKSIZE=1k"); 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"); mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); bzero(&maxwidths, sizeof(maxwidths)); for (i = 0; i < mntsize; i++) --------------060507050802060600000403 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="file:///tmp/nsmail-2.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="file:///tmp/nsmail-2.txt" _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" --------------060507050802060600000403--