`realname` does not respect the format of the gecos field
HalfVoxel opened this issue · 2 comments
HalfVoxel commented
Describe the bug
whoami may try to get the name from the passwd file. In that file there's a gecos field (https://en.wikipedia.org/wiki/Gecos_field) which whoami assumes is the name of the user. This is however incorrect. The gecos field is a comma separated list of which only the first element is the user's name.
To Reproduce
On my computer calling whoami::realname results in Aron,,,
(note the extra commas).
Expected behavior
Calling whoami::realname should result in Aron
(no commas).
Desktop (please complete the following information):
- OS: [e.g. Ubuntu 20.04.2 LTS]
- Version [e.g. 1.1.1]
AldaronLau commented
@HalfVoxel thanks, I'll look into fixing this!
AldaronLau commented
This is fixed in whoami 1.1.2 (just released), so closing.