diff options
Diffstat (limited to '')
71 files changed, 305 insertions, 0 deletions
diff --git a/plugins/python/regress/testdata/check_example_audit_plugin_receives_accept.stdout b/plugins/python/regress/testdata/check_example_audit_plugin_receives_accept.stdout new file mode 100644 index 0000000..2c83972 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_audit_plugin_receives_accept.stdout @@ -0,0 +1,7 @@ +(AUDIT) -- Started by user testuser1 (123) -- +(AUDIT) Requested command: id --help +(AUDIT) Accepted command: /sbin/id --help +(AUDIT) By the plugin: accepter plugin name (type=POLICY) +(AUDIT) Environment: KEY1=VALUE1 KEY2=VALUE2 +(AUDIT) Command returned with exit code 2 +(AUDIT) -- Finished -- diff --git a/plugins/python/regress/testdata/check_example_audit_plugin_receives_error.stdout b/plugins/python/regress/testdata/check_example_audit_plugin_receives_error.stdout new file mode 100644 index 0000000..cb7068d --- /dev/null +++ b/plugins/python/regress/testdata/check_example_audit_plugin_receives_error.stdout @@ -0,0 +1,5 @@ +(AUDIT) -- Started by user ??? (???) -- +(AUDIT) Requested command: id +(AUDIT) Plugin errorer plugin name (type=AUDIT) got an error: Some error has happened +(AUDIT) Sudo has run into an error: 222 +(AUDIT) -- Finished -- diff --git a/plugins/python/regress/testdata/check_example_audit_plugin_receives_reject.stdout b/plugins/python/regress/testdata/check_example_audit_plugin_receives_reject.stdout new file mode 100644 index 0000000..c6e8a5a --- /dev/null +++ b/plugins/python/regress/testdata/check_example_audit_plugin_receives_reject.stdout @@ -0,0 +1,5 @@ +(AUDIT) -- Started by user root (0) -- +(AUDIT) Requested command: passwd +(AUDIT) Rejected by plugin rejecter plugin name (type=IO): Rejected just because! +(AUDIT) The command was not executed +(AUDIT) -- Finished -- diff --git a/plugins/python/regress/testdata/check_example_audit_plugin_version_display.stdout b/plugins/python/regress/testdata/check_example_audit_plugin_version_display.stdout new file mode 100644 index 0000000..1586f46 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_audit_plugin_version_display.stdout @@ -0,0 +1,6 @@ +(AUDIT) -- Started by user root (0) -- +Python Example Audit Plugin +Python audit plugin (API 1.0): SudoAuditPlugin (loaded from 'SRC_DIR/example_audit_plugin.py') +Python Example Audit Plugin (version=1.0) +(AUDIT) Sudo has run into an error: 222 +(AUDIT) -- Finished -- diff --git a/plugins/python/regress/testdata/check_example_audit_plugin_workflow_multiple.stderr b/plugins/python/regress/testdata/check_example_audit_plugin_workflow_multiple.stderr new file mode 100644 index 0000000..1d7d4a1 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_audit_plugin_workflow_multiple.stderr @@ -0,0 +1 @@ +sudo: loading more than 8 sudo python audit plugins is not supported diff --git a/plugins/python/regress/testdata/check_example_audit_plugin_workflow_multiple.stdout b/plugins/python/regress/testdata/check_example_audit_plugin_workflow_multiple.stdout new file mode 100644 index 0000000..aa5ee58 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_audit_plugin_workflow_multiple.stdout @@ -0,0 +1,14 @@ +(AUDIT1) -- Started by user default (1000) -- +(AUDIT1) Requested command: id --help +(AUDIT2) -- Started by user default (1000) -- +(AUDIT2) Requested command: id --help +(AUDIT1) Accepted command: /sbin/id --help +(AUDIT1) By the plugin: accepter plugin name (type=POLICY) +(AUDIT1) Environment: KEY1=VALUE1 KEY2=VALUE2 +(AUDIT2) Accepted command: /sbin/id --help +(AUDIT2) By the plugin: accepter plugin name (type=POLICY) +(AUDIT2) Environment: KEY1=VALUE1 KEY2=VALUE2 +(AUDIT1) Command exited due to signal 11 +(AUDIT1) -- Finished -- +(AUDIT2) Command exited due to signal 11 +(AUDIT2) -- Finished -- diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.conversation b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.conversation new file mode 100644 index 0000000..43bd2e7 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.conversation @@ -0,0 +1,3 @@ +Question count: 2 +Question 0: <<Reason: >> (timeout: 120, msg_type=2) +Question 1: <<Secret reason: >> (timeout: 120, msg_type=5) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stderr b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stderr new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stderr diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stdout b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stdout new file mode 100644 index 0000000..9d515c9 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stdout @@ -0,0 +1,3 @@ +Please provide your reason for executing ('/bin/whoami',) +conversation suspend: signal SIGTSTP +conversation resume: signal was SIGCONT diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stored b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stored new file mode 100644 index 0000000..c0ab857 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stored @@ -0,0 +1,3 @@ +Executed /bin/whoami +Reason: my fake reason +Hidden reason: my real secret reason diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.conversation b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.conversation new file mode 100644 index 0000000..43bd2e7 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.conversation @@ -0,0 +1,3 @@ +Question count: 2 +Question 0: <<Reason: >> (timeout: 120, msg_type=2) +Question 1: <<Secret reason: >> (timeout: 120, msg_type=5) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stderr b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stderr new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stderr diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stdout b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stdout new file mode 100644 index 0000000..7bbfa3f --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stdout @@ -0,0 +1 @@ +Please provide your reason for executing ('/bin/whoami',) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stored b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stored new file mode 100644 index 0000000..c0ab857 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stored @@ -0,0 +1,3 @@ +Executed /bin/whoami +Reason: my fake reason +Hidden reason: my real secret reason diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conv b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conv new file mode 100644 index 0000000..59d7202 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conv @@ -0,0 +1,2 @@ +Question count: 2 +Question 0: <<Reason: >> (timeout: 120, msg_type=2) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conversation b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conversation new file mode 100644 index 0000000..59d7202 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conversation @@ -0,0 +1,2 @@ +Question count: 2 +Question 0: <<Reason: >> (timeout: 120, msg_type=2) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stderr b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stderr new file mode 100644 index 0000000..8a4a528 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stderr @@ -0,0 +1 @@ +You did not answer in time diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stdout b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stdout new file mode 100644 index 0000000..7bbfa3f --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stdout @@ -0,0 +1 @@ +Please provide your reason for executing ('/bin/whoami',) diff --git a/plugins/python/regress/testdata/check_example_debugging_c_calls@diag.log b/plugins/python/regress/testdata/check_example_debugging_c_calls@diag.log new file mode 100644 index 0000000..1d2918a --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_c_calls@diag.log @@ -0,0 +1,6 @@ +sudo.debug was called with arguments: (<DEBUG.ERROR: 2>, 'My demo purpose plugin shows this ERROR level debug message') +sudo.debug was called with arguments: (<DEBUG.INFO: 6>, 'My demo purpose plugin shows this INFO level debug message') +LogHandler.emit was called +LogHandler.emit was called +sudo.options_as_dict was called with arguments: (('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin'),) +sudo.options_as_dict returned result: [('ClassName', 'DebugDemoPlugin'), ('ModulePath', 'SRC_DIR/example_debugging.py')] diff --git a/plugins/python/regress/testdata/check_example_debugging_c_calls@info.log b/plugins/python/regress/testdata/check_example_debugging_c_calls@info.log new file mode 100644 index 0000000..755b3f5 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_c_calls@info.log @@ -0,0 +1,11 @@ +__init__ @ SRC_DIR/example_debugging.py:58 calls C function: +sudo.debug was called with arguments: (<DEBUG.ERROR: 2>, 'My demo purpose plugin shows this ERROR level debug message') +__init__ @ SRC_DIR/example_debugging.py:63 calls C function: +sudo.debug was called with arguments: (<DEBUG.INFO: 6>, 'My demo purpose plugin shows this INFO level debug message') +handle @ logging/__init__.py calls C function: +LogHandler.emit was called +handle @ logging/__init__.py calls C function: +LogHandler.emit was called +__init__ @ SRC_DIR/example_debugging.py:85 calls C function: +sudo.options_as_dict was called with arguments: (('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin'),) +sudo.options_as_dict returned result: [('ClassName', 'DebugDemoPlugin'), ('ModulePath', 'SRC_DIR/example_debugging.py')] diff --git a/plugins/python/regress/testdata/check_example_debugging_load@diag.log b/plugins/python/regress/testdata/check_example_debugging_load@diag.log new file mode 100644 index 0000000..15b4bbe --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_load@diag.log @@ -0,0 +1,3 @@ +importing module: SRC_DIR/example_debugging.py +Extending python 'path' with 'SRC_DIR' +Deinit was called for a python plugin diff --git a/plugins/python/regress/testdata/check_example_debugging_plugin@err.log b/plugins/python/regress/testdata/check_example_debugging_plugin@err.log new file mode 100644 index 0000000..aec31ec --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_plugin@err.log @@ -0,0 +1,2 @@ +My demo purpose plugin shows this ERROR level debug message +Python log system shows this ERROR level debug message diff --git a/plugins/python/regress/testdata/check_example_debugging_plugin@info.log b/plugins/python/regress/testdata/check_example_debugging_plugin@info.log new file mode 100644 index 0000000..ed72f35 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_plugin@info.log @@ -0,0 +1,8 @@ +__init__ @ SRC_DIR/example_debugging.py:58 debugs: +My demo purpose plugin shows this ERROR level debug message +__init__ @ SRC_DIR/example_debugging.py:63 debugs: +My demo purpose plugin shows this INFO level debug message +handle @ logging/__init__.py debugs: +Python log system shows this ERROR level debug message +handle @ logging/__init__.py debugs: +Python log system shows this INFO level debug message diff --git a/plugins/python/regress/testdata/check_example_debugging_py_calls@diag.log b/plugins/python/regress/testdata/check_example_debugging_py_calls@diag.log new file mode 100644 index 0000000..97a89ef --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_py_calls@diag.log @@ -0,0 +1,2 @@ +DebugDemoPlugin.__init__ was called with arguments: () [('plugin_options', ('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin')), ('settings', ('debug_flags=/tmp/sudo_check_python_exampleXXXXXX/debug.log py_calls@diag', 'plugin_path=python_plugin.so')), ('user_env', ()), ('user_info', ()), ('version', '1.0')] +DebugDemoPlugin.__init__ returned result: <example_debugging.DebugDemoPlugin object> diff --git a/plugins/python/regress/testdata/check_example_debugging_py_calls@info.log b/plugins/python/regress/testdata/check_example_debugging_py_calls@info.log new file mode 100644 index 0000000..ae39daf --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_py_calls@info.log @@ -0,0 +1,9 @@ +DebugDemoPlugin.__init__ was called with arguments: () [('plugin_options', ('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin')), ('settings', ('debug_flags=/tmp/sudo_check_python_exampleXXXXXX/debug.log py_calls@info', 'plugin_path=python_plugin.so')), ('user_env', ()), ('user_info', ()), ('version', '1.0')] +DebugDemoPlugin.__init__ returned result: <example_debugging.DebugDemoPlugin object> +DebugDemoPlugin function 'log_ttyin' is not implemented +DebugDemoPlugin function 'log_ttyout' is not implemented +DebugDemoPlugin function 'log_stdin' is not implemented +DebugDemoPlugin function 'log_stdout' is not implemented +DebugDemoPlugin function 'log_stderr' is not implemented +DebugDemoPlugin function 'change_winsize' is not implemented +DebugDemoPlugin function 'log_suspend' is not implemented diff --git a/plugins/python/regress/testdata/check_example_debugging_sudo_cb@info.log b/plugins/python/regress/testdata/check_example_debugging_sudo_cb@info.log new file mode 100644 index 0000000..908066b --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_sudo_cb@info.log @@ -0,0 +1 @@ +Skipping close call, because there was no command run diff --git a/plugins/python/regress/testdata/check_example_group_plugin_is_able_to_debug.log b/plugins/python/regress/testdata/check_example_group_plugin_is_able_to_debug.log new file mode 100644 index 0000000..bb2fc4f --- /dev/null +++ b/plugins/python/regress/testdata/check_example_group_plugin_is_able_to_debug.log @@ -0,0 +1,4 @@ +SudoGroupPlugin.__init__ was called with arguments: () [('args', ('ModulePath=SRC_DIR/example_group_plugin.py', 'ClassName=SudoGroupPlugin')), ('version', '1.0')] +SudoGroupPlugin.__init__ returned result: <example_group_plugin.SudoGroupPlugin object> +SudoGroupPlugin.query was called with arguments: ('user', 'group', ('pw_name', 'pw_passwd', 1001, 101, 'pw_gecos', 'pw_dir', 'pw_shell')) +SudoGroupPlugin.query returned result: RC.REJECT diff --git a/plugins/python/regress/testdata/check_example_io_plugin_command_log.stderr b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stderr new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stderr diff --git a/plugins/python/regress/testdata/check_example_io_plugin_command_log.stdout b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stdout new file mode 100644 index 0000000..7e94c91 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stdout @@ -0,0 +1 @@ +Example sudo python plugin will log to /tmp/sudo_check_python_exampleXXXXXX/sudo.log diff --git a/plugins/python/regress/testdata/check_example_io_plugin_command_log.stored b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stored new file mode 100644 index 0000000..73fdc5d --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stored @@ -0,0 +1,16 @@ + -- Plugin STARTED -- +EXEC id --help +EXEC info [ + "command=/bin/id", + "runas_uid=0" +] +STD IN some standard input +STD OUT some standard output +STD ERR some standard error +SUSPEND SIGTSTP +SUSPEND SIGCONT +WINSIZE 200x100 +TTY IN some tty input +TTY OUT some tty output +CLOSE Command returned 1 + -- Plugin DESTROYED -- diff --git a/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple.stderr b/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple.stderr new file mode 100644 index 0000000..f519805 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple.stderr @@ -0,0 +1 @@ +sudo: loading more than 8 sudo python IO plugins is not supported diff --git a/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple.stdout b/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple.stdout new file mode 100644 index 0000000..e9dbd67 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple.stdout @@ -0,0 +1,2 @@ +Example sudo python plugin will log to /tmp/sudo_check_python_exampleXXXXXX/sudo.log +Example sudo python plugin will log to /tmp/sudo_check_python_exampleXXXXXX2/sudo.log diff --git a/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple1.stored b/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple1.stored new file mode 100644 index 0000000..bc60c38 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple1.stored @@ -0,0 +1,16 @@ + -- Plugin STARTED -- +EXEC id --help +EXEC info [ + "command=/bin/id", + "runas_uid=0" +] +STD IN stdin for plugin 1 +STD OUT stdout for plugin 1 +STD ERR stderr for plugin 1 +SUSPEND SIGTSTP +SUSPEND SIGCONT +WINSIZE 20x10 +TTY IN tty input for plugin 1 +TTY OUT tty output for plugin 1 +CLOSE Command returned 1 + -- Plugin DESTROYED -- diff --git a/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple2.stored b/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple2.stored new file mode 100644 index 0000000..ed3fdc8 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_command_log_multiple2.stored @@ -0,0 +1,16 @@ + -- Plugin STARTED -- +EXEC whoami +EXEC info [ + "command=/bin/whoami", + "runas_uid=1" +] +STD IN stdin for plugin 2 +STD OUT stdout for plugin 2 +STD ERR stderr for plugin 2 +SUSPEND SIGSTOP +SUSPEND SIGCONT +WINSIZE 30x40 +TTY IN tty input for plugin 2 +TTY OUT tty output for plugin 2 +CLOSE Command returned 2 + -- Plugin DESTROYED -- diff --git a/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stderr b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stderr new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stderr diff --git a/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stdout b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stdout new file mode 100644 index 0000000..7e94c91 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stdout @@ -0,0 +1 @@ +Example sudo python plugin will log to /tmp/sudo_check_python_exampleXXXXXX/sudo.log diff --git a/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stored b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stored new file mode 100644 index 0000000..1b99398 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stored @@ -0,0 +1,8 @@ + -- Plugin STARTED -- +EXEC cmd +EXEC info [ + "command=/usr/share/cmd", + "runas_uid=0" +] +CLOSE Failed to execute, execve returned 1 (EPERM) + -- Plugin DESTROYED -- diff --git a/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stderr b/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stderr new file mode 100644 index 0000000..1dd42a6 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stderr @@ -0,0 +1 @@ +Failed to construct plugin instance: [Errno 2] No such file or directory: '/some/not/writable/directory/sudo.log' diff --git a/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stdout b/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stdout new file mode 100644 index 0000000..10b0e23 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stdout @@ -0,0 +1,7 @@ +Example sudo python plugin will log to /some/not/writable/directory/sudo.log +Traceback: + File "SRC_DIR/example_io_plugin.py", line 64, in __init__ + self._open_log_file(path.join(log_path, "sudo.log")) + File "SRC_DIR/example_io_plugin.py", line 134, in _open_log_file + self._log_file = open(log_path, "a") + diff --git a/plugins/python/regress/testdata/check_example_io_plugin_version_display.stderr b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stderr new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stderr diff --git a/plugins/python/regress/testdata/check_example_io_plugin_version_display.stdout b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stdout new file mode 100644 index 0000000..07e998a --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stdout @@ -0,0 +1,2 @@ +Example sudo python plugin will log to /tmp/sudo_check_python_exampleXXXXXX/sudo.log +Python Example IO Plugin version: 1.0 diff --git a/plugins/python/regress/testdata/check_example_io_plugin_version_display.stored b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stored new file mode 100644 index 0000000..45f9b9e --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stored @@ -0,0 +1,2 @@ + -- Plugin STARTED -- + -- Plugin DESTROYED -- diff --git a/plugins/python/regress/testdata/check_example_io_plugin_version_display_full.stdout b/plugins/python/regress/testdata/check_example_io_plugin_version_display_full.stdout new file mode 100644 index 0000000..cfb3921 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_version_display_full.stdout @@ -0,0 +1,3 @@ +Example sudo python plugin will log to /tmp/sudo_check_python_exampleXXXXXX/sudo.log +Python io plugin (API 1.0): SudoIOPlugin (loaded from 'SRC_DIR/example_io_plugin.py') +Python Example IO Plugin version: 1.0 diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stderr b/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stderr new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stderr diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stdout new file mode 100644 index 0000000..c63a26e --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stdout @@ -0,0 +1 @@ +The command returned with exit_status 3 diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stderr b/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stderr new file mode 100644 index 0000000..6db9b2c --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stderr @@ -0,0 +1 @@ +You are not allowed to run this command! diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stdout new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stdout diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stderr b/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stderr new file mode 100644 index 0000000..e8d7034 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stderr @@ -0,0 +1 @@ +Failed to execute command, execve syscall returned 2 (ENOENT) diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stdout new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stdout diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_list.stderr b/plugins/python/regress/testdata/check_example_policy_plugin_list.stderr new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_list.stderr diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_list.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_list.stdout new file mode 100644 index 0000000..48c5baf --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_list.stdout @@ -0,0 +1,25 @@ +-- minimal -- +Only the following commands are allowed: id, whoami + +-- minimal (verbose) -- +Only the following commands are allowed: id, whoami + +-- with user -- +Only the following commands are allowed: id, whoami as user 'testuser' + +-- with user (verbose) -- +Only the following commands are allowed: id, whoami as user 'testuser' + +-- with allowed program -- +You are allowed to execute command '/bin/id' + +-- with allowed program (verbose) -- +You are allowed to execute command '/bin/id' +Only the following commands are allowed: id, whoami + +-- with denied program -- +You are NOT allowed to execute command '/bin/passwd' + +-- with denied program (verbose) -- +You are NOT allowed to execute command '/bin/passwd' +Only the following commands are allowed: id, whoami diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_validate_invalidate.log b/plugins/python/regress/testdata/check_example_policy_plugin_validate_invalidate.log new file mode 100644 index 0000000..6f1479a --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_validate_invalidate.log @@ -0,0 +1,8 @@ +SudoPolicyPlugin.__init__ was called with arguments: () [('plugin_options', ('ModulePath=SRC_DIR/example_policy_plugin.py', 'ClassName=SudoPolicyPlugin')), ('settings', ()), ('user_env', ()), ('user_info', ()), ('version', '1.0')] +SudoPolicyPlugin.__init__ returned result: <example_policy_plugin.SudoPolicyPlugin object> +SudoPolicyPlugin.validate was called with arguments: () +SudoPolicyPlugin.validate returned result: None +SudoPolicyPlugin.invalidate was called with arguments: (1,) +SudoPolicyPlugin.invalidate returned result: None +SudoPolicyPlugin.invalidate was called with arguments: (0,) +SudoPolicyPlugin.invalidate returned result: None diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stderr b/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stderr new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stderr diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stdout new file mode 100644 index 0000000..1cc1edd --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stdout @@ -0,0 +1 @@ +Python Example Policy Plugin version: 1.0 diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_version_display_full.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_version_display_full.stdout new file mode 100644 index 0000000..a23cf12 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_version_display_full.stdout @@ -0,0 +1,2 @@ +Python policy plugin (API 1.0): SudoPolicyPlugin (loaded from 'SRC_DIR/example_policy_plugin.py') +Python Example Policy Plugin version: 1.0 diff --git a/plugins/python/regress/testdata/check_loading_fails_missing_classname.stderr b/plugins/python/regress/testdata/check_loading_fails_missing_classname.stderr new file mode 100644 index 0000000..c207e2f --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_missing_classname.stderr @@ -0,0 +1,3 @@ +No plugin class is specified for python module 'SRC_DIR/regress/plugin_errorstr.py'. Use 'ClassName' configuration option in 'sudo.conf' +Possible plugins: ConstructErrorPlugin, ErrorMsgPlugin +Failed during loading plugin class diff --git a/plugins/python/regress/testdata/check_loading_fails_missing_classname.stdout b/plugins/python/regress/testdata/check_loading_fails_missing_classname.stdout new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_missing_classname.stdout diff --git a/plugins/python/regress/testdata/check_loading_fails_missing_path.stderr b/plugins/python/regress/testdata/check_loading_fails_missing_path.stderr new file mode 100644 index 0000000..05bc634 --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_missing_path.stderr @@ -0,0 +1,2 @@ +No python module path is specified. Use 'ModulePath' plugin config option in 'sudo.conf' +Failed during loading plugin class diff --git a/plugins/python/regress/testdata/check_loading_fails_missing_path.stdout b/plugins/python/regress/testdata/check_loading_fails_missing_path.stdout new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_missing_path.stdout diff --git a/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stderr b/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stderr new file mode 100644 index 0000000..7ba1bc9 --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stderr @@ -0,0 +1 @@ +Failed during loading plugin class: File 'SRC_DIR/example_debugging.py' must be owned by uid 0 diff --git a/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stdout b/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stdout new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stdout diff --git a/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stderr b/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stderr new file mode 100644 index 0000000..a4c519a --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stderr @@ -0,0 +1,2 @@ +Failed to find plugin class 'MispelledPluginName' +Failed during loading plugin class diff --git a/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stdout b/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stdout new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stdout diff --git a/plugins/python/regress/testdata/check_loading_fails_wrong_path.stderr b/plugins/python/regress/testdata/check_loading_fails_wrong_path.stderr new file mode 100644 index 0000000..3087ba8 --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_wrong_path.stderr @@ -0,0 +1 @@ +Failed during loading plugin class: No module named 'wrong_path' diff --git a/plugins/python/regress/testdata/check_loading_fails_wrong_path.stdout b/plugins/python/regress/testdata/check_loading_fails_wrong_path.stdout new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_wrong_path.stdout diff --git a/plugins/python/regress/testdata/check_loading_succeeds_with_missing_classname.stdout b/plugins/python/regress/testdata/check_loading_succeeds_with_missing_classname.stdout new file mode 100644 index 0000000..f7a1a6f --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_succeeds_with_missing_classname.stdout @@ -0,0 +1 @@ +Python io plugin (API 1.0): DebugDemoPlugin (loaded from 'SRC_DIR/example_debugging.py') diff --git a/plugins/python/regress/testdata/check_multiple_approval_plugin_and_arguments.stderr b/plugins/python/regress/testdata/check_multiple_approval_plugin_and_arguments.stderr new file mode 100644 index 0000000..6dfb141 --- /dev/null +++ b/plugins/python/regress/testdata/check_multiple_approval_plugin_and_arguments.stderr @@ -0,0 +1 @@ +sudo: loading more than 8 sudo python approval plugins is not supported diff --git a/plugins/python/regress/testdata/check_multiple_approval_plugin_and_arguments.stdout b/plugins/python/regress/testdata/check_multiple_approval_plugin_and_arguments.stdout new file mode 100644 index 0000000..0500bec --- /dev/null +++ b/plugins/python/regress/testdata/check_multiple_approval_plugin_and_arguments.stdout @@ -0,0 +1,67 @@ +(APPROVAL 1) Constructed: +{ + "_id": "(APPROVAL 1)", + "plugin_options": [ + "ModulePath=SRC_DIR/regress/plugin_approval_test.py", + "ClassName=ApprovalTestPlugin", + "Id=1" + ], + "settings": [ + "SETTING1=VALUE1", + "setting2=value2" + ], + "submit_argv": [ + "sudo", + "-u", + "user", + "whoami", + "--help" + ], + "submit_optind": 3, + "user_env": [ + "USER_ENV1=VALUE1", + "USER_ENV2=value2" + ], + "user_info": [ + "INFO1=VALUE1", + "info2=value2" + ], + "version": "1.17" +} +(APPROVAL 2) Constructed: +{ + "_id": "(APPROVAL 2)", + "plugin_options": [ + "ModulePath=SRC_DIR/regress/plugin_approval_test.py", + "ClassName=ApprovalTestPlugin", + "Id=2" + ], + "settings": [ + "SETTING1=VALUE1", + "setting2=value2" + ], + "submit_argv": [ + "sudo", + "-u", + "user", + "whoami", + "--help" + ], + "submit_optind": 3, + "user_env": [ + "USER_ENV1=VALUE1", + "USER_ENV2=value2" + ], + "user_info": [ + "INFO1=VALUE1", + "info2=value2" + ], + "version": "1.17" +} +(APPROVAL 1) Show version was called with arguments: (0,) +Python approval plugin (API 1.0): ApprovalTestPlugin (loaded from 'SRC_DIR/regress/plugin_approval_test.py') +(APPROVAL 2) Show version was called with arguments: (1,) +(APPROVAL 1) Check was called with arguments: (('CMDINFO1=value1', 'CMDINFO2=VALUE2'), ('whoami', '--help'), ('USER_ENV1=VALUE1', 'USER_ENV2=value2')) +(APPROVAL 2) Check was called with arguments: (('CMDINFO1=value1', 'CMDINFO2=VALUE2'), ('whoami', '--help'), ('USER_ENV1=VALUE1', 'USER_ENV2=value2')) +(APPROVAL 1) Destructed successfully +(APPROVAL 2) Destructed successfully diff --git a/plugins/python/regress/testdata/check_python_plugins_do_not_affect_each_other.stdout b/plugins/python/regress/testdata/check_python_plugins_do_not_affect_each_other.stdout new file mode 100644 index 0000000..cd5bef9 --- /dev/null +++ b/plugins/python/regress/testdata/check_python_plugins_do_not_affect_each_other.stdout @@ -0,0 +1,4 @@ +PATH before: [] (should be empty) +PATH set: ['path_for_first_plugin'] +PATH before: [] (should be empty) +PATH set: ['path_for_second_plugin'] diff --git a/plugins/python/regress/testdata/sudo.conf.developer_mode b/plugins/python/regress/testdata/sudo.conf.developer_mode new file mode 100644 index 0000000..4da2ad9 --- /dev/null +++ b/plugins/python/regress/testdata/sudo.conf.developer_mode @@ -0,0 +1 @@ +Set developer_mode true diff --git a/plugins/python/regress/testdata/sudo.conf.normal_mode b/plugins/python/regress/testdata/sudo.conf.normal_mode new file mode 100644 index 0000000..b972a6a --- /dev/null +++ b/plugins/python/regress/testdata/sudo.conf.normal_mode @@ -0,0 +1 @@ +Set developer_mode false |