[sudo-users] How to preserve functions in scripts for calling by sudo?

Todd C. Miller Todd.Miller at courtesan.com
Sat Jun 3 09:25:31 MDT 2017

On Sat, 03 Jun 2017 08:32:26 -0600, "Todd C. Miller" wrote:

> However, if you truly want to preserve the environment as-is you
> can do the following:
> Defaults env_keep += "*"
> Defaults env_keep += "*=()*"

Sorry, I spoke too soon.  Patterns with more than one "*" will not
be supported until sudo 1.8.21.  I just pushed a commit to convert
the bash function check when env_reset is disabled into a pattern
so it can be removed via:

Defaults env_delete -= "*=()*"

But this won't be available until sudo 1.8.21 unless you compile
your own sudo from the sudo repo.

 - todd

More information about the sudo-users mailing list