Use struct eventlog in place of struct iolog_info.

This commit is contained in:
Todd C. Miller
2020-10-26 15:31:41 -06:00
parent b9aff696fb
commit db72498257
17 changed files with 430 additions and 491 deletions

View File

@@ -720,6 +720,43 @@ eventlog_alert(const struct eventlog *details, struct timespec *alert_time,
debug_return_bool(ret);
}
/*
* Free the strings in a struct eventlog.
*/
void
eventlog_free(struct eventlog *evlog)
{
int i;
debug_decl(eventlog_free, SUDO_DEBUG_UTIL);
if (evlog != NULL) {
free(evlog->iolog_path);
free(evlog->command);
free(evlog->cwd);
free(evlog->runchroot);
free(evlog->runcwd);
free(evlog->rungroup);
free(evlog->runuser);
free(evlog->submithost);
free(evlog->submituser);
free(evlog->submitgroup);
free(evlog->ttyname);
if (evlog->argv != NULL) {
for (i = 0; evlog->argv[i] != NULL; i++)
free(evlog->argv[i]);
free(evlog->argv);
}
if (evlog->envp != NULL) {
for (i = 0; evlog->envp[i] != NULL; i++)
free(evlog->envp[i]);
free(evlog->envp);
}
free(evlog);
}
debug_return;
}
/*
* Set eventlog config settings.
*/