plugins/python/example_policy_plugin.py: extend user env changing example

Make the demonstration extend the environment with a new variable.
Easier to read, and makes the testing able to check for that it is working.
This commit is contained in:
Robert Manner
2020-01-10 15:39:51 +01:00
committed by Todd C. Miller
parent 185471f263
commit 0b2d0334b7

View File

@@ -97,7 +97,7 @@ class SudoPolicyPlugin(sudo.Plugin):
user_pwd = pwd.struct_passwd(user_pwd) if user_pwd else None
# This is how you change the user_env:
return (sudo.RC_OK, user_env)
return (sudo.RC_OK, user_env + ("PLUGIN_EXAMPLE_ENV=1",))
# If you do not want to change user_env, you can also just return (or None):
# return sudo.RC_OK