]> andersk Git - gssapi-openssh.git/blobdiff - openssh/readconf.c
resolving conflicts from import of OpenSSH 3.1p1
[gssapi-openssh.git] / openssh / readconf.c
index 1f35670d33739e7e62227d6ccbc324aec81b54da..8469422e1083af8d241e032d539df1842fe85366 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.91 2001/10/01 21:51:16 markus Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.95 2002/02/04 12:15:25 markus Exp $");
 
 #include "ssh.h"
 #include "xmalloc.h"
@@ -121,7 +121,7 @@ typedef enum {
        oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias,
        oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
        oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
-       oClearAllForwardings, oNoHostAuthenticationForLocalhost 
+       oClearAllForwardings, oNoHostAuthenticationForLocalhost
 } OpCodes;
 
 /* Textual representations of the tokens. */
@@ -200,9 +200,9 @@ static struct {
        { "hostkeyalgorithms", oHostKeyAlgorithms },
        { "bindaddress", oBindAddress },
        { "smartcarddevice", oSmartcardDevice },
-       { "clearallforwardings", oClearAllForwardings }, 
-       { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost }, 
-       { NULL, 0 }
+       { "clearallforwardings", oClearAllForwardings },
+       { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
+       { NULL, oBadOption }
 };
 
 /*
@@ -240,7 +240,7 @@ add_remote_forward(Options *options, u_short port, const char *host,
        Forward *fwd;
        if (options->num_remote_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION)
                fatal("Too many remote forwards (max %d).",
-                     SSH_MAX_FORWARDS_PER_DIRECTION);
+                   SSH_MAX_FORWARDS_PER_DIRECTION);
        fwd = &options->remote_forwards[options->num_remote_forwards++];
        fwd->port = port;
        fwd->host = xstrdup(host);
@@ -426,7 +426,7 @@ parse_flag:
                arg = strdelim(&s);
                if (!arg || *arg == '\0')
                        fatal("%.200s line %d: Missing yes/no/ask argument.",
-                             filename, linenum);
+                           filename, linenum);
                value = 0;      /* To avoid compiler warning... */
                if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0)
                        value = 1;
@@ -468,7 +468,7 @@ parse_flag:
                        intptr = &options->num_identity_files;
                        if (*intptr >= SSH_MAX_IDENTITY_FILES)
                                fatal("%.200s line %d: Too many identity files specified (max %d).",
-                                     filename, linenum, SSH_MAX_IDENTITY_FILES);
+                                   filename, linenum, SSH_MAX_IDENTITY_FILES);
                        charptr =  &options->identity_files[*intptr];
                        *charptr = xstrdup(arg);
                        *intptr = *intptr + 1;
@@ -568,7 +568,7 @@ parse_int:
                value = cipher_number(arg);
                if (value == -1)
                        fatal("%.200s line %d: Bad cipher '%s'.",
-                             filename, linenum, arg ? arg : "<NONE>");
+                           filename, linenum, arg ? arg : "<NONE>");
                if (*activep && *intptr == -1)
                        *intptr = value;
                break;
@@ -579,7 +579,7 @@ parse_int:
                        fatal("%.200s line %d: Missing argument.", filename, linenum);
                if (!ciphers_valid(arg))
                        fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.",
-                             filename, linenum, arg ? arg : "<NONE>");
+                           filename, linenum, arg ? arg : "<NONE>");
                if (*activep && options->ciphers == NULL)
                        options->ciphers = xstrdup(arg);
                break;
@@ -590,7 +590,7 @@ parse_int:
                        fatal("%.200s line %d: Missing argument.", filename, linenum);
                if (!mac_valid(arg))
                        fatal("%.200s line %d: Bad SSH2 Mac spec '%s'.",
-                             filename, linenum, arg ? arg : "<NONE>");
+                           filename, linenum, arg ? arg : "<NONE>");
                if (*activep && options->macs == NULL)
                        options->macs = xstrdup(arg);
                break;
