Gecos parsing with g_get_real_name causes headaches with network authentication.
Submitted by Tony Shadwick
Link to original bug (#627364)
Description
I could go through a whole lot of repetition, but the entirety of this problem is synopsized elsehwere by me:
https://bugs.launchpad.net/indicator-applet/+bug/484238
The short version is that g_get_real_name parses the gecos field up to the first comma. The problem is that when tying into a network authentication schemes, often you will have the format last name, first name. g_get_real_name blindly presumes that you have legacy gecos data there:
"Interpretation of the gecos field varies between systems, but traditionally holds 4 comma-separated fields containing the user's full name, office location, work phone number, and home phone number. An & in the gecos field should be replaced by the user's properly capitalized login name ."
Of course things like a Windows domain could care less about this. The only solution I could come up with was to count commas. If there's only one comma there, presume that it's part of the name. In my case, right now my gecos field has "Shadwick, Tony" since I use likewise-open for authentication. g_get_real_name returns "Shadwick". Now if I had Shadwick, Tony,, Then I might understand. Reality is that in situations where legacy data gets entered (such as local authentication systems), the blank fields are present with repeating commas. I struggle to find a situation where the commas are present without legacy GECOS data being there.
I'm open to alternatives to this, but it is a bit of a problem.