summaryrefslogtreecommitdiffstats
path: root/readconf.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2024-12-06 17:21:48 +0100
committerDamien Miller <djm@mindrot.org>2024-12-07 11:16:02 +0100
commit9a9ffee6e10bcd039f1f9385599577441ebe542a (patch)
treeffc8d70baf96f5a4dc226a1d56be410dcd191c15 /readconf.c
parentupstream: clarify encoding of options/extensions; bz2389 (diff)
downloadopenssh-9a9ffee6e10bcd039f1f9385599577441ebe542a.tar.xz
openssh-9a9ffee6e10bcd039f1f9385599577441ebe542a.zip
upstream: support VersionAddendum in the client, mirroring the
option of the same name in the server; bz2745 ok dtucker@ OpenBSD-Commit-ID: 6ff7905b3f9806649bde750515786553fb89cdf4
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/readconf.c b/readconf.c
index 777739d6a..aa6465887 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.393 2024/11/27 16:07:08 djm Exp $ */
+/* $OpenBSD: readconf.c,v 1.394 2024/12/06 16:21:48 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -179,6 +179,7 @@ typedef enum {
oPubkeyAcceptedAlgorithms, oCASignatureAlgorithms, oProxyJump,
oSecurityKeyProvider, oKnownHostsCommand, oRequiredRSASize,
oEnableEscapeCommandline, oObscureKeystrokeTiming, oChannelTimeout,
+ oVersionAddendum,
oIgnore, oIgnoredUnknownOption, oDeprecated, oUnsupported
} OpCodes;
@@ -329,6 +330,7 @@ static struct {
{ "enableescapecommandline", oEnableEscapeCommandline },
{ "obscurekeystroketiming", oObscureKeystrokeTiming },
{ "channeltimeout", oChannelTimeout },
+ { "versionaddendum", oVersionAddendum },
{ NULL, oBadOption }
};
@@ -2440,6 +2442,28 @@ parse_pubkey_algos:
}
break;
+ case oVersionAddendum:
+ if (str == NULL || *str == '\0')
+ fatal("%s line %d: %s missing argument.",
+ filename, linenum, keyword);
+ len = strspn(str, WHITESPACE);
+ if (strchr(str + len, '\r') != NULL) {
+ fatal("%.200s line %d: Invalid %s argument",
+ filename, linenum, keyword);
+ }
+ if ((arg = strchr(line, '#')) != NULL) {
+ *arg = '\0';
+ rtrim(line);
+ }
+ if (*activep && options->version_addendum == NULL) {
+ if (strcasecmp(str + len, "none") == 0)
+ options->version_addendum = xstrdup("");
+ else
+ options->version_addendum = xstrdup(str + len);
+ }
+ argv_consume(&ac);
+ break;
+
case oDeprecated:
debug("%s line %d: Deprecated option \"%s\"",
filename, linenum, keyword);
@@ -2696,6 +2720,7 @@ initialize_options(Options * options)
options->tag = NULL;
options->channel_timeouts = NULL;
options->num_channel_timeouts = 0;
+ options->version_addendum = NULL;
}
/*
@@ -3649,6 +3674,7 @@ dump_client_config(Options *o, const char *host)
dump_cfg_string(oXAuthLocation, o->xauth_location);
dump_cfg_string(oKnownHostsCommand, o->known_hosts_command);
dump_cfg_string(oTag, o->tag);
+ dump_cfg_string(oVersionAddendum, o->version_addendum);
/* Forwards */
dump_cfg_forwards(oDynamicForward, o->num_local_forwards, o->local_forwards);