[openssh-commits] [openssh] 01/01: upstream: two new tests for Include in sshd_config, checking whether

git+noreply at mindrot.org git+noreply at mindrot.org
Thu May 28 08:42:14 AEST 2020

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

djm pushed a commit to branch master
in repository openssh.

commit 47adfdc07f4f8ea0064a1495500244de08d311ed
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Wed May 27 22:35:19 2020 +0000

    upstream: two new tests for Include in sshd_config, checking whether
    Port directives are processed correctly and handling of Include directives
    that appear before Match. Both tests currently fail. bz#3122 and bz#3169 -
    patch from Jakub Jelen
    OpenBSD-Regress-ID: 8ad5a4a385a63f0a1c59c59c763ff029b45715df
 regress/servcfginclude.sh | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/regress/servcfginclude.sh b/regress/servcfginclude.sh
index b25c8faa..b6a9a248 100644
--- a/regress/servcfginclude.sh
+++ b/regress/servcfginclude.sh
@@ -146,9 +146,43 @@ Include
 trace "disallow invalid with no argument"
-${SUDO} ${REAL_SSHD} -f $OBJ/sshd_config.i.x \
+${SUDO} ${REAL_SSHD} -f $OBJ/sshd_config.i.x -T \
     -C "host=x,user=test,addr=" 2>/dev/null && \
 	fail "sshd allowed Include with no argument"
+# Ensure the Include before any Match block works as expected (bug #3122)
+cat > $OBJ/sshd_config.i << _EOF
+Banner /xx
+HostKey $OBJ/host.ssh-ed25519
+Include $OBJ/sshd_config.i.2
+Match host a
+	Banner /aaaa
+cat > $OBJ/sshd_config.i.2 << _EOF
+Match host a
+	Banner /aa
+trace "Include before match blocks"
+trial a /aa "included file before match blocks is properly evaluated"
+# Port in included file is correctly interpretted (bug #3169)
+cat > $OBJ/sshd_config.i << _EOF
+Include $OBJ/sshd_config.i.2
+Port 7722
+cat > $OBJ/sshd_config.i.2 << _EOF
+HostKey $OBJ/host.ssh-ed25519
+trace "Port after included files"
+${SUDO} ${REAL_SSHD} -f $OBJ/sshd_config.i -T \
+    -C "host=x,user=test,addr=" > $OBJ/sshd_config.out || \
+	fail "failed to parse Port after included files"
+_port=`grep -i '^port ' $OBJ/sshd_config.out | awk '{print $2}'`
+if test "x7722" != "x$_port" ; then
+	fail "The Port in included file was intertepretted wrongly. Expected 7722, got $_port"
 # cleanup
 rm -f $OBJ/sshd_config.i $OBJ/sshd_config.i.* $OBJ/sshd_config.out

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

More information about the openssh-commits mailing list