By default, sudo has the flag env_reset set. This flag makes sudo drop all variables and set only the core ones (HOME, LOGNAME, PATH, SHELL, TERM, and USER). It causes problems in a few apps that rely on variables being carried over (such as Autopackage). Why is env_reset on by default? Could it be turned off to make programs that rely on this sudo behaviour not fail with mysterious messages? Thanks, Taj
sudo does env_reset for security reasons. This can be disabled for people in %wheel by uncommenting the # Defaults:%wheel !env_reset in /etc/sudoers.