View Single Post
Old 25th August 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Quote:
sudo pkg_add -nr add
Ahha, this is the problem, sudo doesn't copy the user's environment.

From sudoers(5):
Code:
    env_reset       If set, sudo will reset the environment to only contain
		       the LOGNAME, SHELL, USER, USERNAME and the SUDO_* vari-
		       ables.  Any variables in the caller's environment that
		       match the env_keep and env_check lists are then added.
		       The default contents of the env_keep and env_check
		       lists are displayed when sudo is run by root with the
		       -V option.  If sudo was compiled with the SECURE_PATH
		       option, its value will be used for the PATH environment
		       variable.  This flag is on by default.
And from sudo(8):
Code:
       -E  The -E (preserve environment) option will override the env_reset
	   option in sudoers(5)).  It is only available when either the match-
	   ing command has the SETENV tag or the setenv option is set in sudo-
	   ers(5).
So you'll need to look at configuring sudo, or use su.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote