]> andersk Git - openssh.git/blobdiff - readconf.c
- djm@cvs.openbsd.org 2009/02/12 03:00:56
[openssh.git] / readconf.c
index 0a8be140072d4d5cd0fa36e1ceef34730397074b..53fc6c7ba598c0fe5a0f4e0581320fca05b876e7 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.175 2009/01/22 10:02:34 djm Exp $ */
+/* $OpenBSD: readconf.c,v 1.176 2009/02/12 03:00:56 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -735,7 +735,8 @@ parse_int:
                }
 
                if (parse_forward(&fwd, fwdarg,
-                   opcode == oDynamicForward ? 1 : 0) == 0)
+                   opcode == oDynamicForward ? 1 : 0,
+                   opcode == oRemoteForward ? 1 : 0) == 0)
                        fatal("%.200s line %d: Bad forwarding specification.",
                            filename, linenum);
 
@@ -1220,7 +1221,7 @@ fill_default_options(Options * options)
  * returns number of arguments parsed or zero on error
  */
 int
-parse_forward(Forward *fwd, const char *fwdspec, int dynamicfwd)
+parse_forward(Forward *fwd, const char *fwdspec, int dynamicfwd, int remotefwd)
 {
        int i;
        char *p, *cp, *fwdarg[4];
@@ -1283,12 +1284,16 @@ parse_forward(Forward *fwd, const char *fwdspec, int dynamicfwd)
                        goto fail_free;
        }
 
-       if (fwd->listen_port <= 0)
+       if (fwd->listen_port < 0 || (!remotefwd && fwd->listen_port == 0))
                goto fail_free;
 
        if (fwd->connect_host != NULL &&
            strlen(fwd->connect_host) >= NI_MAXHOST)
                goto fail_free;
+       if (fwd->listen_host != NULL &&
+           strlen(fwd->listen_host) >= NI_MAXHOST)
+               goto fail_free;
+
 
        return (i);
 
This page took 0.056151 seconds and 4 git commands to generate.