Why does it say "User &" on the login screen?
You may have come across this, the title over the password field on the GhostBSD login screen says "User &". At first I thought this was a bug in GhostBSD but it seems to be some behaviour in the upstream display manager LightDM which is the default in the MATE desktop environment.
I don't know if GhostBSD specifically sets this comment field to "User &" when you leave it empty, I couldn't find that bit in the actual set_admin_user function in the GBI (GhostBSD Installer) source which in succession uses the pw useradd command. There is a thread by a FreeBSD user so I suspect it is actually caused by FreeBSD. I could reproduce it by the simple command sudo pw useradd testuser3, the previous commands sudo pw useradd testuser1 -c "" and sudo pw useradd testuser2 -c " " did not create this effect, so it's only created when you omit the -c option. Which I don't quite get as the GBI is using the -c option.
The location where this "User &" resides is in the so-called GECOS field in the /etc/passwd file. There is some further historical background about it by Ken Hess of Red Hat.
In NetBSD there is a similar "Charlie &" which seems to be some kind of inside joke.
But what is the ampersand ('&') all about? It is supposed to be expanded at various locations inside MATE by the GLib function g_get_real_name. This is also described in the manpage of the passwd(5) file. Note how the "sektion" in the FreeBSD manpage URL is German instead of English? If somebody knows why that is please write in the comments. :-)
The full name may contain an ampersand (`&') which will be replaced by
the capitalized login name when the gecos field is displayed or used by
various programs such as finger(1), sendmail(8), etc.
Which leads us to the final question: Why was the expansion of the '&' to the the capitalized (meaning only the first character of the username) not done in LightDM?
This could probably be due to the fact that LightDM has its origin in the Ubuntu world which is Linux and they don't seem to have the convention of putting ampersands into their GECOS fields, at least I don't see that in the manpage of their passwd(5).
Something else I noticed about LightDM is that it is officially no longer maintained (last update 18 July 2022), which begs the question if GhostBSD should maybe switch to another display manager (aka login manager) like Simple Desktop Display Manager (SDDM)?

Comments
Post a Comment