From nobody@FreeBSD.org  Mon Nov 29 10:45:47 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 88A2616A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 29 Nov 2004 10:45:47 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 75BF443D46
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 29 Nov 2004 10:45:42 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id iATAjX2c093450
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 29 Nov 2004 10:45:33 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id iATAjWxl093449;
	Mon, 29 Nov 2004 10:45:32 GMT
	(envelope-from nobody)
Message-Id: <200411291045.iATAjWxl093449@www.freebsd.org>
Date: Mon, 29 Nov 2004 10:45:32 GMT
From: Defacto <defacto@cvd.pl>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bad top command display
X-Send-Pr-Version: www-2.3

>Number:         74506
>Category:       bin
>Synopsis:       [patch] bad top command display
>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:   Mon Nov 29 10:50:28 GMT 2004
>Closed-Date:    Sat Feb 23 14:30:34 UTC 2008
>Last-Modified:  Sat Feb 23 14:30:34 UTC 2008
>Originator:     Defacto
>Release:        6.0-CURRENT
>Organization:
>Environment:
FreeBSD test.build.priv 6.0-CURRENT FreeBSD 6.0-CURRENT #14: Mon Nov 29 09:16:05 CEST 2004     root@test.build.priv:/usr/src/sys/i386/compile/WORK  i386
>Description:
      The top command displays improperly informative screen (general information lines) where on SMP systems exists in passwd user name longer than 12 chars or on non-SMP systems user name is longer than 14 chars. This applies to standard text console (80x25 chars).
>How-To-Repeat:
      On SMP system:
pw useradd 1234567890abc; top
On non-SMP system:
pw useradd 1234567890abcde; top

>Fix:
      Apply following patch on /usr/src/usr.bin/top/machine.c:

--- machine.c.org       Mon Nov 29 09:50:14 2004
+++ machine.c   Mon Nov 29 10:01:55 2004
@@ -234,10 +234,10 @@
        }
        if (namelength < 8)
                namelength = 8;
-       if (smpmode && namelength > 13)
-               namelength = 13;
-       else if (namelength > 15)
-               namelength = 15;
+       if (smpmode && namelength > 12)
+               namelength = 12;
+       else if (namelength > 14)
+               namelength = 14;

        kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open");

>Release-Note:
>Audit-Trail:

From: Volker <volker@vwsoft.com>
To: bug-followup@FreeBSD.org, defacto@cvd.pl
Cc:  
Subject: Re: bin/74506: [patch] bad top command display
Date: Sat, 23 Feb 2008 12:35:23 +0100

 A similar approach has been brought into cvs, is now in HEAD, RELENG_7
 and RELENG_6:
 
 changed in src/usr.bin/top/machine.c:
 rev. 1.72 2005-05-16
 
 Also I have tested this on 7.0 and the username now gets limited.
 
 I think, this PR can now be closed.
 
 Thanks!
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Sat Feb 23 14:30:04 UTC 2008 
State-Changed-Why:  
A similar approach was later committed, but thanks for the suggestion. 

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