]> andersk Git - openssh.git/commitdiff
- stevesk@cvs.openbsd.org 2008/11/05 03:23:09
authordjm <djm>
Wed, 5 Nov 2008 05:30:31 +0000 (05:30 +0000)
committerdjm <djm>
Wed, 5 Nov 2008 05:30:31 +0000 (05:30 +0000)
     [clientloop.c ssh.1]
     add dynamic forward escape command line; ok djm@

ChangeLog
clientloop.c
ssh.1

index d9a043e507db5351f630f018ce1fdb5ad32ec4dd..70d05fab99746afbef5125ea9a1fb89a81ab0d25 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,9 @@
      space was not malloc'd in that case.
      
      ok djm@
+   - stevesk@cvs.openbsd.org 2008/11/05 03:23:09
+     [clientloop.c ssh.1]
+     add dynamic forward escape command line; ok djm@
 
 20081103
  - OpenBSD CVS Sync
index 0ed4194a607c4d288d64dd85be6cb01bc31a535f..737807496b79a5adffde1337f064e226d9dedcda 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.203 2008/11/01 17:40:33 stevesk Exp $ */
+/* $OpenBSD: clientloop.c,v 1.204 2008/11/05 03:23:09 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -764,7 +764,7 @@ process_cmdline(void)
        void (*handler)(int);
        char *s, *cmd, *cancel_host;
        int delete = 0;
-       int local = 0;
+       int local = 0, remote = 0, dynamic = 0;
        u_short cancel_port;
        Forward fwd;
 
@@ -789,6 +789,8 @@ process_cmdline(void)
                    "Request local forward");
                logit("      -R[bind_address:]port:host:hostport    "
                    "Request remote forward");
+               logit("      -D[bind_address:]port                  "
+                   "Request dynamic forward");
                logit("      -KR[bind_address:]port                 "
                    "Cancel remote forward");
                if (!options.permit_local_command)
@@ -808,17 +810,22 @@ process_cmdline(void)
                delete = 1;
                s++;
        }
-       if (*s != 'L' && *s != 'R') {
+       if (*s == 'L')
+               local = 1;
+       else if (*s == 'R')
+               remote = 1;
+       else if (*s == 'D')
+               dynamic = 1;
+       else {
                logit("Invalid command.");
                goto out;
        }
-       if (*s == 'L')
-               local = 1;
-       if (local && delete) {
+
+       if ((local || dynamic) && delete) {
                logit("Not supported.");
                goto out;
        }
-       if ((!local || delete) && !compat20) {
+       if (remote && delete && !compat20) {
                logit("Not supported for SSH protocol version 1.");
                goto out;
        }
@@ -842,11 +849,11 @@ process_cmdline(void)
                }
                channel_request_rforward_cancel(cancel_host, cancel_port);
        } else {
-               if (!parse_forward(&fwd, s, 0)) {
+               if (!parse_forward(&fwd, s, dynamic ? 1 : 0)) {
                        logit("Bad forwarding specification.");
                        goto out;
                }
-               if (local) {
+               if (local || dynamic) {
                        if (channel_setup_local_fwd_listener(fwd.listen_host,
                            fwd.listen_port, fwd.connect_host,
                            fwd.connect_port, options.gateway_ports) < 0) {
diff --git a/ssh.1 b/ssh.1
index a303341f94a08d6a2ff72988e2e01e7b8ffd7f1f..38d1af3f31cecf9887f975fa35979d390a4701f5 100644 (file)
--- a/ssh.1
+++ b/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.278 2008/10/08 23:34:03 djm Exp $
+.\" $OpenBSD: ssh.1,v 1.279 2008/11/05 03:23:09 stevesk Exp $
 .Dd $Mdocdate$
 .Dt SSH 1
 .Os
@@ -898,9 +898,10 @@ Send a BREAK to the remote system
 .It Cm ~C
 Open command line.
 Currently this allows the addition of port forwardings using the
-.Fl L
-and
+.Fl L ,
 .Fl R
+and
+.Fl D
 options (see above).
 It also allows the cancellation of existing remote port-forwardings
 using
This page took 0.055863 seconds and 5 git commands to generate.