From 0eda64b235ec5ffdbf72b2a79c44865085c1099c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 3 May 2010 10:41:26 -0400 Subject: [PATCH] Do not need the opost flag to term_copy() now that we use pipes for stdout/stderr when they are not a tty. --- src/script.c | 4 ++-- src/sudo.h | 2 +- src/term.c | 5 +---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/script.c b/src/script.c index 702a848ac..3763bb491 100644 --- a/src/script.c +++ b/src/script.c @@ -197,7 +197,7 @@ check_foreground(void) { foreground = tcgetpgrp(script_fds[SFD_USERTTY]) == ppgrp; if (foreground && !tty_initialized) { - if (term_copy(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE], ttyout)) { + if (term_copy(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE])) { tty_initialized = 1; sync_ttysize(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE]); } @@ -476,7 +476,7 @@ script_execve(struct command_details *details, char *argv[], char *envp[], if (foreground) { /* Copy terminal attrs from user tty -> pty slave. */ - if (term_copy(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE], ttyout)) { + if (term_copy(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE])) { tty_initialized = 1; sync_ttysize(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE]); } diff --git a/src/sudo.h b/src/sudo.h index 9ba30b543..6ff8db20f 100644 --- a/src/sudo.h +++ b/src/sudo.h @@ -176,7 +176,7 @@ void script_setup(uid_t); /* term.c */ int term_cbreak(int); -int term_copy(int, int, int); +int term_copy(int, int); int term_noecho(int); int term_raw(int, int, int); int term_restore(int, int); diff --git a/src/term.c b/src/term.c index 71f924b69..20d7c6b77 100644 --- a/src/term.c +++ b/src/term.c @@ -164,15 +164,12 @@ term_cbreak(int fd) } int -term_copy(int src, int dst, int opost) +term_copy(int src, int dst) { struct termios tt; if (tcgetattr(src, &tt) != 0) return(0); - /* Do not do post-processing unless opost set. */ - if (!opost) - CLR(tt.c_oflag, OPOST); /* XXX - add TCSANOW compat define */ if (tcsetattr(dst, TCSANOW|TCSASOFT, &tt) != 0) return(0); -- 2.40.0