Change I/O log API to pass in command info to the I/O log open function.

Add iolog_file and iolog_dir parameters to command info.
This allows the policy plugin to specify the I/O log pathname.
Add convenience functions for calling plugin functions that
handle ABI backwards compatibility.
This commit is contained in:
Todd C. Miller
2010-12-20 16:20:11 -05:00
parent 30797ab8ae
commit 9948dae706
4 changed files with 93 additions and 14 deletions

View File

@@ -17,6 +17,25 @@
#ifndef _SUDO_PLUGIN_INT_H
#define _SUDO_PLUGIN_INT_H
/*
* Backwards-compatible structures for API bumps.
*/
struct io_plugin_1_0 {
unsigned int type;
unsigned int version;
int (*open)(unsigned int version, sudo_conv_t conversation,
sudo_printf_t sudo_printf, char * const settings[],
char * const user_info[], int argc, char * const argv[],
char * const user_env[]);
void (*close)(int exit_status, int error);
int (*show_version)(int verbose);
int (*log_ttyin)(const char *buf, unsigned int len);
int (*log_ttyout)(const char *buf, unsigned int len);
int (*log_stdin)(const char *buf, unsigned int len);
int (*log_stdout)(const char *buf, unsigned int len);
int (*log_stderr)(const char *buf, unsigned int len);
};
/*
* Sudo plugin internals.
*/
@@ -38,6 +57,7 @@ struct plugin_container {
struct generic_plugin *generic;
struct policy_plugin *policy;
struct io_plugin *io;
struct io_plugin_1_0 *io_1_0;
} u;
};
TQ_DECLARE(plugin_container)