Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the audit callback function #2

Merged
merged 1 commit into from
Mar 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions jalauditd.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ static void audit_event_handle(auparse_state_t *au,
void *user_data)
{
UNUSED(user_data);
int i = 0;
struct jalp_app_metadata *app_data = NULL;
struct jalp_logger_metadata *log_data = NULL;
struct jalp_param *param_list = NULL;
Expand All @@ -106,8 +105,8 @@ static void audit_event_handle(auparse_state_t *au,
return;
}

while (auparse_goto_record_num(au, i) > 0) {

auparse_first_record(au);
do {
app_data = jalp_app_metadata_create();
if (!app_data) {
syslog(LOG_ERR, "failure creating JALP application metadata");
Expand Down Expand Up @@ -180,14 +179,11 @@ static void audit_event_handle(auparse_state_t *au,
pthread_mutex_unlock(&queue_mutex);
pthread_cond_signal(&data_in_queue);

i++;

app_data = NULL;
log_data = NULL;
param_list = NULL;
param = NULL;

}
} while (auparse_next_record(au) > 0);
return;
out:
jalp_app_metadata_destroy(&app_data);
Expand Down