[Bug 829] Don't allocate a tty if -n option is set

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Thu Apr 1 18:33:36 EST 2004


http://bugzilla.mindrot.org/show_bug.cgi?id=829

           Summary: Don't allocate a tty if -n option is set
           Product: Portable OpenSSH
           Version: 3.8p1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: ssh
        AssignedTo: openssh-bugs at mindrot.org
        ReportedBy: ignasi.roca at fujitsu-siemens.com


Hi,

Use of -n option assigns input to /dev/null.
This case should be handled as stdin is not a tty, otherwise "ssh -n <host>" is 
able to open a session, but the session stays blocked because there is nothing 
to be read on the input.
Following patch could be applied:


--- openssh-3.8p1.orig/ssh.c	Wed Dec 17 06:33:11 2003
+++ openssh-3.8p1/ssh.c	Thu Apr  1 09:01:02 2004
@@ -549,7 +549,7 @@
 	if (no_tty_flag)
 		tty_flag = 0;
 	/* Do not allocate a tty if stdin is not a tty. */
-	if (!isatty(fileno(stdin)) && !force_tty_flag) {
+	if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) {
 		if (tty_flag)
 			logit("Pseudo-terminal will not be allocated because 
stdin is not a terminal.");
 		tty_flag = 0;

--

Cheers,
Ignasi Roca
Fujitsu-Siemens Computers



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list