Bugzilla – Bug 903
Since 1.8.28, sudo -E does not preserve aliases anymore
Last modified: 2019-10-26 02:21:18 MDT
On Fedora 31 and preceding, I used to be able to call aliases defined in my .bashrc by using 'sudo -E' Since update to sudo 1.8.28, 'sudo -E' seems to not preserve aliases from the calling user : "command not found"
Do you know what version of sudo you were running before? I don't think that bash can preserve aliases between shells, though it can export functions into the environment so that sub-shells pick them up.
I went from working sudo-1.8.27-3.fc31 to sudo-1.8.28-1.fc31
If you comment out the following line in sudoers sudo should behave the way you expect: Defaults always_set_home In sudo 1.8.28 that setting will prevent HOME from being preserved which is why your .bashrc is not being read.
Created attachment 532 [details] Diff between sudoers file included in sudo-1.8.27-3.fc31 and sudo-1.8.28-1.fc31 This is not due to any change in sudo itself, it is due to the addition of the always_set_home setting in the default sudoers file shipped by fedora. I've attached a diff of the two sudoers files installed by fedora. This is not the default sudoers that ships with sudo, it is a file maintained by the fedora project.
This is not due to a sudo bug, it is a change in fedora's sudoers configuration.
Thanks, I confirm that this was the problem