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 143552 - g_get_real_name() returns "Unknown"
g_get_real_name() returns "Unknown"
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: general
unspecified
Other Solaris
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2004-06-02 00:46 UTC by Danek Duvall
Modified: 2011-02-18 16:09 UTC
See Also:
GNOME target: ---
GNOME version: 2.5/2.6



Description Danek Duvall 2004-06-02 00:46:57 UTC
When information is missing from the GECOS field in a password entry,
g_get_real_name() returns the string "Unknown".  I believe that it would be more
reasonable to expect the empty string or NULL.

I discovered this when tracking down why "Unknown" was showing up in gedit when
using the sample "User name" plugin.  The plugin checks the return value from
g_get_real_name() by calling strlen() on the result, and assuming that if it was
greater than 0, the call succeeded.  Which it really didn't.

A further argument is that someone could perfectly legitimately have "Unknown"
as their full name in the GECOS field, and then it would be impossible to
distinguish between failure and this name.

One argument against fixing this bug is that applications may already be
checking for "Unknown" and assuming that means failure.  Is that likely, or can
this actually be fixed?  (Bonsai is down right now, so I can't check to see how
long this has been around.)
Comment 1 Matthias Clasen 2004-06-11 03:36:15 UTC
The "Unknown" is wrong anyway, since it should be localized.
Comment 2 Matthias Clasen 2004-07-28 15:39:54 UTC
Decided to leave it as is and just clarify the docs.