]> andersk Git - openssh.git/blobdiff - servconf.c
[buildpkg.sh.in] Last minute fix didn't make it in the .in file. :-(
[openssh.git] / servconf.c
index a72246b6cbd8653bde4c670f13199e90529a34df..ef86516519e3fea282b44429a32158a2f62e72ae 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: servconf.c,v 1.130 2003/12/23 16:12:10 jakob Exp $");
+RCSID("$OpenBSD: servconf.c,v 1.133 2004/05/23 23:59:53 dtucker Exp $");
 
 #include "ssh.h"
 #include "log.h"
@@ -18,7 +18,6 @@ RCSID("$OpenBSD: servconf.c,v 1.130 2003/12/23 16:12:10 jakob Exp $");
 #include "xmalloc.h"
 #include "compat.h"
 #include "pathnames.h"
-#include "tildexpand.h"
 #include "misc.h"
 #include "cipher.h"
 #include "kex.h"
@@ -95,12 +94,14 @@ initialize_server_options(ServerOptions *options)
        options->max_startups_begin = -1;
        options->max_startups_rate = -1;
        options->max_startups = -1;
+       options->max_authtries = -1;
        options->banner = NULL;
        options->use_dns = -1;
        options->client_alive_interval = -1;
        options->client_alive_count_max = -1;
        options->authorized_keys_file = NULL;
        options->authorized_keys_file2 = NULL;
+       options->num_accept_env = 0;
 
        /* Needs to be accessable in many places */
        use_privsep = -1;
@@ -212,6 +213,8 @@ fill_default_server_options(ServerOptions *options)
                options->max_startups_rate = 100;               /* 100% */
        if (options->max_startups_begin == -1)
                options->max_startups_begin = options->max_startups;
+       if (options->max_authtries == -1)
+               options->max_authtries = DEFAULT_AUTH_FAIL_MAX;
        if (options->use_dns == -1)
                options->use_dns = 1;
        if (options->client_alive_interval == -1)
@@ -262,11 +265,12 @@ typedef enum {
        sPermitUserEnvironment, sUseLogin, sAllowTcpForwarding, sCompression,
        sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups,
        sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
-       sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, sMaxStartups,
+       sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem,
+       sMaxStartups, sMaxAuthTries,
        sBanner, sUseDNS, sHostbasedAuthentication,
        sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
        sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
-       sGssAuthentication, sGssCleanupCreds,
+       sGssAuthentication, sGssCleanupCreds, sAcceptEnv,
        sUsePrivilegeSeparation,
        sDeprecated, sUnsupported
 } ServerOpCodes;
@@ -357,6 +361,7 @@ static struct {
        { "gatewayports", sGatewayPorts },
        { "subsystem", sSubsystem },
        { "maxstartups", sMaxStartups },
+       { "maxauthtries", sMaxAuthTries },
        { "banner", sBanner },
        { "usedns", sUseDNS },
        { "verifyreversemapping", sDeprecated },
@@ -366,6 +371,7 @@ static struct {
        { "authorizedkeysfile", sAuthorizedKeysFile },
        { "authorizedkeysfile2", sAuthorizedKeysFile2 },
        { "useprivilegeseparation", sUsePrivilegeSeparation},
+       { "acceptenv", sAcceptEnv },
        { NULL, sBadOption }
 };
 
@@ -868,6 +874,10 @@ parse_flag:
                        options->max_startups = options->max_startups_begin;
                break;
 
+       case sMaxAuthTries:
+               intptr = &options->max_authtries;
+               goto parse_int;
+
        case sBanner:
                charptr = &options->banner;
                goto parse_filename;
@@ -892,6 +902,19 @@ parse_flag:
                intptr = &options->client_alive_count_max;
                goto parse_int;
 
+       case sAcceptEnv:
+               while ((arg = strdelim(&cp)) && *arg != '\0') {
+                       if (strchr(arg, '=') != NULL)
+                               fatal("%s line %d: Invalid environment name.",
+                                   filename, linenum);
+                       if (options->num_accept_env >= MAX_ACCEPT_ENV)
+                               fatal("%s line %d: too many allow env.",
+                                   filename, linenum);
+                       options->accept_env[options->num_accept_env++] =
+                           xstrdup(arg);
+               }
+               break;
+
        case sDeprecated:
                logit("%s line %d: Deprecated option %s",
                    filename, linenum, arg);
This page took 0.038232 seconds and 4 git commands to generate.