On 08/10/2018 04:24 AM, Karel Zak wrote:
Hi all, I'd like to add a new feature to su(1). Look forward to see your objections and comments. Example: # export FOO="this is foo" # su - kzak $ echo $FOO # su ---whitelist-environment FOO - kzak $ echo $FOO this is foo Note that the currently supported --preserve-environment may be overkill or dangerous in some use-cases as it does not reset environment at all. The whitelist provides better control (for example for scripts) over environment in the new session.
I think it is unnecessary. su itself does not need the environment variable. If a user needs a specific setting, then set it in a script:
su --command myscript -- Bruce Dubbs, LFS