From ted@localhost.plymouth.edu  Wed May  3 21:25:02 1995
Received: from localhost.plymouth.edu (prhs.plymouth.edu [158.136.155.158])
          by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id VAA18382
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 3 May 1995 21:25:01 -0700
Received: (from ted@localhost) by localhost.plymouth.edu (8.6.11/8.6.9) id AAA04099; Thu, 4 May 1995 00:25:37 GMT
Message-Id: <199505040025.AAA04099@localhost.plymouth.edu>
Date: Thu, 4 May 1995 00:25:37 GMT
From: ted@wiz.plymouth.edu
Reply-To: ted@wiz.plymouth.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: Quota commands (repquota/edquota/quota) not giving correct info.
X-Send-Pr-Version: 3.2

>Number:         381
>Category:       bin
>Synopsis:       Quota commands (repquota/edquota/quota) not giving correct info.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May  3 21:30:01 1995
>Closed-Date:    Sun May 7 02:14:32 PDT 1995
>Last-Modified:
>Originator:     Ted Wisniewski
>Release:        FreeBSD 2.1.0-Development i386
>Organization:
Plymouth State College
>Environment:

	

>Description:

	edquota, repquota & quota not reporting blocks of quota correctly,
	always reporting incorrect information including an (NULL) under
	the Warning info part of 'quota'.

>How-To-Repeat:

	Enable quota's give a user a quota and do repquota/quota/edquota
the problem is clear.

>Fix:
	
Enclosed are the diffs to correct each:

******* for usr.sbin/edquota/edquota.c

385,387c385,387
< 		    qup->dqblk.dqb_curblocks / 2,
< 		    qup->dqblk.dqb_bsoftlimit / 2,
< 		    qup->dqblk.dqb_bhardlimit / 2);
---
> 		    dbtob(qup->dqblk.dqb_curblocks) / 1024,
> 		    dbtob(qup->dqblk.dqb_bsoftlimit) / 1024,
> 		    dbtob(qup->dqblk.dqb_bhardlimit) / 1024);
438,440c438,440
< 		dqblk.dqb_curblocks = (dqblk.dqb_curblocks * 2);
< 		dqblk.dqb_bsoftlimit = (dqblk.dqb_bsoftlimit * 2);
< 		dqblk.dqb_bhardlimit = (dqblk.dqb_bhardlimit * 2);
---
> 		dqblk.dqb_curblocks = btodb(dqblk.dqb_curblocks * 1024);
> 		dqblk.dqb_bsoftlimit = btodb(dqblk.dqb_bsoftlimit * 1024);
> 		dqblk.dqb_bhardlimit = btodb(dqblk.dqb_bhardlimit * 1024);



******* For usr.bin/quota/quota.c


320c320
< 				, qup->dqblk.dqb_curblocks / 2
---
> 				, dbtob(qup->dqblk.dqb_curblocks) / 1024
322,323c322,323
< 				, qup->dqblk.dqb_bsoftlimit / 2
< 				, qup->dqblk.dqb_bhardlimit / 2
---
> 				, dbtob(qup->dqblk.dqb_bsoftlimit) / 1024
> 				, dbtob(qup->dqblk.dqb_bhardlimit) / 1024


******* for usr.sbin/repquota/repquota.c


223,225c223,225
< 			    fup->fu_dqblk.dqb_curblocks / 2,
< 			    fup->fu_dqblk.dqb_bsoftlimit / 2,
< 			    fup->fu_dqblk.dqb_bhardlimit / 2,
---
> 			dbtob(fup->fu_dqblk.dqb_curblocks) / 1024,
> 			dbtob(fup->fu_dqblk.dqb_bsoftlimit) / 1024,
> 			dbtob(fup->fu_dqblk.dqb_bhardlimit) / 1024,
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: bde 
State-Changed-When: Sun May 7 02:14:32 PDT 1995 
State-Changed-Why:  
Fixed in rev.1.2 of quota.c, rev.1.3 of edquota.c and rev.1.2 of repquota.c. 
The problem was actually mismatched printf format args. 
>Unformatted:



