From ff5f68f2e28f82a63068137fcedeecda82e80f2c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 11 Jul 2023 14:15:46 -0600 Subject: [PATCH] fmt_info_messages: don't include ttyname if it is NULL The NULL check was commented out for testing but should have been restored. Fixes a potential protocol error message from sudo_logsrvd. --HG-- branch : 1.9 --- plugins/sudoers/log_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sudoers/log_client.c b/plugins/sudoers/log_client.c index 5017f581d..849ecb6ad 100644 --- a/plugins/sudoers/log_client.c +++ b/plugins/sudoers/log_client.c @@ -917,9 +917,9 @@ fmt_info_messages(struct client_closure *closure, struct eventlog *evlog, fill_str("submithost", evlog->submithost); /* TODO - submituid */ fill_str("submituser", evlog->submituser); -// if (evlog->ttyname != NULL) { + if (evlog->ttyname != NULL) { fill_str("ttyname", evlog->ttyname); - // } + } /* Free unused structs. */ while (info_msgs_size > n)