#3 Add LDAP user lookup

Everything (4)
John B

In order to become compliant with that I.T. hell known
at Sarbanes-Oxley, my company has moved to LDAP for
user and password management. Unfortunately, top
apparently only looks at /etc/passwd for user name

Even though it would mean a hit on CPU cycles due to
LDAP queries, it would be nice to have the option to
compile top to look at LDAP. It would be preferable to
have some kind of temporary caching so that it only
needs to look up user IDs that it didn't already look
up in that instance to save on LDAP calls. Yes, I'm
sure that this would be a significant change because of
the need for the DN and attributes, but I would think
that information could be provided in a top.cfg or

I checked the documentation both on-line and included
with the source code and didn't see anything like this
available. I find it hard to believe that no one has
requested it before now.


    • assigned_to: nobody --> wnl
  • Logged In: YES

    Top uses getpwuid. I would expect LDAP user lookups to be
    accessible through this mechanism. Are they not? Top
    version 3.5 will attempt to iterate over the password file
    with getpwent only if you tell Configure not to use random
    password access.

  • John B
    John B

    Logged In: YES

    In fairness, I used the compiled version from
    SunFreeware.com, which was available as of 6 December 2004.
    I did not compile it myself. The man pages also say that
    it goes to /etc/passwd. So, I put one and one together, but
    it's possible that I came up with three instead.

    All I know is that when the pre-compiled top is run on a
    system running LDAP, all that we see are the numeric user
    IDs, not the user names.

    I will compile it myself to see if there is something that
    SunFreeware might have missed.

  • John B
    John B

    Logged In: YES

    Okay. That was it.

    When I was asked to use random access, I answer "yes". Top
    now resolves user names through LDAP. Looks like
    SunFreeware uses default answers.

    Looks like this feature request can be closed. Thanks!

    • status: open --> closed
  • Logged In: YES

    Ah great! Thanks for the update. Version 3.6 won't have
    that choice as everything will be done via getpwuid, and
    this will not be an issue. 3.6 is currently available as an
    alpha test if you want to give it a try.