New comment by loreb on void-packages repository https://github.com/void-linux/void-packages/issues/32185#issuecomment-886256716 Comment: @ericonr til that `LOGNAME` is actually specified by POSIX, I didn't know that... still doas says it sets `LOGNAME`, period, and sudo says it does unless special precautions are taken. If I understand correctly: - musl is technically correct relying on LOGNAME, - sudo & doas setting LOGNAME is technically incorrect (but probably the right choice) unless they actually login with utmp etc (doas doesn't, sudo mentions utmp/wtmp enough time that I believe they do) so either musl resorts to strange hacks to handle the situation or until the musl guys do something like https://skarnet.org/software/utmps/ (unlikely) it looks to me like the current behavior is the least-worst option.