Skip to content

Instantly share code, notes, and snippets.

//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)
//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/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,
/*
* 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/parse.h
/*
* Structure describing a Defaults entry in sudoers.
*/
struct defaults {
TAILQ_ENTRY(defaults) entries;
char *var; /* variable name */
char *val; /* variable value */
struct member_list *binding; /* user/host/runas binding */
char *file; /* file Defaults entry was in */
//sudo_1.8.23-9.el7/plugins/sudoers/defaults.c
bool
update_defaults(int what, bool quiet)
{
struct defaults *d;
...
/*
* Then set the rest of the defaults.
*/
//sudo_1.8.23-9.el7/plugins/sudoers/sudoers.c
static int
set_cmnd(void)
{
...
if (sudo_mode & (MODE_RUN | MODE_EDIT | MODE_CHECK)) {
...
/* set user_args */
if (NewArgc > 1) {
char *to, *from, **av;
//glibc_2.17-322.el7_9/malloc/malloc.c
static void*
_int_malloc(mstate av, size_t bytes)
{
...
for(;;) {
int iters = 0;
while ( (victim = unsorted_chunks(av)->bk) != unsorted_chunks(av)) {
bck = victim->bk;
//glibc_2.17-322.el7_9/malloc/malloc.c
/* Set size/use field */
#define set_head(p, s) ((p)->size = (s))
static void*
_int_malloc(mstate av, size_t bytes)
{
...
use_top:
/*
//sudo_1.8.23-9.el7/plugins/sudoers/sudoers.c
int
sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
void *closure)
{
...
/* Find command in path and apply per-command Defaults. */
[a] cmnd_status = set_cmnd();
if (cmnd_status == NOT_FOUND_ERROR)