]> andersk Git - openssh.git/blobdiff - readconf.c
- (dtucker) [session.c openbsd-compat/bsd-cygwin_util.h] Move Cygwin
[openssh.git] / readconf.c
index fee7a89934be8730d4ff45e950365ee0a151b851..332500e7c56471e58f18db84b80d0596af770273 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.110 2003/05/15 14:02:47 jakob Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.115 2003/07/22 13:35:22 markus Exp $");
 
 #include "ssh.h"
 #include "xmalloc.h"
@@ -94,7 +94,7 @@ typedef enum {
        oForwardAgent, oForwardX11, oGatewayPorts, oRhostsAuthentication,
        oPasswordAuthentication, oRSAAuthentication,
        oChallengeResponseAuthentication, oXAuthLocation,
-       oKerberosAuthentication, oKerberosTgtPassing, oAFSTokenPassing,
+       oKerberosAuthentication, oKerberosTgtPassing,
        oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward,
        oUser, oHost, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand,
        oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,
@@ -106,7 +106,8 @@ typedef enum {
        oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
        oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
        oClearAllForwardings, oNoHostAuthenticationForLocalhost,
-       oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS,
+       oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
+       oAddressFamily,
        oDeprecated, oUnsupported
 } OpCodes;
 
@@ -133,18 +134,14 @@ static struct {
        { "challengeresponseauthentication", oChallengeResponseAuthentication },
        { "skeyauthentication", oChallengeResponseAuthentication }, /* alias */
        { "tisauthentication", oChallengeResponseAuthentication },  /* alias */
-#if defined(KRB4) || defined(KRB5)
+#ifdef KRB5
        { "kerberosauthentication", oKerberosAuthentication },
        { "kerberostgtpassing", oKerberosTgtPassing },
 #else
        { "kerberosauthentication", oUnsupported },
        { "kerberostgtpassing", oUnsupported },
 #endif
-#if defined(AFS)
-       { "afstokenpassing", oAFSTokenPassing },
-#else
        { "afstokenpassing", oUnsupported },
-#endif
        { "fallbacktorsh", oDeprecated },
        { "usersh", oDeprecated },
        { "identityfile", oIdentityFile },
@@ -193,6 +190,8 @@ static struct {
 #endif
        { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
        { "rekeylimit", oRekeyLimit },
+       { "connecttimeout", oConnectTimeout },
+       { "addressfamily", oAddressFamily },
        { NULL, oBadOption }
 };
 
@@ -309,6 +308,20 @@ process_config_line(Options *options, const char *host,
                /* don't panic, but count bad options */
                return -1;
                /* NOTREACHED */
+       case oConnectTimeout:
+               intptr = &options->connection_timeout;
+/* parse_time: */
+               arg = strdelim(&s);
+               if (!arg || *arg == '\0')
+                       fatal("%s line %d: missing time value.",
+                           filename, linenum);
+               if ((value = convtime(arg)) == -1)
+                       fatal("%s line %d: invalid time value.",
+                           filename, linenum);
+               if (*intptr == -1)
+                       *intptr = value;
+               break;
+
        case oForwardAgent:
                intptr = &options->forward_agent;
 parse_flag:
@@ -382,10 +395,6 @@ parse_flag:
                intptr = &options->kerberos_tgt_passing;
                goto parse_flag;
 
-       case oAFSTokenPassing:
-               intptr = &options->afs_token_passing;
-               goto parse_flag;
-
        case oBatchMode:
                intptr = &options->batch_mode;
                goto parse_flag;
@@ -528,6 +537,8 @@ parse_string:
                goto parse_string;
 
        case oProxyCommand:
+               if (s == NULL)
+                       fatal("%.200s line %d: Missing argument.", filename, linenum);
                charptr = &options->proxy_command;
                len = strspn(s, WHITESPACE "=");
                if (*activep && *charptr == NULL)
@@ -705,6 +716,21 @@ parse_int:
                        *intptr = value;
                break;
 
+       case oAddressFamily:
+               arg = strdelim(&s);
+               intptr = &options->address_family;
+               if (strcasecmp(arg, "inet") == 0)
+                       value = AF_INET;
+               else if (strcasecmp(arg, "inet6") == 0)
+                       value = AF_INET6;
+               else if (strcasecmp(arg, "any") == 0)
+                       value = AF_UNSPEC;
+               else
+                       fatal("Unsupported AddressFamily \"%s\"", arg);
+               if (*activep && *intptr == -1)
+                       *intptr = value;
+               break;
+
        case oEnableSSHKeysign:
                intptr = &options->enable_ssh_keysign;
                goto parse_flag;
@@ -794,7 +820,6 @@ initialize_options(Options * options)
        options->challenge_response_authentication = -1;
        options->kerberos_authentication = -1;
        options->kerberos_tgt_passing = -1;
-       options->afs_token_passing = -1;
        options->password_authentication = -1;
        options->kbd_interactive_authentication = -1;
        options->kbd_interactive_devices = NULL;
@@ -807,7 +832,9 @@ initialize_options(Options * options)
        options->keepalives = -1;
        options->compression_level = -1;
        options->port = -1;
+       options->address_family = -1;
        options->connection_attempts = -1;
+       options->connection_timeout = -1;
        options->number_of_password_prompts = -1;
        options->cipher = -1;
        options->ciphers = NULL;
@@ -869,8 +896,6 @@ fill_default_options(Options * options)
                options->kerberos_authentication = 1;
        if (options->kerberos_tgt_passing == -1)
                options->kerberos_tgt_passing = 1;
-       if (options->afs_token_passing == -1)
-               options->afs_token_passing = 1;
        if (options->password_authentication == -1)
                options->password_authentication = 1;
        if (options->kbd_interactive_authentication == -1)
@@ -893,6 +918,8 @@ fill_default_options(Options * options)
                options->compression_level = 6;
        if (options->port == -1)
                options->port = 0;      /* Filled in ssh_connect. */
+       if (options->address_family == -1)
+               options->address_family = AF_UNSPEC;
        if (options->connection_attempts == -1)
                options->connection_attempts = 1;
        if (options->number_of_password_prompts == -1)
This page took 0.069469 seconds and 4 git commands to generate.