From owner-freebsd-bugs@FreeBSD.ORG Sun Dec 19 16:30:29 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A99716A4CE for ; Sun, 19 Dec 2004 16:30:29 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A91443D53 for ; Sun, 19 Dec 2004 16:30:29 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iBJGUSId085869 for ; Sun, 19 Dec 2004 16:30:28 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iBJGUSUU085867; Sun, 19 Dec 2004 16:30:28 GMT (envelope-from gnats) Resent-Date: Sun, 19 Dec 2004 16:30:28 GMT Resent-Message-Id: <200412191630.iBJGUSUU085867@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Matthew D.Fuller" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C470A16A4CE for ; Sun, 19 Dec 2004 16:20:20 +0000 (GMT) Received: from mortis.over-yonder.net (adsl-155-73-249.jan.bellsouth.net [68.155.73.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EBAA43D39 for ; Sun, 19 Dec 2004 16:20:20 +0000 (GMT) (envelope-from fullermd@over-yonder.net) Received: by mortis.over-yonder.net (Postfix, from userid 100) id 4F960210DB; Sun, 19 Dec 2004 10:20:19 -0600 (CST) Message-Id: <20041219162019.4F960210DB@mortis.over-yonder.net> Date: Sun, 19 Dec 2004 10:20:19 -0600 (CST) From: "Matthew D.Fuller" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/75259: [PATCH] repquota(8) field size a smidge too small X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Matthew D.Fuller" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2004 16:30:29 -0000 >Number: 75259 >Category: bin >Synopsis: [PATCH] repquota(8) field size a smidge too small >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Dec 19 16:30:27 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Matthew D. Fuller >Release: FreeBSD 5.3-STABLE i386 >Organization: >Environment: System: FreeBSD mortis.sighup.org 5.3-STABLE FreeBSD 5.3-STABLE #0: Sat Nov 20 10:24:06 CST 2004 fullermd@mortis:/usr/obj/usr/src/sys/MORTIS i386 >Description: repquota(8) lists out the quota information for all users on the system. The first field, naturally, contains the username. It's awful convenient and tempting to pipe the output to sort(1) or the like. However, that will break all over you if there's a username that's up at the max size (16). >How-To-Repeat: Add a user with a 16-char username, put in a bunch of files, then do a repquota | sort -n +2 and see if they're near the bottom. >Fix: Index: repquota.c =================================================================== RCS file: /usr/cvs/src/usr.sbin/repquota/repquota.c,v retrieving revision 1.18 diff -u -r1.18 repquota.c --- repquota.c 7 Aug 2004 04:28:54 -0000 1.18 +++ repquota.c 19 Dec 2004 16:14:48 -0000 @@ -229,9 +229,9 @@ } fclose(qf); printf("%*s Block limits File limits\n", - max(UT_NAMESIZE,10), " "); + max(UT_NAMESIZE+1,10), " "); printf("User%*s used soft hard grace used soft hard grace\n", - max(UT_NAMESIZE,10), " "); + max(UT_NAMESIZE+1,10), " "); for (id = 0; id <= highid[type]; id++) { fup = lookup(id, type); if (fup == 0) @@ -239,7 +239,7 @@ if (fup->fu_dqblk.dqb_curinodes == 0 && fup->fu_dqblk.dqb_curblocks == 0) continue; - printf("%-*s", max(UT_NAMESIZE,10), fup->fu_name); + printf("%-*s", max(UT_NAMESIZE+1,10), fup->fu_name); printf("%c%c %8lu %8lu %8lu %6s", fup->fu_dqblk.dqb_bsoftlimit && fup->fu_dqblk.dqb_curblocks >= >Release-Note: >Audit-Trail: >Unformatted: