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:

committed by
Todd C. Miller

parent
185471f263
commit
0b2d0334b7
@@ -97,7 +97,7 @@ class SudoPolicyPlugin(sudo.Plugin):
|
|||||||
user_pwd = pwd.struct_passwd(user_pwd) if user_pwd else None
|
user_pwd = pwd.struct_passwd(user_pwd) if user_pwd else None
|
||||||
|
|
||||||
# This is how you change the user_env:
|
# 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):
|
# If you do not want to change user_env, you can also just return (or None):
|
||||||
# return sudo.RC_OK
|
# return sudo.RC_OK
|
||||||
|
Reference in New Issue
Block a user