did sudo change the default sense of env_reset option?
jhell
jhell at dataix.net
Sat May 22 12:02:23 UTC 2010
On 05/22/2010 05:52, Andrew Reilly wrote:
> Hi there,
>
> I haven't changed my configuration recently, but I've noticed
> that sudo processes have stopped inheriting my environment
> variables like MAKEOBJDIRPREFIX and PORTSDIR. I read the man
> page, and tried sudo -E, and that brings back the "old"
> behaviour, but that implies (according to the man page) that my
> sudoers file has env_reset enabled, and it just doesn't.
>
> Hmm. Closer reading of man 5 sudoers says that env_reset is
> *on* by default. This is new to me.
>
> Hmm. More digging in man pages: I need to add
> Defaults !env_reset
> under the #Defaults specification line.
>
> Any thoughts or suggestions?
>
> OK, so I've figured out the answer to my problem now, but since
> I have seen one other post about the sudden disappearance of
> MAKEOBJDIRPREFIX, and no obvious conversation about changes to
> sudo, I'll post this anyway. Hope it helps someone.
>
> Cheers,
>
Attached is the copy of the sudoers.default take a look through it to
see how to set a environment variable for use with portupgrade or
portmaster etc...
--
jhell
-------------- next part --------------
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# Uncomment if needed to preserve environmental variables related to the
# FreeBSD pkg_* utilities and fetch.
#Defaults env_keep += "PKG_PATH PKG_DBDIR PKG_TMPDIR TMPDIR PACKAGEROOT PACKAGESITE PKGDIR FTP_PASSIVE_MODE"
# Additionally uncomment if needed to preserve environmental variables
# related to portupgrade.
#Defaults env_keep += "PORTSDIR PORTS_INDEX PORTS_DBDIR PACKAGES PKGTOOLS_CONF"
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
More information about the freebsd-ports
mailing list