summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-11-05 16:30:31 +1100
committerDamien Miller <djm@mindrot.org>2008-11-05 16:30:31 +1100
commit0164cb8a87cf3060f13954ce4e842ecbe8316817 (patch)
treeb826060b6a77c12ca6d0e6df59901937a36a2874
parent1a0442fce894dc09c50d882d9d19f8ed95977a3f (diff)
- stevesk@cvs.openbsd.org 2008/11/05 03:23:09
[clientloop.c ssh.1] add dynamic forward escape command line; ok djm@
-rw-r--r--ChangeLog5
-rw-r--r--clientloop.c25
-rw-r--r--ssh.19
3 files changed, 25 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index d49180e6e..1b4594114 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,9 @@
36 space was not malloc'd in that case. 36 space was not malloc'd in that case.
37 37
38 ok djm@ 38 ok djm@
39 - stevesk@cvs.openbsd.org 2008/11/05 03:23:09
40 [clientloop.c ssh.1]
41 add dynamic forward escape command line; ok djm@
39 42
4020081103 4320081103
41 - OpenBSD CVS Sync 44 - OpenBSD CVS Sync
@@ -4886,4 +4889,4 @@
4886 OpenServer 6 and add osr5bigcrypt support so when someone migrates 4889 OpenServer 6 and add osr5bigcrypt support so when someone migrates
4887 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 4890 passwords between UnixWare and OpenServer they will still work. OK dtucker@
4888 4891
4889$Id: ChangeLog,v 1.5131 2008/11/05 05:30:06 djm Exp $ 4892$Id: ChangeLog,v 1.5132 2008/11/05 05:30:31 djm Exp $
diff --git a/clientloop.c b/clientloop.c
index 0ed4194a6..737807496 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.203 2008/11/01 17:40:33 stevesk Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.204 2008/11/05 03:23:09 stevesk Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -764,7 +764,7 @@ process_cmdline(void)
764 void (*handler)(int); 764 void (*handler)(int);
765 char *s, *cmd, *cancel_host; 765 char *s, *cmd, *cancel_host;
766 int delete = 0; 766 int delete = 0;
767 int local = 0; 767 int local = 0, remote = 0, dynamic = 0;
768 u_short cancel_port; 768 u_short cancel_port;
769 Forward fwd; 769 Forward fwd;
770 770
@@ -789,6 +789,8 @@ process_cmdline(void)
789 "Request local forward"); 789 "Request local forward");
790 logit(" -R[bind_address:]port:host:hostport " 790 logit(" -R[bind_address:]port:host:hostport "
791 "Request remote forward"); 791 "Request remote forward");
792 logit(" -D[bind_address:]port "
793 "Request dynamic forward");
792 logit(" -KR[bind_address:]port " 794 logit(" -KR[bind_address:]port "
793 "Cancel remote forward"); 795 "Cancel remote forward");
794 if (!options.permit_local_command) 796 if (!options.permit_local_command)
@@ -808,17 +810,22 @@ process_cmdline(void)
808 delete = 1; 810 delete = 1;
809 s++; 811 s++;
810 } 812 }
811 if (*s != 'L' && *s != 'R') { 813 if (*s == 'L')
814 local = 1;
815 else if (*s == 'R')
816 remote = 1;
817 else if (*s == 'D')
818 dynamic = 1;
819 else {
812 logit("Invalid command."); 820 logit("Invalid command.");
813 goto out; 821 goto out;
814 } 822 }
815 if (*s == 'L') 823
816 local = 1; 824 if ((local || dynamic) && delete) {
817 if (local && delete) {
818 logit("Not supported."); 825 logit("Not supported.");
819 goto out; 826 goto out;
820 } 827 }
821 if ((!local || delete) && !compat20) { 828 if (remote && delete && !compat20) {
822 logit("Not supported for SSH protocol version 1."); 829 logit("Not supported for SSH protocol version 1.");
823 goto out; 830 goto out;
824 } 831 }
@@ -842,11 +849,11 @@ process_cmdline(void)
842 } 849 }
843 channel_request_rforward_cancel(cancel_host, cancel_port); 850 channel_request_rforward_cancel(cancel_host, cancel_port);
844 } else { 851 } else {
845 if (!parse_forward(&fwd, s, 0)) { 852 if (!parse_forward(&fwd, s, dynamic ? 1 : 0)) {
846 logit("Bad forwarding specification."); 853 logit("Bad forwarding specification.");
847 goto out; 854 goto out;
848 } 855 }
849 if (local) { 856 if (local || dynamic) {
850 if (channel_setup_local_fwd_listener(fwd.listen_host, 857 if (channel_setup_local_fwd_listener(fwd.listen_host,
851 fwd.listen_port, fwd.connect_host, 858 fwd.listen_port, fwd.connect_host,
852 fwd.connect_port, options.gateway_ports) < 0) { 859 fwd.connect_port, options.gateway_ports) < 0) {
diff --git a/ssh.1 b/ssh.1
index c8cd2136c..5f55dfe9d 100644
--- a/ssh.1
+++ b/ssh.1
@@ -34,8 +34,8 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: ssh.1,v 1.278 2008/10/08 23:34:03 djm Exp $ 37.\" $OpenBSD: ssh.1,v 1.279 2008/11/05 03:23:09 stevesk Exp $
38.Dd $Mdocdate: October 8 2008 $ 38.Dd $Mdocdate: November 5 2008 $
39.Dt SSH 1 39.Dt SSH 1
40.Os 40.Os
41.Sh NAME 41.Sh NAME
@@ -898,9 +898,10 @@ Send a BREAK to the remote system
898.It Cm ~C 898.It Cm ~C
899Open command line. 899Open command line.
900Currently this allows the addition of port forwardings using the 900Currently this allows the addition of port forwardings using the
901.Fl L 901.Fl L ,
902and
903.Fl R 902.Fl R
903and
904.Fl D
904options (see above). 905options (see above).
905It also allows the cancellation of existing remote port-forwardings 906It also allows the cancellation of existing remote port-forwardings
906using 907using