summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2011-05-15 08:45:50 +1000
committerDamien Miller <djm@mindrot.org>2011-05-15 08:45:50 +1000
commit21771e22d3e23a10cb01983b2df83d47362eadda (patch)
treef9b85caefb4f1549c847d34a7c7b3adead764c6b /readconf.c
parentfe92421772243702ecb18b862dbeb51a9bdbbc6e (diff)
- djm@cvs.openbsd.org 2011/05/06 21:34:32
[clientloop.c mux.c readconf.c readconf.h ssh.c ssh_config.5] Add a RequestTTY ssh_config option to allow configuration-based control over tty allocation (like -t/-T); ok markus@
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index 927e7fefa..4780ae289 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.191 2011/05/06 21:31:38 djm Exp $ */ 1/* $OpenBSD: readconf.c,v 1.192 2011/05/06 21:34:32 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -134,7 +134,7 @@ typedef enum {
134 oHashKnownHosts, 134 oHashKnownHosts,
135 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, 135 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
136 oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, 136 oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication,
137 oKexAlgorithms, oIPQoS, 137 oKexAlgorithms, oIPQoS, oRequestTTY,
138 oDeprecated, oUnsupported 138 oDeprecated, oUnsupported
139} OpCodes; 139} OpCodes;
140 140
@@ -245,6 +245,7 @@ static struct {
245#endif 245#endif
246 { "kexalgorithms", oKexAlgorithms }, 246 { "kexalgorithms", oKexAlgorithms },
247 { "ipqos", oIPQoS }, 247 { "ipqos", oIPQoS },
248 { "requesttty", oRequestTTY },
248 249
249 { NULL, oBadOption } 250 { NULL, oBadOption }
250}; 251};
@@ -1013,6 +1014,26 @@ parse_int:
1013 intptr = &options->use_roaming; 1014 intptr = &options->use_roaming;
1014 goto parse_flag; 1015 goto parse_flag;
1015 1016
1017 case oRequestTTY:
1018 arg = strdelim(&s);
1019 if (!arg || *arg == '\0')
1020 fatal("%s line %d: missing argument.",
1021 filename, linenum);
1022 intptr = &options->request_tty;
1023 if (strcasecmp(arg, "yes") == 0)
1024 value = REQUEST_TTY_YES;
1025 else if (strcasecmp(arg, "no") == 0)
1026 value = REQUEST_TTY_NO;
1027 else if (strcasecmp(arg, "force") == 0)
1028 value = REQUEST_TTY_FORCE;
1029 else if (strcasecmp(arg, "auto") == 0)
1030 value = REQUEST_TTY_AUTO;
1031 else
1032 fatal("Unsupported RequestTTY \"%s\"", arg);
1033 if (*activep && *intptr == -1)
1034 *intptr = value;
1035 break;
1036
1016 case oDeprecated: 1037 case oDeprecated:
1017 debug("%s line %d: Deprecated option \"%s\"", 1038 debug("%s line %d: Deprecated option \"%s\"",
1018 filename, linenum, keyword); 1039 filename, linenum, keyword);
@@ -1173,6 +1194,7 @@ initialize_options(Options * options)
1173 options->zero_knowledge_password_authentication = -1; 1194 options->zero_knowledge_password_authentication = -1;
1174 options->ip_qos_interactive = -1; 1195 options->ip_qos_interactive = -1;
1175 options->ip_qos_bulk = -1; 1196 options->ip_qos_bulk = -1;
1197 options->request_tty = -1;
1176} 1198}
1177 1199
1178/* 1200/*
@@ -1331,6 +1353,8 @@ fill_default_options(Options * options)
1331 options->ip_qos_interactive = IPTOS_LOWDELAY; 1353 options->ip_qos_interactive = IPTOS_LOWDELAY;
1332 if (options->ip_qos_bulk == -1) 1354 if (options->ip_qos_bulk == -1)
1333 options->ip_qos_bulk = IPTOS_THROUGHPUT; 1355 options->ip_qos_bulk = IPTOS_THROUGHPUT;
1356 if (options->request_tty == -1)
1357 options->request_tty = REQUEST_TTY_AUTO;
1334 /* options->local_command should not be set by default */ 1358 /* options->local_command should not be set by default */
1335 /* options->proxy_command should not be set by default */ 1359 /* options->proxy_command should not be set by default */
1336 /* options->user will be set in the main program if appropriate */ 1360 /* options->user will be set in the main program if appropriate */