]> andersk Git - gssapi-openssh.git/blobdiff - openssh/readconf.c
Release new patch.
[gssapi-openssh.git] / openssh / readconf.c
index c256c2d03672f5b548b803468502bd2e70008e17..3dce5a2344f3d6ea1c444a71d501dd11a1d9c7f2 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.159 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: readconf.c,v 1.162 2007/03/20 03:56:12 tedu Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -378,7 +378,7 @@ parse_time:
                if ((value = convtime(arg)) == -1)
                        fatal("%s line %d: invalid time value.",
                            filename, linenum);
-               if (*intptr == -1)
+               if (*activep && *intptr == -1)
                        *intptr = value;
                break;
 
@@ -478,10 +478,21 @@ parse_flag:
        case oNoneEnabled:
                intptr = &options->none_enabled;
                goto parse_flag;
-
+       /* we check to see if the command comes from the */
+       /* command line or not. If it does then enable it */
+       /* otherwise fail. NONE should never be a default configuration */
        case oNoneSwitch:
-               intptr = &options->none_switch;
-               goto parse_flag;
+               if(strcmp(filename,"command-line")==0)
+               {               
+                   intptr = &options->none_switch;
+                   goto parse_flag;
+               } else {
+                   error("NoneSwitch is found in %.200s.\nYou may only use this configuration option from the command line", filename);
+                   error("Continuing...");
+                   debug("NoneSwitch directive found in %.200s.", filename);
+                   return 0;
+               }
 
        case oHPNDisabled:
                intptr = &options->hpn_disabled;
@@ -499,7 +510,6 @@ parse_flag:
                intptr = &options->verify_host_key_dns;
                goto parse_yesnoask;
 
-
        case oStrictHostKeyChecking:
                intptr = &options->strict_host_key_checking;
 parse_yesnoask:
@@ -588,7 +598,7 @@ parse_yesnoask:
                        if (*intptr >= SSH_MAX_IDENTITY_FILES)
                                fatal("%.200s line %d: Too many identity files specified (max %d).",
                                    filename, linenum, SSH_MAX_IDENTITY_FILES);
-                       charptr =  &options->identity_files[*intptr];
+                       charptr = &options->identity_files[*intptr];
                        *charptr = xstrdup(arg);
                        *intptr = *intptr + 1;
                }
@@ -1250,16 +1260,19 @@ fill_default_options(Options * options)
                options->none_switch = 0;
        if (options->hpn_disabled == -1)
                options->hpn_disabled = 0;
-       if (options->hpn_buffer_size == -1)
-               options->hpn_buffer_size = 2*1024*1024;
-       else {
+       if (options->hpn_buffer_size > -1)
+       {
                if (options->hpn_buffer_size == 0)
-                       options->hpn_buffer_size = 1;
-               /*limit the buffer to 7MB*/
-               if (options->hpn_buffer_size > 7168)
-                       options->hpn_buffer_size = 7168;
+               options->hpn_buffer_size = 1;
+               /*limit the buffer to 64MB*/
+                       if (options->hpn_buffer_size > 65536)
+               {
+                       options->hpn_buffer_size = 65536;
+                       debug("User requested buffer larger than 64MB. Request reverted to 64MB");
+               }
                options->hpn_buffer_size *=1024;
-       }       
+               debug("hpn_buffer_size set to %d", options->hpn_buffer_size);
+       }
        if (options->tcp_rcv_buf == 0)
                options->tcp_rcv_buf = 1;
        if (options->tcp_rcv_buf > -1) 
@@ -1301,7 +1314,7 @@ parse_forward(Forward *fwd, const char *fwdspec)
        cp = p = xstrdup(fwdspec);
 
        /* skip leading spaces */
-       while (*cp && isspace(*cp))
+       while (isspace(*cp))
                cp++;
 
        for (i = 0; i < 4; ++i)
This page took 0.0552 seconds and 4 git commands to generate.