Use libeventlog in sudoers instead of doing our own logging.

This commit is contained in:
Todd C. Miller
2020-10-26 16:10:40 -06:00
parent 541252beb1
commit 4416bd5977
12 changed files with 1117 additions and 1519 deletions

View File

@@ -127,7 +127,7 @@ new_logline(int flags, const char *message, const char *errstr,
len += strlen(message) + 3;
if (errstr != NULL)
len += strlen(errstr) + 3;
if (details->submithost != NULL)
if (details->submithost != NULL && !evl_conf.omit_hostname)
len += sizeof(LL_HOST_STR) + 2 + strlen(details->submithost);
if (details->ttyname != NULL)
len += sizeof(LL_TTY_STR) + 2 + strlen(details->ttyname);
@@ -184,7 +184,7 @@ new_logline(int flags, const char *message, const char *errstr,
strlcat(line, " ; ", len) >= len)
goto toobig;
}
if (details->submithost != NULL) {
if (details->submithost != NULL && !evl_conf.omit_hostname) {
if (strlcat(line, LL_HOST_STR, len) >= len ||
strlcat(line, details->submithost, len) >= len ||
strlcat(line, " ; ", len) >= len)