]> andersk Git - gssapi-openssh.git/blobdiff - openssh/readconf.c
merged OpenSSH 3.9p1 to trunk
[gssapi-openssh.git] / openssh / readconf.c
index 6896dab129703f111dc359e8d032c6c3fb37d4ef..dce06dcc6a99cd218265218af56598b27b08f5cc 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.162 2007/03/20 03:56:12 tedu Exp $ */
+/* $OpenBSD: readconf.c,v 1.165 2008/01/19 23:09:49 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -340,6 +340,7 @@ process_config_line(Options *options, const char *host,
 {
        char *s, **charptr, *endofnumber, *keyword, *arg, *arg2, fwdarg[256];
        int opcode, *intptr, value, value2, scale;
+       LogLevel *log_level_ptr;
        long long orig, val64;
        size_t len;
        Forward fwd;
@@ -551,7 +552,6 @@ parse_yesnoask:
                goto parse_int;
 
        case oRekeyLimit:
-               intptr = &options->rekey_limit;
                arg = strdelim(&s);
                if (!arg || *arg == '\0')
                        fatal("%.200s line %d: Missing argument.", filename, linenum);
@@ -579,14 +579,14 @@ parse_yesnoask:
                }
                val64 *= scale;
                /* detect integer wrap and too-large limits */
-               if ((val64 / scale) != orig || val64 > INT_MAX)
+               if ((val64 / scale) != orig || val64 > UINT_MAX)
                        fatal("%.200s line %d: RekeyLimit too large",
                            filename, linenum);
                if (val64 < 16)
                        fatal("%.200s line %d: RekeyLimit too small",
                            filename, linenum);
-               if (*activep && *intptr == -1)
-                       *intptr = (int)val64;
+               if (*activep && options->rekey_limit == -1)
+                       options->rekey_limit = (u_int32_t)val64;
                break;
 
        case oIdentityFile:
@@ -749,14 +749,14 @@ parse_int:
                break;
 
        case oLogLevel:
-               intptr = (int *) &options->log_level;
+               log_level_ptr = &options->log_level;
                arg = strdelim(&s);
                value = log_level_number(arg);
                if (value == SYSLOG_LEVEL_NOT_SET)
                        fatal("%.200s line %d: unsupported log level '%s'",
                            filename, linenum, arg ? arg : "<NONE>");
-               if (*activep && (LogLevel) *intptr == SYSLOG_LEVEL_NOT_SET)
-                       *intptr = (LogLevel) value;
+               if (*activep && *log_level_ptr == SYSLOG_LEVEL_NOT_SET)
+                       *log_level_ptr = (LogLevel) value;
                break;
 
        case oLocalForward:
@@ -1347,7 +1347,7 @@ parse_forward(Forward *fwd, const char *fwdspec)
 
        xfree(p);
 
-       if (fwd->listen_port == 0 && fwd->connect_port == 0)
+       if (fwd->listen_port == 0 || fwd->connect_port == 0)
                goto fail_free;
 
        if (fwd->connect_host != NULL &&
This page took 0.144906 seconds and 4 git commands to generate.