From andre.albsmeier@mchp.siemens.de  Tue Nov 17 07:14:23 1998
Received: from david.siemens.de (david.siemens.de [192.35.17.14])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA23211
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 17 Nov 1998 07:14:21 -0800 (PST)
          (envelope-from andre.albsmeier@mchp.siemens.de)
Received: from mail.siemens.de (salomon.siemens.de [139.23.33.13])
	by david.siemens.de (8.9.1a/8.9.1) with ESMTP id QAA09882
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 17 Nov 1998 16:13:40 +0100 (MET)
Received: from curry.mchp.siemens.de (daemon@curry.mchp.siemens.de [146.180.31.23])
	by mail.siemens.de (8.9.1a/8.9.1) with ESMTP id QAA14298
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 17 Nov 1998 16:13:42 +0100 (MET)
Received: (from daemon@localhost)
	by curry.mchp.siemens.de (8.8.8/8.8.8) id QAA03648
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 17 Nov 1998 16:13:41 +0100 (CET)
Message-Id: <199811171513.QAA14761@internal>
Date: Tue, 17 Nov 1998 16:13:38 +0100 (CET)
From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: FreeBSD-gnats-submit@freebsd.org
Subject: repquota output needs new formatting (diffs included)
X-Send-Pr-Version: 3.2

>Number:         8730
>Category:       bin
>Synopsis:       repquota output needs new formatting (diffs included)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 17 07:20:01 PST 1998
>Closed-Date:    Thu Nov 26 21:46:20 PST 1998
>Last-Modified:  Thu Nov 26 21:47:42 PST 1998
>Originator:     Andre Albsmeier
>Release:        FreeBSD 2.2.7-STABLE i386
>Organization:
>Environment:

FreeBSD 2.2.7-STABLE with quotas enabled

>Description:

The output of repquota is screwed up if a user may have more that
99999 files:

root@server:~>repquota -a
                        Block limits               File limits
User            used    soft    hard  grace    used  soft  hard  grace
riek      --  258559  400000 1200000          13928 40000120000
...

Here the hard limits are 120000 files. This output is difficult to
get parsed by shell scripts, for example.

Since big hard disks get cheaper every day, I would suggest changing
the output format a little for both, block and file data.

>How-To-Repeat:

Set the quotas as shown above.

>Fix:

--- usr.sbin/repquota/repquota.c.ORI	Tue Nov 17 15:53:51 1998
+++ usr.sbin/repquota/repquota.c	Tue Nov 17 15:59:29 1998
@@ -216,8 +216,8 @@
 		fup->fu_dqblk = dqbuf;
 	}
 	fclose(qf);
-	printf("                        Block limits               File limits\n");
-	printf("User            used    soft    hard  grace    used  soft  hard  grace\n");
+	printf("                          Block limits                    File limits\n");
+	printf("User             used     soft     hard  grace     used   soft   hard  grace\n");
 	for (id = 0; id <= highid[type]; id++) {
 		fup = lookup(id, type);
 		if (fup == 0)
@@ -226,7 +226,7 @@
 		    fup->fu_dqblk.dqb_curblocks == 0)
 			continue;
 		printf("%-10s", fup->fu_name);
-		printf("%c%c%8lu%8lu%8lu%7s",
+		printf("%c%c%9lu%9lu%9lu%7s",
 			fup->fu_dqblk.dqb_bsoftlimit &&
 			    fup->fu_dqblk.dqb_curblocks >=
 			    fup->fu_dqblk.dqb_bsoftlimit ? '+' : '-',
@@ -240,7 +240,7 @@
 			    fup->fu_dqblk.dqb_curblocks >=
 			    fup->fu_dqblk.dqb_bsoftlimit ?
 			    timeprt(fup->fu_dqblk.dqb_btime) : "");
-		printf("  %6lu%6lu%6lu%7s\n",
+		printf("  %7lu%7lu%7lu%7s\n",
 			fup->fu_dqblk.dqb_curinodes,
 			fup->fu_dqblk.dqb_isoftlimit,
 			fup->fu_dqblk.dqb_ihardlimit,
>Release-Note:
>Audit-Trail:

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: bin/8730: repquota output needs new formatting (diffs included)
Date: Wed, 25 Nov 1998 08:19:40 +0100

 The following patch is much better. It assures that the output
 remains easily parseable by shell scripts even if the formatting
 overflows. Thanks to Joseph Koshy for pointing me to this!
 
 
 --- repquota.c.ORI	Mon Mar  9 20:07:46 1998
 +++ repquota.c	Wed Nov 25 08:07:24 1998
 @@ -216,8 +216,8 @@
  		fup->fu_dqblk = dqbuf;
  	}
  	fclose(qf);
 -	printf("                        Block limits               File limits\n");
 -	printf("User            used    soft    hard  grace    used  soft  hard  grace\n");
 +	printf("                          Block limits                     File limits\n");
 +	printf("User             used     soft     hard  grace     used    soft    hard  grace\n");
  	for (id = 0; id <= highid[type]; id++) {
  		fup = lookup(id, type);
  		if (fup == 0)
 @@ -226,7 +226,7 @@
  		    fup->fu_dqblk.dqb_curblocks == 0)
  			continue;
  		printf("%-10s", fup->fu_name);
 -		printf("%c%c%8lu%8lu%8lu%7s",
 +		printf("%c%c %8lu %8lu %8lu %6s",
  			fup->fu_dqblk.dqb_bsoftlimit &&
  			    fup->fu_dqblk.dqb_curblocks >=
  			    fup->fu_dqblk.dqb_bsoftlimit ? '+' : '-',
 @@ -240,7 +240,7 @@
  			    fup->fu_dqblk.dqb_curblocks >=
  			    fup->fu_dqblk.dqb_bsoftlimit ?
  			    timeprt(fup->fu_dqblk.dqb_btime) : "");
 -		printf("  %6lu%6lu%6lu%7s\n",
 +		printf("  %7lu %7lu %7lu %6s\n",
  			fup->fu_dqblk.dqb_curinodes,
  			fup->fu_dqblk.dqb_isoftlimit,
  			fup->fu_dqblk.dqb_ihardlimit,
State-Changed-From-To: open->closed 
State-Changed-By: jkoshy 
State-Changed-When: Thu Nov 26 21:46:20 PST 1998 
State-Changed-Why:  
Fixed in rev 1.3.6.4 of "src/usr.sbin/repquota/repquota.c".  Commit 
to -current branch will follow in a day or two. 
>Unformatted:
