After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 650330 - Network users with longer than 8 character usernames do not show up in user list
Network users with longer than 8 character usernames do not show up in user list
Status: RESOLVED NOTGNOME
Product: gdm
Classification: Core
Component: general
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-16 17:06 UTC by Thomas Meire
Modified: 2011-05-25 01:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Meire 2011-05-16 17:06:12 UTC
From the ubuntu bug report:

Problem:

I am running two installations of Karmic with authentication against an Active Directory server using Likewise Open version 5. As expected, all local users show up in the face browser user list. Additionally, all recent AD users with user names shorter than 8 characters show up in the face browser list as well. The only recent network users absent from the face browser user list are Active Directory users with longer user names.

According to the GDM 2.28 documentation (http://library.gnome.org/admin/gdm/2.28/gdm.html -> see section on /apps/gdm/simple-greeter/include_all), by Default:

"The Face Browser also will display any users that have previously logged in on the system (for example NIS/LDAP users). It gets this list via calling the ck-history ConsoleKit interface."

This actually seems to work for all of the users who use this system with user names equal to or shorter than 8 characters, but it fails if a user's login name is greater than 8 charcters, and I am pretty sure I know why (I just don't know how to fix it).

First, two pieces of evidence. Examining the gdm greeter log file (:0-greeter.log), I find the following warnings repeated over and over:

gdm-simple-greeter[2534]: WARNING: Unable to lookup user name xxxxxxxx: Success
gdm-simple-greeter[2534]: WARNING: Unable to lookup user name yyyyyyyy: Success

Note: I have replaced the actual user names with xxxx's and yyyy's

Each of these are truncated user names (truncated to 8 characters). The first is my own login, from Active Directory. The second is a local user with a longer than 8 character name. It should be noted that, regardless of the warning, the local user still shows up in the user list (this is likely because GDM uses a different mechanism, fgetpwent(), to populate the list with local users), but the network user does not.

As stated in the excerpt above, GDM uses ck-history to populate network users, so I thought it might be prudent to examine the output of the ck-history command. I ran the following command, and discovered the problem:

$ck-history --frequent

The command returned the expected list of recent users, and all of the user names longer than 8 characters WERE truncated.

So, if GDM is just running this command, and parsing the output, it is receiving invalid user names (hence the log file warning, and missing users).

In addition, the problem seems to be a "printing" problem only. If I use ck-history against a particular user name (with the -u or --user commands), it expects the full username, not the truncated one. So, it is not internally truncating user names, only printing them that way. I suspect that (if ck is written in C), it is just a mistake with a printf, or some such, only allowing for an 8 character field.

(Obvious) Potential Solutions:
If my suspicion is correct, and GDM is only parsing the output of the "ck-history --frequent" command, it would seem that the simplest solution would be to use ConsoleKit's API directly (assuming it contains a "history" and "frequent users" mechanism). Or, it might be better to fix ck-history so that it does not truncate user names when printing them.

This problem still exists in gdm 2.30.5 on Ubuntu 10.10
Comment 1 Ray Strode [halfline] 2011-05-16 20:36:14 UTC
Indeed, looking in ConsoleKit I see this:

g_print ("%-8.8s %u\n", username, data->count);

which should probably just be this:

g_print ("%-8s %u\n", username, data->count);

Can you file this on freedesktop.org ?
Comment 2 Ray Strode [halfline] 2011-05-25 01:01:00 UTC
I fixed this in ConsoleKit here:

http://cgit.freedesktop.org/ConsoleKit/commit/?id=803cbdfbd78b66b17ead45b1584d65a258e785bf