diff options
author | Todd C. Miller <Todd.Miller@sudo.ws> | 2021-09-20 07:57:31 -0600 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@sudo.ws> | 2021-09-20 07:57:31 -0600 |
commit | 00381b2327d5e91d094d2e50fbabfb3ae245872a (patch) | |
tree | 3e2c6d63edcfb4adca38eb7d8f41d7b0371b1788 /logsrvd | |
parent | 967a4ceb1e20ed7bbca91f02153d6530d787f7fb (diff) | |
download | sudo-00381b2327d5e91d094d2e50fbabfb3ae245872a.tar.gz |
sudo_logsrvd: only send log ID for first command of a session
There is no need to send the log ID for each sub-command.
Diffstat (limited to 'logsrvd')
-rw-r--r-- | logsrvd/logsrvd_local.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/logsrvd/logsrvd_local.c b/logsrvd/logsrvd_local.c index 350bfd489..6b30f9d9f 100644 --- a/logsrvd/logsrvd_local.c +++ b/logsrvd/logsrvd_local.c @@ -140,6 +140,7 @@ store_accept_local(AcceptMessage *msg, uint8_t *buf, size_t len, struct connection_closure *closure) { struct logsrvd_info_closure info = { msg->info_msgs, msg->n_info_msgs }; + bool new_session = closure->evlog == NULL; struct eventlog *evlog = NULL; char *log_id = NULL; bool ret = false; @@ -154,7 +155,7 @@ store_accept_local(AcceptMessage *msg, uint8_t *buf, size_t len, } /* Additional setup for the initial command in the session. */ - if (closure->evlog == NULL) { + if (new_session) { closure->evlog = evlog; /* Create I/O log info file and parent directories. */ @@ -187,7 +188,7 @@ store_accept_local(AcceptMessage *msg, uint8_t *buf, size_t len, goto done; } - if (log_id != NULL) { + if (new_session && log_id != NULL) { /* Send log ID to client for restarting connections. */ if (!fmt_log_id_message(log_id, closure)) goto done; |