I can enter brackets, but not commas, as one example.
(When CHFN_RESTRICT
is frwh
), chfn --full-name ","
returns “has illegal characters”, so it looks like GECOS doesn’t have a way to escape characters, although I’ve asked to confirm: [1]
If so, how ridiculous.
If I understand correctly, the lack of an escape character for the GECOS field comes down to a lack of coordination. There is no one piece of software that manages access to this field, so every piece of software that uses that value would have to agree on the syntax and implement it — an impossible task for a format that’s been in use for decades and was only loosely-defined in the first place.
There’s still some software out there that doesn’t recognize the GECOS subfields in the first place. That software treats commas as normal characters, confusing software that does recognize the subfields.
@smammy, thanks. Though, it’s then rather remarkable that there’s been no effort to replace it. I would be surprised if a proposed JSON or XML replacement, for instance, wouldn’t be of instant popularity considering the ease with which it can be parsed.
Do you know of any?