Leave the I/O log callbacks in iolog.c
Otherwise, check_iolog_plugin will not link.
This commit is contained in:
@@ -457,82 +457,6 @@ cb_log_output(const char *file, int line, int column,
|
|||||||
debug_return_bool(true);
|
debug_return_bool(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
cb_maxseq(const char *file, int line, int column,
|
|
||||||
const union sudo_defs_val *sd_un, int op)
|
|
||||||
{
|
|
||||||
const char *errstr;
|
|
||||||
unsigned int value;
|
|
||||||
debug_decl(cb_maxseq, SUDOERS_DEBUG_UTIL);
|
|
||||||
|
|
||||||
value = (unsigned int)sudo_strtonum(sd_un->str, 0, SESSID_MAX, &errstr);
|
|
||||||
if (errstr != NULL) {
|
|
||||||
if (errno != ERANGE) {
|
|
||||||
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
|
|
||||||
"bad maxseq: %s: %s", sd_un->str, errstr);
|
|
||||||
debug_return_bool(false);
|
|
||||||
}
|
|
||||||
/* Out of range, clamp to SESSID_MAX as documented. */
|
|
||||||
value = SESSID_MAX;
|
|
||||||
}
|
|
||||||
iolog_set_maxseq(value);
|
|
||||||
debug_return_bool(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
cb_iolog_user(const char *file, int line, int column,
|
|
||||||
const union sudo_defs_val *sd_un, int op)
|
|
||||||
{
|
|
||||||
const char *name = sd_un->str;
|
|
||||||
struct passwd *pw;
|
|
||||||
debug_decl(cb_iolog_user, SUDOERS_DEBUG_UTIL);
|
|
||||||
|
|
||||||
/* NULL name means reset to default. */
|
|
||||||
if (name == NULL) {
|
|
||||||
iolog_set_owner(ROOT_UID, ROOT_GID);
|
|
||||||
} else {
|
|
||||||
if ((pw = sudo_getpwnam(name)) == NULL) {
|
|
||||||
log_warningx(SLOG_SEND_MAIL, N_("unknown user %s"), name);
|
|
||||||
debug_return_bool(false);
|
|
||||||
}
|
|
||||||
iolog_set_owner(pw->pw_uid, pw->pw_gid);
|
|
||||||
sudo_pw_delref(pw);
|
|
||||||
}
|
|
||||||
|
|
||||||
debug_return_bool(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
cb_iolog_group(const char *file, int line, int column,
|
|
||||||
const union sudo_defs_val *sd_un, int op)
|
|
||||||
{
|
|
||||||
const char *name = sd_un->str;
|
|
||||||
struct group *gr;
|
|
||||||
debug_decl(cb_iolog_group, SUDOERS_DEBUG_UTIL);
|
|
||||||
|
|
||||||
/* NULL name means reset to default. */
|
|
||||||
if (name == NULL) {
|
|
||||||
iolog_set_gid(ROOT_GID);
|
|
||||||
} else {
|
|
||||||
if ((gr = sudo_getgrnam(name)) == NULL) {
|
|
||||||
log_warningx(SLOG_SEND_MAIL, N_("unknown group %s"), name);
|
|
||||||
debug_return_bool(false);
|
|
||||||
}
|
|
||||||
iolog_set_gid(gr->gr_gid);
|
|
||||||
sudo_gr_delref(gr);
|
|
||||||
}
|
|
||||||
|
|
||||||
debug_return_bool(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
cb_iolog_mode(const char *file, int line, int column,
|
|
||||||
const union sudo_defs_val *sd_un, int op)
|
|
||||||
{
|
|
||||||
iolog_set_mode(sd_un->mode);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set parser Defaults callbacks.
|
* Set parser Defaults callbacks.
|
||||||
* We do this here instead in def_data.in so we don't have to
|
* We do this here instead in def_data.in so we don't have to
|
||||||
|
Reference in New Issue
Block a user