]> granicus.if.org Git - sudo/commitdiff
Do not need the opost flag to term_copy() now that we use pipes for
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 3 May 2010 14:41:26 +0000 (10:41 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 3 May 2010 14:41:26 +0000 (10:41 -0400)
stdout/stderr when they are not a tty.

src/script.c
src/sudo.h
src/term.c

index 702a848acd14b6b8b4c002fc56377e4f088a7d16..3763bb4918a49d92c9c1486fea5baf37537f14a2 100644 (file)
@@ -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]);
            }
index 9ba30b543bbc638b1629767658359018c11e806a..6ff8db20f12519d15ab5ca653d074e7eddcf4c68 100644 (file)
@@ -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);
index 71f924b69e8503922b17e3ca8485bd07da3b88de..20d7c6b77b34c8e2eb9ac4de882b0a37bd53b842 100644 (file)
@@ -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);