plugins/python/pyhelpers: have a default sudo_printf function
Adapted the default sudo_printf from sudoers plugin to be able to print errors before plugin open() gets called. (This is used by the multiple io plugin loading to display error for too much plugin load.) Since this makes us always have a sudo_log, I have removed the logic about whether it is available or not.
This commit is contained in:

committed by
Todd C. Miller

parent
74f559155a
commit
d67c64bb37
@@ -113,11 +113,6 @@ python_sudo_log(int msg_type, PyObject *Py_UNUSED(py_self), PyObject *py_args, P
|
||||
if (_parse_log_function_args(py_args, py_kwargs, &args_joined, &end) != SUDO_RC_OK)
|
||||
goto cleanup;
|
||||
|
||||
if (!py_is_sudo_log_available()) {
|
||||
PyErr_Format(sudo_exc_SudoException, "sudo.log: Message displaying is unavailable");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
rc = py_ctx.sudo_log(msg_type, "%s%s", args_joined, end);
|
||||
if (rc < 0) {
|
||||
PyErr_Format(sudo_exc_SudoException, "sudo.log: Error displaying message");
|
||||
|
Reference in New Issue
Block a user