Add syslog_pid sudoers option to log sudo's process ID when logging

via syslog.  This is disabled by default to match historic behavior.
This commit is contained in:
Todd C. Miller
2017-07-20 16:33:12 -06:00
parent 43cbcbc24d
commit d129f306ea
7 changed files with 39 additions and 4 deletions

View File

@@ -70,10 +70,11 @@ static char *new_logline(const char *, int);
static void
mysyslog(int pri, const char *fmt, ...)
{
const int flags = def_syslog_pid ? LOG_PID : 0;
va_list ap;
debug_decl(mysyslog, SUDOERS_DEBUG_LOGGING)
openlog("sudo", 0, def_syslog);
openlog("sudo", flags, def_syslog);
va_start(ap, fmt);
vsyslog(pri, fmt, ap);
va_end(ap);