[openssh-commits] [openssh] 03/10: upstream: downgrade duplicate Subsystem directives from being a

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Sep 8 15:59:33 AEST 2023


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 52dfe3c72d98503d8b7c6f64fc7e19d685636c0b
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Wed Sep 6 23:21:36 2023 +0000

    upstream: downgrade duplicate Subsystem directives from being a
    
    fatal error to being a debug message to match behaviour with just about all
    other directives.
    
    OpenBSD-Commit-ID: fc90ed2cc0c18d4eb8e33d2c5e98d25f282588ce
---
 servconf.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/servconf.c b/servconf.c
index e16f9e90..a3779a9d 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: servconf.c,v 1.397 2023/08/29 02:50:10 djm Exp $ */
+/* $OpenBSD: servconf.c,v 1.398 2023/09/06 23:21:36 djm Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -1942,13 +1942,22 @@ process_server_config_line_depth(ServerOptions *options, char *line,
 			fatal("%s line %d: %s missing argument.",
 			    filename, linenum, keyword);
 		if (!*activep) {
-			arg = argv_next(&ac, &av);
+			argv_consume(&ac);
+			break;
+		}
+		found = 0;
+		for (i = 0; i < options->num_subsystems; i++) {
+			if (strcmp(arg, options->subsystem_name[i]) == 0) {
+				found = 1;
+				break;
+			}
+		}
+		if (found) {
+			debug("%s line %d: Subsystem '%s' already defined.",
+			    filename, linenum, arg);
+			argv_consume(&ac);
 			break;
 		}
-		for (i = 0; i < options->num_subsystems; i++)
-			if (strcmp(arg, options->subsystem_name[i]) == 0)
-				fatal("%s line %d: Subsystem '%s' "
-				    "already defined.", filename, linenum, arg);
 		options->subsystem_name[options->num_subsystems] = xstrdup(arg);
 		arg = argv_next(&ac, &av);
 		if (!arg || *arg == '\0')

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list