From wkwu@Kavalan.csie.NCTU.edu.tw  Wed Aug 23 03:27:43 2000
Return-Path: <wkwu@Kavalan.csie.NCTU.edu.tw>
Received: from Kavalan.csie.NCTU.edu.tw (kavalan.csie.nctu.edu.tw [140.113.215.245])
	by hub.freebsd.org (Postfix) with ESMTP id C3D3D37B43C
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Aug 2000 03:27:42 -0700 (PDT)
Received: (from wkwu@localhost)
	by Kavalan.csie.NCTU.edu.tw (8.9.3/8.9.3) id SAA10196;
	Wed, 23 Aug 2000 18:26:25 +0800 (CST)
	(envelope-from wkwu)
Message-Id: <200008231026.SAA10196@Kavalan.csie.NCTU.edu.tw>
Date: Wed, 23 Aug 2000 18:26:25 +0800 (CST)
From: wkwu@Kavalan.csie.NCTU.edu.tw
Reply-To: wkwu@Kavalan.csie.NCTU.edu.tw
To: FreeBSD-gnats-submit@freebsd.org
Subject: top's problem
X-Send-Pr-Version: 3.2

>Number:         20799
>Category:       bin
>Synopsis:       top's problem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    peter
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 23 03:30:01 PDT 2000
>Closed-Date:    Fri May 04 18:35:34 GMT 2007
>Last-Modified:  Fri May 04 18:35:34 GMT 2007
>Originator:     Wei-Kai Wu
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Kavalan
>Environment:

Nothing about the Environment.

>Description:

We use yp for about 2000 users. Inside the 'top' source, 
/usr/src/usr.bin/top/machine.c: line 238:

    while ((pw = getpwent()) != NULL) {
        if (strlen(pw->pw_name) > namelength)
            namelength = strlen(pw->pw_name);
    }
    if (namelength < 8)
        namelength = 8;
    if (namelength > 15)
        namelength = 15; 

we have to comment above, and added only line:
	namelength = 9;

Because the 'top' command will delay about 7-seconds if we use
the original source. I am wondered why the 'top' dump all yp-passwd
to get 'namelength'. It seems a little stupid.

>How-To-Repeat:

>Fix:

comment above, and added only line: (Maybe you have beeter idea:)
        namelength = 9;

>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@orbitel.bg>
To: wkwu@Kavalan.csie.NCTU.edu.tw
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/20799: top's problem
Date: Wed, 23 Aug 2000 14:09:59 +0300

 If you want to hardcode a username length limit, you'd be better off
 with the max value - 15, in this case; or use a value provided by
 the OS - UT_NAMESIZE comes to mind.
 
 On Wed, Aug 23, 2000 at 06:26:25PM +0800, wkwu@Kavalan.csie.NCTU.edu.tw wrote:
 > >Synopsis:       top's problem
 > 
 > >Description:
 [snip]
 > 
 > we have to comment above, and added only line:
 > 	namelength = 9;
 > 
 > Because the 'top' command will delay about 7-seconds if we use
 > the original source. I am wondered why the 'top' dump all yp-passwd
 > to get 'namelength'. It seems a little stupid.
 
 G'luck,
 Peter
 
 -- 
 This inert sentence is my body, but my soul is alive, dancing in the sparks of your brain.
 
Responsible-Changed-From-To: freebsd-bugs->davidn 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Wed Aug 23 04:46:09 PDT 2000 
Responsible-Changed-Why:  
David, could you chat to Peter Wemm and find out whether his 
hackaround in rev 1.5 of machine.c is still required? 
Given that namelength is now doubly bounded, it seems 
to make sense that we hard-code 9 in there as suggested 
in this PR.   

http://www.freebsd.org/cgi/query-pr.cgi?pr=20799 
Responsible-Changed-From-To: davidn->peter 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Fri Mar 14 21:54:41 PST 2003 
Responsible-Changed-Why:  

davidn is no longer with us, and Peter seems to know something about this 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20799 

From: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
To: bug-followup@FreeBSD.org, wkwu@Kavalan.csie.NCTU.edu.tw
Cc:  
Subject: Re: bin/20799: top's problem
Date: Fri, 04 May 2007 15:53:20 +0100

 This is still a problem on 6.2.  PR bin/89762 is a duplicate of this,
 but has a better solution which allows for compile-time configuration of
 top(1) to avoid the issue.  Therefore this PR can probably be closed.
State-Changed-From-To: open->closed 
State-Changed-By: remko 
State-Changed-When: Fri May 4 18:35:32 UTC 2007 
State-Changed-Why:  
duplicate of 89762, reported by gavin 

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