Log window size change events in the sudoers I/O plugin.

Let sudoreplay parse a timing file with window change events
(currently ignored).
This commit is contained in:
Todd C. Miller
2017-07-12 05:47:28 -06:00
parent 8898ec1f9c
commit f79a236533
2 changed files with 70 additions and 7 deletions

View File

@@ -453,7 +453,7 @@ replay_session(const double max_wait, const char *decimal)
sudo_ev_loop(evbase, 0);
/* Even if we are not replaying, we still have to delay. */
if (idx >= IOFD_MAX || io_log_files[idx].fd.v == NULL)
if (idx >= IOFD_TIMING || io_log_files[idx].fd.v == NULL)
continue;
/* Check whether we need to convert newline to CR LF pairs. */
@@ -1196,7 +1196,7 @@ parse_timing(const char *buf, const char *decimal, int *idx, double *seconds,
ul = strtoul(buf, &ep, 10);
if (ep == buf || !isspace((unsigned char) *ep))
goto bad;
if (ul >= IOFD_TIMING) {
if (ul >= IOFD_MAX) {
if (ul != 6)
goto bad;
/* work around a bug in timing files generated by sudo 1.8.7 */
@@ -1232,7 +1232,8 @@ parse_timing(const char *buf, const char *decimal, int *idx, double *seconds,
errno = 0;
ul = strtoul(cp, &ep, 10);
if (ep == cp || *ep != '\0' || (errno == ERANGE && ul == ULONG_MAX))
if (ep == cp || (*ep != '\0' && !isspace((unsigned char) *ep)) ||
(errno == ERANGE && ul == ULONG_MAX))
goto bad;
*nbytes = (size_t)ul;