New comment by loreb on void-packages repository https://github.com/void-linux/void-packages/issues/32185#issuecomment-886249014 Comment: POSIX says that "The login name shall be the string that would be returned by the getlogin() function", so that's it. One could argue that musl implements getlogin incorrectly - "a string containing the user name associated by the login activity with the controlling terminal of the current process" looks to me like they don't care if you ran sudo or equivalent, but rather only what you logged in as; I hope to be wrong here, because if I'm running anything as root I'd expect getlogin & friends to say I'm root. That being said, I'm not a POSIX lawyer, so... - linux: unclear - openbsd: "This is true even if some of those processes assume another user ID, for example when su(1) is used" - freebsd/netbsd: same as openbsd - illumos (https://illumos.org/man/3c/getlogin) uses utmpx, similar to IBM ... so overall I suppose this is a bug in musl's implementation of getlogin, but as they intentionally don't implement the utmp functions I'm not sure how to fix that.