summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/servconf.c b/servconf.c
index 6de77164e..a8a40f97e 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.c,v 1.224 2012/03/29 23:54:36 dtucker Exp $ */ 1/* $OpenBSD: servconf.c,v 1.225 2012/04/12 02:42:32 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -138,6 +138,7 @@ initialize_server_options(ServerOptions *options)
138 options->authorized_principals_file = NULL; 138 options->authorized_principals_file = NULL;
139 options->ip_qos_interactive = -1; 139 options->ip_qos_interactive = -1;
140 options->ip_qos_bulk = -1; 140 options->ip_qos_bulk = -1;
141 options->version_addendum = NULL;
141} 142}
142 143
143void 144void
@@ -277,7 +278,8 @@ fill_default_server_options(ServerOptions *options)
277 options->ip_qos_interactive = IPTOS_LOWDELAY; 278 options->ip_qos_interactive = IPTOS_LOWDELAY;
278 if (options->ip_qos_bulk == -1) 279 if (options->ip_qos_bulk == -1)
279 options->ip_qos_bulk = IPTOS_THROUGHPUT; 280 options->ip_qos_bulk = IPTOS_THROUGHPUT;
280 281 if (options->version_addendum == NULL)
282 options->version_addendum = xstrdup("");
281 /* Turn privilege separation on by default */ 283 /* Turn privilege separation on by default */
282 if (use_privsep == -1) 284 if (use_privsep == -1)
283 use_privsep = PRIVSEP_ON; 285 use_privsep = PRIVSEP_ON;
@@ -323,7 +325,7 @@ typedef enum {
323 sUsePrivilegeSeparation, sAllowAgentForwarding, 325 sUsePrivilegeSeparation, sAllowAgentForwarding,
324 sZeroKnowledgePasswordAuthentication, sHostCertificate, 326 sZeroKnowledgePasswordAuthentication, sHostCertificate,
325 sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile, 327 sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile,
326 sKexAlgorithms, sIPQoS, 328 sKexAlgorithms, sIPQoS, sVersionAddendum,
327 sDeprecated, sUnsupported 329 sDeprecated, sUnsupported
328} ServerOpCodes; 330} ServerOpCodes;
329 331
@@ -448,6 +450,7 @@ static struct {
448 { "authorizedprincipalsfile", sAuthorizedPrincipalsFile, SSHCFG_ALL }, 450 { "authorizedprincipalsfile", sAuthorizedPrincipalsFile, SSHCFG_ALL },
449 { "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL }, 451 { "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL },
450 { "ipqos", sIPQoS, SSHCFG_ALL }, 452 { "ipqos", sIPQoS, SSHCFG_ALL },
453 { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL },
451 { NULL, sBadOption, 0 } 454 { NULL, sBadOption, 0 }
452}; 455};
453 456
@@ -1403,6 +1406,22 @@ process_server_config_line(ServerOptions *options, char *line,
1403 } 1406 }
1404 break; 1407 break;
1405 1408
1409 case sVersionAddendum:
1410 if (cp == NULL)
1411 fatal("%.200s line %d: Missing argument.", filename,
1412 linenum);
1413 len = strspn(cp, WHITESPACE);
1414 if (*activep && options->version_addendum == NULL) {
1415 if (strcasecmp(cp + len, "none") == 0)
1416 options->version_addendum = xstrdup("");
1417 else if (strchr(cp + len, '\r') != NULL)
1418 fatal("%.200s line %d: Invalid argument",
1419 filename, linenum);
1420 else
1421 options->version_addendum = xstrdup(cp + len);
1422 }
1423 return 0;
1424
1406 case sDeprecated: 1425 case sDeprecated:
1407 logit("%s line %d: Deprecated option %s", 1426 logit("%s line %d: Deprecated option %s",
1408 filename, linenum, arg); 1427 filename, linenum, arg);
@@ -1766,6 +1785,7 @@ dump_config(ServerOptions *o)
1766 dump_cfg_string(sRevokedKeys, o->revoked_keys_file); 1785 dump_cfg_string(sRevokedKeys, o->revoked_keys_file);
1767 dump_cfg_string(sAuthorizedPrincipalsFile, 1786 dump_cfg_string(sAuthorizedPrincipalsFile,
1768 o->authorized_principals_file); 1787 o->authorized_principals_file);
1788 dump_cfg_string(sVersionAddendum, o->version_addendum);
1769 1789
1770 /* string arguments requiring a lookup */ 1790 /* string arguments requiring a lookup */
1771 dump_cfg_string(sLogLevel, log_level_name(o->log_level)); 1791 dump_cfg_string(sLogLevel, log_level_name(o->log_level));