Date: Thu, 13 Jul 2000 18:22:02 -0400 From: Jim Mercer <jim@reptiles.org> To: hackers@freebsd.org Subject: patch for openssh to work with pty-redir Message-ID: <20000713182202.C677@reptiles.org>
next in thread | raw e-mail | index | archive | help
i was using pty-redir (from netbsd) and ssh to do VPN (ppp over ssh). we prefer to use kernel mode ppp for religious reasons. (userland ppp and netgraph ppp are not options). under 3.x release, with the ports/ssh, this worked fine. however, starting with when openssh became part of the system, it stopped working. when i did a "pty-redir ssh remhost /usr/sbin/pppd" the openssh would complain: "Pseudo-terminal will not be allocated because stdin is not a terminal." i managed to get it working with the stock openssh using the following patch. (yes, it is a quick and ugly hack) (any suggestions for doing pppd over ssh without this hack and/or pty-redir would be entertained) *** ssh.c Thu Jul 13 11:32:35 2000 --- ssh.c.orig Fri Jun 9 03:10:21 2000 *************** *** 41,47 **** /* Flag indicating whether debug mode is on. This can be set on the command line. */ int debug_flag = 0; - int pty_redir = 0; /* Flag indicating whether a tty should be allocated */ int tty_flag = 0; --- 41,46 ---- *************** *** 296,304 **** case 'n': stdin_null_flag = 1; break; - case 'r': - pty_redir = 1; - break; case 'f': fork_after_authentication_flag = 1; stdin_null_flag = 1; --- 295,300 ---- *************** *** 470,476 **** tty_flag = 1; /* Do not allocate a tty if stdin is not a tty. */ ! if (!pty_redir && !isatty(fileno(stdin))) { if (tty_flag) fprintf(stderr, "Pseudo-terminal will not be allocated because stdin is not a terminal.\n"); tty_flag = 0; --- 466,472 ---- tty_flag = 1; /* Do not allocate a tty if stdin is not a tty. */ ! if (!isatty(fileno(stdin))) { if (tty_flag) fprintf(stderr, "Pseudo-terminal will not be allocated because stdin is not a terminal.\n"); tty_flag = 0; -- [ Jim Mercer jim@reptiles.org +1 416 410-5633 ] [ Reptilian Research -- Longer Life through Colder Blood ] [ Don't be fooled by cheap Finnish imitations; BSD is the One True Code. ] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000713182202.C677>