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:
Robert Manner
2020-02-26 11:31:01 +01:00
committed by Todd C. Miller
parent e588879cf5
commit 38fc37b214
2 changed files with 7 additions and 11 deletions

View File

@@ -38,12 +38,6 @@ struct ApprovalPluginContext
// This also verifies compile time that the name matches the sudo plugin API.
#define CALLBACK_PYNAME(func_name) ((void)CALLBACK_PLUGINFUNC(func_name), #func_name)
#define MARK_CALLBACK_OPTIONAL(function_name) \
do { \
python_plugin_mark_callback_optional(plugin_ctx, CALLBACK_PYNAME(function_name), \
(void **)&CALLBACK_PLUGINFUNC(function_name)); \
} while(0)
static int
python_plugin_approval_open(struct ApprovalPluginContext *approval_ctx,
@@ -93,9 +87,6 @@ python_plugin_approval_open(struct ApprovalPluginContext *approval_ctx,
debug_return_int(rc);
}
// skip plugin callbacks which are not mandatory
MARK_CALLBACK_OPTIONAL(show_version);
debug_return_int(rc);
}