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:
@@ -755,7 +755,7 @@ usage(void)
|
||||
{
|
||||
int rows, cols;
|
||||
|
||||
sudo_get_ttysize(&rows, &cols);
|
||||
sudo_get_ttysize(STDERR_FILENO, &rows, &cols);
|
||||
display_usage(usage_err, cols);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@@ -796,7 +796,7 @@ help(void)
|
||||
int rows, cols;
|
||||
debug_decl(help, SUDO_DEBUG_ARGS);
|
||||
|
||||
sudo_get_ttysize(&rows, &cols);
|
||||
sudo_get_ttysize(STDERR_FILENO, &rows, &cols);
|
||||
sudo_lbuf_init(&lbuf, usage_out, indent, NULL, cols);
|
||||
if (strcmp(pname, "sudoedit") == 0) {
|
||||
sudoedit = true;
|
||||
|
Reference in New Issue
Block a user