plugins/python/approval: fix show_version crash when it is not implemented
For approval plugins show_version is not optional.
This commit is contained in:

committed by
Todd C. Miller

parent
e588879cf5
commit
38fc37b214
@@ -531,8 +531,13 @@ python_plugin_show_version(struct PluginContext *plugin_ctx, const char *python_
|
||||
{
|
||||
debug_decl(python_plugin_show_version, PYTHON_DEBUG_CALLBACKS);
|
||||
|
||||
debug_return_int(python_plugin_api_rc_call(plugin_ctx, python_callback_name,
|
||||
Py_BuildValue("(i)", is_verbose)));
|
||||
int rc = SUDO_RC_OK;
|
||||
if (PyObject_HasAttrString(plugin_ctx->py_instance, python_callback_name)) {
|
||||
rc = python_plugin_api_rc_call(plugin_ctx, python_callback_name,
|
||||
Py_BuildValue("(i)", is_verbose));
|
||||
}
|
||||
|
||||
debug_return_int(rc);
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user