Initialize the pty rows/cols based on the values we stored in user_details.

This fixes a minor issue where we would send an extra window size
change event the first time the command was suspended.
This commit is contained in:
Todd C. Miller
2018-10-05 14:04:29 -06:00
parent c0e8bde104
commit e2570307e6
3 changed files with 12 additions and 8 deletions

View File

@@ -595,8 +595,8 @@ get_user_info(struct user_details *ud)
goto oom;
ud->host = user_info[i] + sizeof("host=") - 1;
sudo_get_ttysize(&ud->ts_lines, &ud->ts_cols);
if (asprintf(&user_info[++i], "lines=%d", ud->ts_lines) == -1)
sudo_get_ttysize(&ud->ts_rows, &ud->ts_cols);
if (asprintf(&user_info[++i], "lines=%d", ud->ts_rows) == -1)
goto oom;
if (asprintf(&user_info[++i], "cols=%d", ud->ts_cols) == -1)
goto oom;