Danny Milosavljevic <dan...@scratchpost.org> skribis: > There's an environment variable "SUDO_USER" which still contains the name > of the original user. > > We could check SUDO_USER instead of USER if USER=root, otherwise check USER.
Or perhaps we could ignore HOME when SUDO_USER is set, and instead honor /etc/passwd only? Ludo’.