summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/servconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2004-04-27 09:46:38 +0000
committerDamien Miller <djm@cvs.openbsd.org>2004-04-27 09:46:38 +0000
commit958dcf038c05f370c9077b63a2f717585f316329 (patch)
tree1409d35ece6efe3f7ad7feb01c719dfdbe1c5053 /usr.bin/ssh/servconf.c
parentfbf3c3831531c2558d4064afd5c471f35777b62c (diff)
bz #815: implement ability to pass specified environment variables from the
client to the server; ok markus@
Diffstat (limited to 'usr.bin/ssh/servconf.c')
-rw-r--r--usr.bin/ssh/servconf.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c
index 2a9ed382a67..0ad5fd2eb8d 100644
--- a/usr.bin/ssh/servconf.c
+++ b/usr.bin/ssh/servconf.c
@@ -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.131 2004/04/27 09:46:37 djm Exp $");
#include "ssh.h"
#include "log.h"
@@ -96,6 +96,7 @@ initialize_server_options(ServerOptions *options)
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;
@@ -243,7 +244,7 @@ typedef enum {
sBanner, sUseDNS, sHostbasedAuthentication,
sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
- sGssAuthentication, sGssCleanupCreds,
+ sGssAuthentication, sGssCleanupCreds, sAcceptEnv,
sUsePrivilegeSeparation,
sDeprecated, sUnsupported
} ServerOpCodes;
@@ -331,6 +332,7 @@ static struct {
{ "authorizedkeysfile", sAuthorizedKeysFile },
{ "authorizedkeysfile2", sAuthorizedKeysFile2 },
{ "useprivilegeseparation", sUsePrivilegeSeparation},
+ { "acceptenv", sAcceptEnv },
{ NULL, sBadOption }
};
@@ -851,6 +853,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);