Skip to content

Commit f34cab1

Browse files
AZero13millert
authored andcommitted
Remove duplicate event_type == EVLOG_EXIT
We already check for EVLOG_EXIT later. This is just copy-paste redundancy.
1 parent 85c7e26 commit f34cab1

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

lib/eventlog/eventlog.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -890,37 +890,6 @@ format_json(int event_type, struct eventlog_args *args,
890890
}
891891
}
892892

893-
if (event_type == EVLOG_EXIT && evlog != NULL) {
894-
/* Exit events don't need evlog details if there is a UUID. */
895-
if (evlog->uuid_str[0] != '\0') {
896-
if (args->json_info == NULL)
897-
info = NULL;
898-
}
899-
900-
if (sudo_timespecisset(&evlog->run_time)) {
901-
if (!json_add_timestamp(&jsonc, "run_time", &evlog->run_time, false)) {
902-
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
903-
"unable format timestamp");
904-
goto bad;
905-
}
906-
}
907-
if (evlog->signal_name != NULL) {
908-
json_value.type = JSON_STRING;
909-
json_value.u.string = evlog->signal_name;
910-
if (!sudo_json_add_value(&jsonc, "signal", &json_value))
911-
goto bad;
912-
913-
json_value.type = JSON_BOOL;
914-
json_value.u.boolean = evlog->dumped_core;
915-
if (!sudo_json_add_value(&jsonc, "dumped_core", &json_value))
916-
goto bad;
917-
}
918-
json_value.type = JSON_NUMBER;
919-
json_value.u.number = evlog->exit_value;
920-
if (!sudo_json_add_value(&jsonc, "exit_value", &json_value))
921-
goto bad;
922-
}
923-
924893
/* Event log info may be missing for alert messages. */
925894
if (evlog != NULL) {
926895
if (evlog->peeraddr != NULL) {

0 commit comments

Comments
 (0)