From 91504236765927f5eba2863ed9848645dddec33c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 27 Sep 2022 15:30:02 -0600 Subject: [PATCH] Don't send ttyname to log server if it is NULL. Otherwise the log server will reject the AcceptMessage because a NULL string is not allowed. --- plugins/sudoers/log_client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/log_client.c b/plugins/sudoers/log_client.c index 818218a3d..c926ddbe7 100644 --- a/plugins/sudoers/log_client.c +++ b/plugins/sudoers/log_client.c @@ -909,7 +909,9 @@ fmt_info_messages(struct client_closure *closure, struct eventlog *evlog, fill_str("submithost", evlog->submithost); /* TODO - submituid */ fill_str("submituser", evlog->submituser); - fill_str("ttyname", evlog->ttyname); + if (evlog->ttyname != NULL) { + fill_str("ttyname", evlog->ttyname); + } /* Free unused structs. */ while (info_msgs_size > n)