summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--session.c20
2 files changed, 12 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 13a1ef109..c44c00c40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@
12 - markus@cvs.openbsd.org 2001/10/06 00:14:50 12 - markus@cvs.openbsd.org 2001/10/06 00:14:50
13 [sshconnect.c] 13 [sshconnect.c]
14 remove unused argument 14 remove unused argument
15 - markus@cvs.openbsd.org 2001/10/06 00:36:42
16 [session.c]
17 fix typo in error message, sync with do_exec_nopty
15 18
1620011007 1920011007
17 - (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys. 20 - (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys.
@@ -6657,4 +6660,4 @@
6657 - Wrote replacements for strlcpy and mkdtemp 6660 - Wrote replacements for strlcpy and mkdtemp
6658 - Released 1.0pre1 6661 - Released 1.0pre1
6659 6662
6660$Id: ChangeLog,v 1.1588 2001/10/10 05:02:03 djm Exp $ 6663$Id: ChangeLog,v 1.1589 2001/10/10 05:02:46 djm Exp $
diff --git a/session.c b/session.c
index 482590803..b89143179 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.102 2001/09/16 14:46:54 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.103 2001/10/06 00:36:42 markus Exp $");
37 37
38#include "ssh.h" 38#include "ssh.h"
39#include "ssh1.h" 39#include "ssh1.h"
@@ -560,17 +560,13 @@ do_exec_pty(Session *s, const char *command)
560 /* Make the pseudo tty our controlling tty. */ 560 /* Make the pseudo tty our controlling tty. */
561 pty_make_controlling_tty(&ttyfd, s->tty); 561 pty_make_controlling_tty(&ttyfd, s->tty);
562 562
563 /* Redirect stdin from the pseudo tty. */ 563 /* Redirect stdin/stdout/stderr from the pseudo tty. */
564 if (dup2(ttyfd, fileno(stdin)) < 0) 564 if (dup2(ttyfd, 0) < 0)
565 error("dup2 stdin failed: %.100s", strerror(errno)); 565 error("dup2 stdin: %s", strerror(errno));
566 566 if (dup2(ttyfd, 1) < 0)
567 /* Redirect stdout to the pseudo tty. */ 567 error("dup2 stdout: %s", strerror(errno));
568 if (dup2(ttyfd, fileno(stdout)) < 0) 568 if (dup2(ttyfd, 2) < 0)
569 error("dup2 stdin failed: %.100s", strerror(errno)); 569 error("dup2 stderr: %s", strerror(errno));
570
571 /* Redirect stderr to the pseudo tty. */
572 if (dup2(ttyfd, fileno(stderr)) < 0)
573 error("dup2 stdin failed: %.100s", strerror(errno));
574 570
575 /* Close the extra descriptor for the pseudo tty. */ 571 /* Close the extra descriptor for the pseudo tty. */
576 close(ttyfd); 572 close(ttyfd);