From ben@scientia.demon.co.uk Thu Apr  1 09:07:11 1999
Return-Path: <ben@scientia.demon.co.uk>
Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13])
	by hub.freebsd.org (Postfix) with ESMTP id 20EEA14E3E
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  1 Apr 1999 09:06:53 -0800 (PST)
	(envelope-from ben@scientia.demon.co.uk)
Received: from scientia.demon.co.uk (ident=ben)
	by scientia.demon.co.uk with local (Exim 2.12 #4)
	id 10Skpn-000Mvm-00 for FreeBSD-gnats-submit@freebsd.org;
	Thu, 1 Apr 1999 18:00:51 +0100
	(envelope-from ben@scientia.demon.co.uk)
Message-Id: <E10Skpn-000Mvm-00@scientia.demon.co.uk>
Date: Thu, 1 Apr 1999 18:00:51 +0100
From: Ben Smithurst <ben@scientia.demon.co.uk>
Reply-To: ben@scientia.demon.co.uk
To: FreeBSD-gnats-submit@freebsd.org
Subject: sa(8) is hard coded for 8 character user names
X-Send-Pr-Version: 3.2

>Number:         10905
>Category:       bin
>Synopsis:       sa(8) is hard coded for 8 character user names
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr  1 09:10:01 PST 1999
>Closed-Date:    Tue May 30 08:27:45 CDT 2000
>Last-Modified:  Tue May 30 08:28:51 CDT 2000
>Originator:     Ben Smithurst
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
>Environment:

Any system without 8 character user names, such as -current, -stable,
3.*-release

>Description:

When doing `sa -m', the width of the first column is hard coded for 8
character user names. Not really very serious, I suppose, but probably
a bug all the same. Or possibly there is a reason for this, but I don't
see a valid reason.

>How-To-Repeat:

>Fix:

--- usrdb.c.orig	Thu Apr  1 17:54:27 1999
+++ usrdb.c	Thu Apr  1 17:56:11 1999
@@ -33,6 +33,7 @@
 	"$Id: usrdb.c,v 1.6 1997/10/15 06:41:19 charnier Exp $";
 #endif /* not lint */
 
+#include <sys/param.h>
 #include <sys/types.h>
 #include <sys/acct.h>
 #include <err.h>
@@ -236,7 +237,7 @@
 	while (rv == 0) {
 		ui = (struct userinfo *) data.data;
 
-		printf("%-8s %9qu ",
+		printf("%-*s %9qu ", MAXLOGNAME - 1,
 		    user_from_uid(ui->ui_uid, 0), ui->ui_calls);
 
 		t = (double) (ui->ui_utime + ui->ui_stime) /

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ghelmer 
State-Changed-When: Tue May 30 08:27:45 CDT 2000 
State-Changed-Why:  
Patch committed in src/usr.sbin/sa/usrdb.c rev 1.9.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=10905 
>Unformatted:
