Skip to content

Instantly share code, notes, and snippets.

/*
* Structure describing compile-time and run-time options.
*/
struct sudo_defs_types {
char *name;
int type;
char *desc;
struct def_values *values;
bool (*callback)(const union sudo_defs_val *);
union sudo_defs_val sd_un;
//sudo_1.8.23-9.el7/plugins/sudoers/def_data.c
struct sudo_defs_types sudo_defs_table[] = {
{
...
}, {
"mailerpath", T_STR|T_BOOL|T_PATH,
N_("Path to mail program: %s"),
NULL,
}, {
"mailerflags", T_STR|T_BOOL,
//sudo_1.8.23-9.el7/plugins/sudoers/def_data.h
#define I_MAILERPATH 39
#define def_mailerpath (sudo_defs_table[I_MAILERPATH].sd_un.str)
//sudo_1.8.23-9.el7/plugins/sudoers/logging.c
/*
* Send a message to MAILTO user
*/
static bool
send_mail(const char *fmt, ...)
{
...
/* If mailer is disabled just return. */
[0] if (!def_mailerpath || !def_mailto)