diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2000-12-27 11:51:55 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2000-12-27 11:51:55 +0000 |
commit | 68d9515c7a8f6bee0b9c61e7a870f4c363e823e3 (patch) | |
tree | a2dd9b69d174d5b8e02d0a5516a513a34ad67475 /usr.bin | |
parent | 8c8e44a2d18411a4b014ac77323d6e8a603ba01e (diff) |
multiple -t force pty allocation, document ORIGINAL_COMMAND
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/ssh.1 | 18 | ||||
-rw-r--r-- | usr.bin/ssh/ssh.c | 9 |
2 files changed, 19 insertions, 8 deletions
diff --git a/usr.bin/ssh/ssh.1 b/usr.bin/ssh/ssh.1 index fd791200dfb..d830cfeb2b3 100644 --- a/usr.bin/ssh/ssh.1 +++ b/usr.bin/ssh/ssh.1 @@ -34,7 +34,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $OpenBSD: ssh.1,v 1.72 2000/12/12 23:11:48 markus Exp $ +.\" $OpenBSD: ssh.1,v 1.73 2000/12/27 11:51:53 markus Exp $ .Dd September 25, 1999 .Dt SSH 1 .Os @@ -475,6 +475,11 @@ Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. +Multiple +.Fl t +options force tty allocation, even if +.Nm +has no local tty. .It Fl T Disable pseudo-tty allocation. .It Fl v @@ -484,10 +489,9 @@ Causes to print debugging messages about its progress. This is helpful in debugging connection, authentication, and configuration problems. -The verbose mode is also used to display -.Xr skey 1 -challenges, if the user entered "s/key" as password. -Multiple -v options increases the verbosity. +Multiple +.Fl v +options increases the verbosity. Maximum is 3. .It Fl x Disables X11 forwarding. @@ -1023,6 +1027,10 @@ Identifies the client end of the connection. The variable contains three space-separated values: client ip-address, client port number, and server port number. +.It Ev SSH_ORIGINAL_COMMAND +The variable contains the original command line if a forced command +is executed. +It can be used to extract the original arguments. .It Ev SSH_TTY This is set to the name of the tty (path to the device) associated with the current shell or command. diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 85e895136c4..44734d53ec8 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.78 2000/12/19 23:17:58 markus Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.79 2000/12/27 11:51:54 markus Exp $"); #include <openssl/evp.h> #include <openssl/dsa.h> @@ -71,10 +71,11 @@ int debug_flag = 0; /* Flag indicating whether a tty should be allocated */ int tty_flag = 0; +int no_tty_flag = 0; +int force_tty_flag = 0; /* don't exec a shell */ int no_shell_flag = 0; -int no_tty_flag = 0; /* * Flag indicating that nothing should be read from stdin. This can be set @@ -351,6 +352,8 @@ main(int ac, char **av) options.identity_files[options.num_identity_files++] = xstrdup(optarg); break; case 't': + if (tty_flag) + force_tty_flag = 1; tty_flag = 1; break; case 'v': @@ -499,7 +502,7 @@ main(int ac, char **av) if (no_tty_flag) tty_flag = 0; /* Do not allocate a tty if stdin is not a tty. */ - if (!isatty(fileno(stdin))) { + if (!isatty(fileno(stdin)) && !force_tty_flag) { if (tty_flag) fprintf(stderr, "Pseudo-terminal will not be allocated because stdin is not a terminal.\n"); tty_flag = 0; |