Skip to content

Commit 22bd112

Browse files
committed
handle_exit: The run_time field is optional
When sending legacy I/O log files via sudo_sendlog, there is no run-time information availalble.
1 parent 4ac3a69 commit 22bd112

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

logsrvd/logsrvd.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,12 @@ handle_exit(const ExitMessage *msg, const uint8_t *buf, size_t len,
527527
debug_return_bool(false);
528528
}
529529

530-
/* Check that message is valid. */
531-
if (msg == NULL || msg->run_time == NULL) {
530+
/*
531+
* Check that message is valid.
532+
* The run_time field is optional and will not be present
533+
* when sending old, pre-JSON I/O logs via sudo_sendlog.
534+
*/
535+
if (msg == NULL) {
532536
sudo_warnx(U_("%s: %s"), source, U_("invalid ExitMessage"));
533537
closure->errstr = _("invalid ExitMessage");
534538
debug_return_bool(false);

0 commit comments

Comments
 (0)