@@ -601,7 +601,7 @@ parse_int:
                        fatal("%.200s line %d: Missing argument.", filename, linenum);
                if (!key_names_valid2(arg))
                        fatal("%.200s line %d: Bad protocol 2 host key algorithms '%s'.",
-                             filename, linenum, arg ? arg : "<NONE>");
+                           filename, linenum, arg ? arg : "<NONE>");
                if (*activep && options->hostkeyalgorithms == NULL)
                        options->hostkeyalgorithms = xstrdup(arg);
                break;
@@ -614,7 +614,7 @@ parse_int:
                value = proto_spec(arg);
                if (value == SSH_PROTO_UNKNOWN)
                        fatal("%.200s line %d: Bad protocol spec '%s'.",
-                             filename, linenum, arg ? arg : "<NONE>");
+                           filename, linenum, arg ? arg : "<NONE>");
                if (*activep && *intptr == SSH_PROTO_UNKNOWN)
                        *intptr = value;
                break;
@@ -623,10 +623,10 @@ parse_int:
                intptr = (int *) &options->log_level;
                arg = strdelim(&s);
                value = log_level_number(arg);
-               if (value == (LogLevel) - 1)
+               if (value == SYSLOG_LEVEL_NOT_SET)
                        fatal("%.200s line %d: unsupported log level '%s'",
-                             filename, linenum, arg ? arg : "<NONE>");
-               if (*activep && (LogLevel) * intptr == -1)
+                           filename, linenum, arg ? arg : "<NONE>");
+               if (*activep && (LogLevel) *intptr == SYSLOG_LEVEL_NOT_SET)
                        *intptr = (LogLevel) value;
                break;
 
@@ -702,7 +702,7 @@ parse_int:
                        value = SSH_ESCAPECHAR_NONE;
                else {
                        fatal("%.200s line %d: Bad escape character.",
-                             filename, linenum);
+                           filename, linenum);
                        /* NOTREACHED */
                        value = 0;      /* Avoid compiler warning. */
                }
@@ -717,7 +717,7 @@ parse_int:
        /* Check that there is no garbage at end of line. */
        if ((arg = strdelim(&s)) != NULL && *arg != '\0') {
                fatal("%.200s line %d: garbage at end of line; \"%.200s\".",
-                     filename, linenum, arg);
+                    filename, linenum, arg);
        }
        return 0;
 }
@@ -759,7 +759,7 @@ read_config_file(const char *filename, const char *host, Options *options)
        fclose(f);
        if (bad_options > 0)
                fatal("%s: terminating, %d bad configuration options",
-                     filename, bad_options);
+                   filename, bad_options);
        return 1;
 }
 
@@ -834,7 +834,7 @@ initialize_options(Options * options)
        options->num_local_forwards = 0;
        options->num_remote_forwards = 0;
        options->clear_forwardings = -1;
-       options->log_level = (LogLevel) - 1;
+       options->log_level = SYSLOG_LEVEL_NOT_SET;
        options->preferred_authentications = NULL;
        options->bind_address = NULL;
        options->smartcard_device = NULL;
@@ -855,10 +855,8 @@ fill_default_options(Options * options)
                options->forward_agent = 0;
        if (options->forward_x11 == -1)
                options->forward_x11 = 0;
-#ifdef _PATH_XAUTH
        if (options->xauth_location == NULL)
                options->xauth_location = _PATH_XAUTH;
-#endif
        if (options->gateway_ports == -1)
                options->gateway_ports = 0;
        if (options->use_privileged_port == -1)
@@ -963,7 +961,7 @@ fill_default_options(Options * options)
                options->system_hostfile2 = _PATH_SSH_SYSTEM_HOSTFILE2;
        if (options->user_hostfile2 == NULL)
                options->user_hostfile2 = _PATH_SSH_USER_HOSTFILE2;
-       if (options->log_level == (LogLevel) - 1)
+       if (options->log_level == SYSLOG_LEVEL_NOT_SET)
                options->log_level = SYSLOG_LEVEL_INFO;
        if (options->clear_forwardings == 1)
                clear_forwardings(options);
This page took 0.052572 seconds and 4 git commands to generate.