From netch@carrier.kiev.ua  Thu Dec 28 07:31:21 2000
Return-Path: <netch@carrier.kiev.ua>
Received: from sivka.carrier.kiev.ua (sivka.carrier.kiev.ua [193.193.193.101])
	by hub.freebsd.org (Postfix) with ESMTP id 5A04D37B402
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Dec 2000 07:31:19 -0800 (PST)
Received: from planka.carrier.kiev.ua (users.lucky.net [193.193.193.106])
        by sivka.carrier.kiev.ua (8/Kilkenny_is_better) with ESMTP id RMA55870
        for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Dec 2000 17:31:12 +0200 (EET)
        (envelope-from netch@carrier.kiev.ua)
Received: (from root@localhost)
	by planka.carrier.kiev.ua (8) id RMA44256;
	Thu, 28 Dec 2000 17:31:12 +0200 (EET)
	(envelope-from netch)
Message-Id: <200012281531.RMA44256@planka.carrier.kiev.ua>
Date: Thu, 28 Dec 2000 17:31:12 +0200 (EET)
From: netch@segfault.kiev.ua (Valentin Nechayev)
Sender: netch@carrier.kiev.ua
Reply-To: netch@segfault.kiev.ua
To: FreeBSD-gnats-submit@freebsd.org
Subject: repquota format fix
X-Send-Pr-Version: 3.2

>Number:         23908
>Category:       bin
>Synopsis:       repquota format fix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 28 07:40:01 PST 2000
>Closed-Date:    Mon Jun 18 17:47:26 PDT 2001
>Last-Modified:  Mon Jun 18 17:47:36 PDT 2001
>Originator:     netch@netch.kiev.ua (Valentin Nechayev)
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
Lucky Net Ltd.
>Environment:

any FreeBSD system

>Description:

repquota (/usr/sbin/repquota) output format is hard to parse in sh/awk/perl/...
programs due to field number unstableness. If user overflowed soft limit,
"grace" field is non-empty, otherwise empty; "files used" field is 7th or
6th accordingly. Variable number of spaces between fields makes problem hardier.
Of course, script can parse 2nd field with its "+-", "-+", etc., but it is
ugly imho. Change to print "-" in grace field makes output more strong and
beauty.

>How-To-Repeat:

Run repquota on file system with some users with overflowing of soft limit,
and some without it.

>Fix:

--- src/usr.sbin/repquota/repquota.c.orig	Mon Nov  1 06:46:09 1999
+++ src/usr.sbin/repquota/repquota.c	Thu Dec 28 17:19:50 2000
@@ -255,7 +255,7 @@
 			fup->fu_dqblk.dqb_bsoftlimit &&
 			    fup->fu_dqblk.dqb_curblocks >=
 			    fup->fu_dqblk.dqb_bsoftlimit ?
-			    timeprt(fup->fu_dqblk.dqb_btime) : "");
+			    timeprt(fup->fu_dqblk.dqb_btime) : "-");
 		printf("  %7lu %7lu %7lu %6s\n",
 			fup->fu_dqblk.dqb_curinodes,
 			fup->fu_dqblk.dqb_isoftlimit,
@@ -263,7 +263,7 @@
 			fup->fu_dqblk.dqb_isoftlimit &&
 			    fup->fu_dqblk.dqb_curinodes >=
 			    fup->fu_dqblk.dqb_isoftlimit ?
-			    timeprt(fup->fu_dqblk.dqb_itime) : "");
+			    timeprt(fup->fu_dqblk.dqb_itime) : "-");
 		fup->fu_dqblk = zerodqblk;
 	}
 	return (0);

>Release-Note:
>Audit-Trail:

From: Valentin Nechayev <netch@netch.kiev.ua>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/23908: repquota format fix
Date: Thu, 28 Dec 2000 19:16:16 +0200

 Oh, this is exact duplicate of bin/15739 of mine, sent exactly year ago,
 after previous setup of our mail-and-little-webs host ;;((
 
 Well, and what about applying of this fix?
 
 > Thank you very much for your problem report.
 > It has the internal identification `bin/23908'.
 > The individual assigned to look at your
 > report is: freebsd-bugs. 
 > 
 > You can access the state of your problem report at any time
 > via this link:
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=23908
 > 
 > >Category:       bin
 > >Responsible:    freebsd-bugs
 > >Synopsis:       repquota format fix
 > >Arrival-Date:   Thu Dec 28 07:40:01 PST 2000
 
 
 /netch
 
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Mon Jun 18 17:47:26 PDT 2001 
State-Changed-Why:  
Duplicate of PR 15739. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=23908 
>Unformatted:
