diff options
author | djm@openbsd.org <djm@openbsd.org> | 2022-06-03 04:30:46 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2022-06-03 14:33:18 +1000 |
commit | 22e1a3a71ad6d108ff0c5f07f93c3fcbd30f8b40 (patch) | |
tree | 51a3beeb61487d6449266b91203118595ab376f0 /servconf.c | |
parent | 38ed6c57e9e592c08e020fa6e82b45b4e1040970 (diff) | |
download | openssh-git-22e1a3a71ad6d108ff0c5f07f93c3fcbd30f8b40.tar.gz |
upstream: Make SetEnv directives first-match-wins in both
sshd_config and sshd_config; previously if the same name was reused then the
last would win (which is the opposite to how the config is supposed to work).
While there, make the ssh_config parsing more like sshd_config.
bz3438, ok dtucker
OpenBSD-Commit-ID: 797909c1e0262c0d00e09280459d7ab00f18273b
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,5 +1,5 @@ -/* $OpenBSD: servconf.c,v 1.384 2022/03/18 04:04:11 djm Exp $ */ +/* $OpenBSD: servconf.c,v 1.385 2022/06/03 04:30:47 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * All rights reserved @@ -2033,6 +2033,12 @@ process_server_config_line_depth(ServerOptions *options, char *line, filename, linenum); if (!*activep || uvalue != 0) continue; + if (lookup_setenv_in_list(arg, options->setenv, + options->num_setenv) != NULL) { + debug2("%s line %d: ignoring duplicate env " + "name \"%.64s\"", filename, linenum, arg); + continue; + } opt_array_append(filename, linenum, keyword, &options->setenv, &options->num_setenv, arg); } |