]> git.feebdaed.xyz Git - 0xmirror/openssh-portable.git/commitdiff
upstream: check that invalid subsystem directives inside Match
authordjm@openbsd.org <djm@openbsd.org>
Fri, 19 Dec 2025 00:48:47 +0000 (00:48 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 19 Dec 2025 00:59:52 +0000 (11:59 +1100)
blocks are noticed at startup; bz#3906

OpenBSD-Regress-ID: b9171bde4cc24757a826b3da0e9eadc33995a453

regress/cfgmatch.sh

index 8b9d80f0a239ef716ad39eeabb0e2c099e0caadb..aa59f91491b5658e0c75cc113880ceebe9cbe2f7 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: cfgmatch.sh,v 1.15 2025/07/11 23:26:59 djm Exp $
+#      $OpenBSD: cfgmatch.sh,v 1.16 2025/12/19 00:48:47 djm Exp $
 #      Placed in the Public Domain.
 
 tid="sshd_config match"
@@ -160,3 +160,13 @@ EOD
                fi
        done
 done
+
+# Ensure that invalid subsystems are detected at startup
+cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy
+cat >> $OBJ/sshd_proxy << _EOF
+Match host blah
+       Subsystem invalid
+_EOF
+$SSHD -tf $OBJ/sshd_proxy 2>/dev/null && \
+       fail "sshd_config accepted invalid subsystem"
+