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 644765 - Fallback from real name to username if real name is empty
Fallback from real name to username if real name is empty
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 645438 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-03-14 20:57 UTC by Frederic Peters
Modified: 2011-03-21 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fallback from real name to username in status menu if real name is empty (1.02 KB, patch)
2011-03-14 20:58 UTC, Frederic Peters
none Details | Review
Fallback from real name to username in logout dialog if real name is empty (950 bytes, patch)
2011-03-14 20:58 UTC, Frederic Peters
none Details | Review
gdm: fix empty real name check (1.54 KB, patch)
2011-03-15 19:28 UTC, Ray Strode [halfline]
committed Details | Review
polkit: drop gdmuser naming workaround (1.22 KB, patch)
2011-03-15 19:28 UTC, Ray Strode [halfline]
committed Details | Review

Description Frederic Peters 2011-03-14 20:57:35 UTC
My test user doesn't have a real name set, it gets an empty string, which makes the status menu strange, and the endSessionDialog very strange (" will be logged out...").
Comment 1 Frederic Peters 2011-03-14 20:58:39 UTC
Created attachment 183385 [details] [review]
Fallback from real name to username in status menu if real name is empty
Comment 2 Frederic Peters 2011-03-14 20:58:47 UTC
Created attachment 183386 [details] [review]
Fallback from real name to username in logout dialog if real name is empty
Comment 3 Owen Taylor 2011-03-14 21:08:44 UTC
Can we fix this inside GdmUserManager and then remove the workaround in js/ui/polkitAuthenticationAgent.js rather than duplicating the logic in 3 places? If GDM needs get_real_name() to return "", then it's probably better to add get_display_name() rather than diverging in our code.
Comment 4 Frederic Peters 2011-03-14 22:56:28 UTC
src/gdmuser/gdm-user.c makes a call to AccountsService, but reading accountsservice code I can't understand how it gets set to an empty string, at this hour at least.
Comment 5 Ray Strode [halfline] 2011-03-15 18:29:06 UTC
Given GDM doesn't use GdmUserManager anymore, we should probably not be using it it in the shell either.

Of course, that doesn't solve the original modify-in-3-places problem since GDM does the equivalent check on the output of accounts service. So, I think we need to

1) Add get_display_name() to the accounts service client lib
2) drop gdmuser from the shell and use the client lib
Comment 6 Ray Strode [halfline] 2011-03-15 18:37:56 UTC
Ah actually, we already have this:

const char *
act_user_get_real_name (ActUser *user)
{
...
  return (user->real_name ? user->real_name : user->user_name); 
}

so maybe I should just fix that check to work rather than adding a new function
Comment 7 Ray Strode [halfline] 2011-03-15 18:56:45 UTC
The accountsservice bit is in git now:

http://cgit.freedesktop.org/accountsservice/commit/?id=ee8415ec8d8d6031fc2fee1b9f989fe53668ef47

i'll do a release at some point in the near future
Comment 8 Ray Strode [halfline] 2011-03-15 19:13:54 UTC
I talked to owen about this, and he wants gnome-shell to work without accounts service installed until after 3.0 is released, so we'll need to go with the "muck with gdmuser" approach
Comment 9 Ray Strode [halfline] 2011-03-15 19:28:50 UTC
Created attachment 183459 [details] [review]
gdm: fix empty real name check

gdm_user_get_real_name() checks for an empty real
name and automatically falls back to username if
real name is NULL.  It doesn't automatically fall
back to username if real name is empty, however.

This commit makes it fall back for both cases.
Comment 10 Ray Strode [halfline] 2011-03-15 19:28:56 UTC
Created attachment 183460 [details] [review]
polkit: drop gdmuser naming workaround

The polkit authentication dialog contains logic for
falling back to dispalying a user's username if that
user has not real name.

This logic is no longer needed because gdmuser does it
internally, now.
Comment 11 Owen Taylor 2011-03-15 19:46:55 UTC
Review of attachment 183459 [details] [review]:

Good, thanks!
Comment 12 Owen Taylor 2011-03-15 19:47:18 UTC
Review of attachment 183460 [details] [review]:

Looks good
Comment 13 Owen Taylor 2011-03-21 18:40:58 UTC
*** Bug 645438 has been marked as a duplicate of this bug. ***