mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
Add open and close functions to the approval plugin API.
We need a close function to be able to to free memory allocated for errstr. Unlike the other plugins, the close function is called immediately after the plugin's check or show_version function. The plugin does not remain open until the command completes.
This commit is contained in:
@@ -242,15 +242,15 @@ struct approval_plugin {
|
||||
#define SUDO_APPROVAL_PLUGIN 4
|
||||
unsigned int type; /* always SUDO_APPROVAL_PLUGIN */
|
||||
unsigned int version; /* always SUDO_API_VERSION */
|
||||
int (*check)(unsigned int version, sudo_conv_t conversation,
|
||||
int (*open)(unsigned int version, sudo_conv_t conversation,
|
||||
sudo_printf_t sudo_printf, char * const settings[],
|
||||
char * const user_info[], int submit_optind,
|
||||
char * const submit_argv[], char * const submit_envp[],
|
||||
char * const command_info[], char * const run_argv[],
|
||||
char * const run_envp[], char * const plugin_options[],
|
||||
const char **errstr);
|
||||
int (*show_version)(unsigned int version, sudo_conv_t conversation,
|
||||
sudo_printf_t sudo_printf, int verbose);
|
||||
char * const plugin_options[], const char **errstr);
|
||||
void (*close)(void);
|
||||
int (*check)(char * const command_info[], char * const run_argv[],
|
||||
char * const run_envp[], const char **errstr);
|
||||
int (*show_version)(int verbose);
|
||||
};
|
||||
|
||||
/* Sudoers group plugin version major/minor */
|
||||
|
Reference in New Issue
Block a user