Add a struct sudo_conv_callback that contains on_suspend and on_resume
function pointer args plus a closure pointer and at it to the conversation function.
This commit is contained in:
@@ -26,13 +26,16 @@ struct generic_plugin {
|
||||
/* the rest depends on the type... */
|
||||
};
|
||||
|
||||
typedef int (*sudo_conv_1_7_t)(int num_msgs,
|
||||
const struct sudo_conv_message msgs[], struct sudo_conv_reply replies[]);
|
||||
|
||||
/*
|
||||
* Backwards-compatible structures for API bumps.
|
||||
*/
|
||||
struct policy_plugin_1_0 {
|
||||
unsigned int type;
|
||||
unsigned int version;
|
||||
int (*open)(unsigned int version, sudo_conv_t conversation,
|
||||
int (*open)(unsigned int version, sudo_conv_1_7_t conversation,
|
||||
sudo_printf_t sudo_printf, char * const settings[],
|
||||
char * const user_info[], char * const user_env[]);
|
||||
void (*close)(int exit_status, int error); /* wait status or error */
|
||||
@@ -49,7 +52,7 @@ struct policy_plugin_1_0 {
|
||||
struct io_plugin_1_0 {
|
||||
unsigned int type;
|
||||
unsigned int version;
|
||||
int (*open)(unsigned int version, sudo_conv_t conversation,
|
||||
int (*open)(unsigned int version, sudo_conv_1_7_t conversation,
|
||||
sudo_printf_t sudo_printf, char * const settings[],
|
||||
char * const user_info[], int argc, char * const argv[],
|
||||
char * const user_env[]);
|
||||
@@ -64,7 +67,7 @@ struct io_plugin_1_0 {
|
||||
struct io_plugin_1_1 {
|
||||
unsigned int type;
|
||||
unsigned int version;
|
||||
int (*open)(unsigned int version, sudo_conv_t conversation,
|
||||
int (*open)(unsigned int version, sudo_conv_1_7_t conversation,
|
||||
sudo_printf_t sudo_printf, char * const settings[],
|
||||
char * const user_info[], char * const command_info[],
|
||||
int argc, char * const argv[], char * const user_env[]);
|
||||
@@ -103,6 +106,8 @@ extern struct plugin_container policy_plugin;
|
||||
extern struct plugin_container_list io_plugins;
|
||||
|
||||
int sudo_conversation(int num_msgs, const struct sudo_conv_message msgs[],
|
||||
struct sudo_conv_reply replies[], struct sudo_conv_callback *callback);
|
||||
int sudo_conversation_1_7(int num_msgs, const struct sudo_conv_message msgs[],
|
||||
struct sudo_conv_reply replies[]);
|
||||
int sudo_conversation_printf(int msg_type, const char *fmt, ...);
|
||||
|
||||
|
Reference in New Issue
Block a user