Not sure what's the reason for this. I have clearenvironment=no set and the command works as normal user. When i set the login shell to sudosh the output is empty. I still can run who without problems from bash.
coreutils is processing utmp in a manner that ignores TTYs that aren't associated with logins, which includes sudosh. This includes any arguments you may give to the 'who' command.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
coreutils is processing utmp in a manner that ignores TTYs that aren't associated with logins, which includes sudosh. This includes any arguments you may give to the 'who' command.