Fix workaround for broken sudo 1.8.7 timing files.

This commit is contained in:
Todd C. Miller
2018-10-13 08:08:16 -06:00
parent fa7e6f3f04
commit 387672583e
2 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -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;
}