From 387672583ee302afcb69a3661906cd90c62824f5 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 13 Oct 2018 08:08:16 -0600 Subject: [PATCH] Fix workaround for broken sudo 1.8.7 timing files. --- plugins/sudoers/iolog.h | 5 +++-- plugins/sudoers/iolog_util.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/sudoers/iolog.h b/plugins/sudoers/iolog.h index f2748b4fb..d803a15b7 100644 --- a/plugins/sudoers/iolog.h +++ b/plugins/sudoers/iolog.h @@ -31,8 +31,9 @@ #define IO_EVENT_TTYIN 3 #define IO_EVENT_TTYOUT 4 #define IO_EVENT_WINSIZE 5 -#define IO_EVENT_SUSPEND 6 -#define IO_EVENT_COUNT 7 +#define IO_EVENT_TTYOUT_1_8_7 6 +#define IO_EVENT_SUSPEND 7 +#define IO_EVENT_COUNT 8 /* Default maximum session ID */ #define SESSID_MAX 2176782336U diff --git a/plugins/sudoers/iolog_util.c b/plugins/sudoers/iolog_util.c index e3bb2e2e3..b25a51cd0 100644 --- a/plugins/sudoers/iolog_util.c +++ b/plugins/sudoers/iolog_util.c @@ -310,9 +310,9 @@ parse_timing(const char *buf, struct timespec *delay, ulval = strtoul(buf, &ep, 10); if (ep == buf || !isspace((unsigned char) *ep)) goto bad; - if (ulval >= IO_EVENT_COUNT) { - if (ulval != 6) - goto bad; + if (ulval >= IO_EVENT_COUNT) + goto bad; + if (ulval == IO_EVENT_TTYOUT_1_8_7) { /* work around a bug in timing files generated by sudo 1.8.7 */ timing_event_adj = 2; } -- 2.50.1