Add an fd argument to sudo_get_ttysize() instead of always using stderr.
For sudoreplay we open /dev/tty, so use that instead of stderr when determining the terminal size.
This commit is contained in:
@@ -623,7 +623,7 @@ get_user_info(struct user_details *ud)
|
||||
goto oom;
|
||||
ud->host = info[i] + sizeof("host=") - 1;
|
||||
|
||||
sudo_get_ttysize(&ud->ts_rows, &ud->ts_cols);
|
||||
sudo_get_ttysize(STDERR_FILENO, &ud->ts_rows, &ud->ts_cols);
|
||||
if (asprintf(&info[++i], "lines=%d", ud->ts_rows) == -1)
|
||||
goto oom;
|
||||
if (asprintf(&info[++i], "cols=%d", ud->ts_cols) == -1)
|
||||
|
Reference in New Issue
Block a user