summaryrefslogtreecommitdiff
path: root/regress/servcfginclude.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/servcfginclude.sh')
-rw-r--r--regress/servcfginclude.sh36
1 files changed, 35 insertions, 1 deletions
diff --git a/regress/servcfginclude.sh b/regress/servcfginclude.sh
index b25c8faa8..b6a9a248f 100644
--- a/regress/servcfginclude.sh
+++ b/regress/servcfginclude.sh
@@ -146,9 +146,43 @@ Include
146_EOF 146_EOF
147 147
148trace "disallow invalid with no argument" 148trace "disallow invalid with no argument"
149${SUDO} ${REAL_SSHD} -f $OBJ/sshd_config.i.x \ 149${SUDO} ${REAL_SSHD} -f $OBJ/sshd_config.i.x -T \
150 -C "host=x,user=test,addr=127.0.0.1" 2>/dev/null && \ 150 -C "host=x,user=test,addr=127.0.0.1" 2>/dev/null && \
151 fail "sshd allowed Include with no argument" 151 fail "sshd allowed Include with no argument"
152 152
153# Ensure the Include before any Match block works as expected (bug #3122)
154cat > $OBJ/sshd_config.i << _EOF
155Banner /xx
156HostKey $OBJ/host.ssh-ed25519
157Include $OBJ/sshd_config.i.2
158Match host a
159 Banner /aaaa
160_EOF
161cat > $OBJ/sshd_config.i.2 << _EOF
162Match host a
163 Banner /aa
164_EOF
165
166trace "Include before match blocks"
167trial a /aa "included file before match blocks is properly evaluated"
168
169# Port in included file is correctly interpretted (bug #3169)
170cat > $OBJ/sshd_config.i << _EOF
171Include $OBJ/sshd_config.i.2
172Port 7722
173_EOF
174cat > $OBJ/sshd_config.i.2 << _EOF
175HostKey $OBJ/host.ssh-ed25519
176_EOF
177
178trace "Port after included files"
179${SUDO} ${REAL_SSHD} -f $OBJ/sshd_config.i -T \
180 -C "host=x,user=test,addr=127.0.0.1" > $OBJ/sshd_config.out || \
181 fail "failed to parse Port after included files"
182_port=`grep -i '^port ' $OBJ/sshd_config.out | awk '{print $2}'`
183if test "x7722" != "x$_port" ; then
184 fail "The Port in included file was intertepretted wrongly. Expected 7722, got $_port"
185fi
186
153# cleanup 187# cleanup
154rm -f $OBJ/sshd_config.i $OBJ/sshd_config.i.* $OBJ/sshd_config.out 188rm -f $OBJ/sshd_config.i $OBJ/sshd_config.i.* $OBJ/sshd_config.out