[openssh-commits] [openssh] 03/03: upstream: Test adding terminating newline to known_hosts.
git+noreply at mindrot.org
git+noreply at mindrot.org
Thu Feb 9 21:08:48 AEDT 2023
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
commit 22efb01e355bba4755b730ed417f91c081445bfc
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date: Thu Feb 9 09:55:33 2023 +0000
upstream: Test adding terminating newline to known_hosts.
OpenBSD-Regress-ID: 5fc3010ac450195b3fbdeb68e875564968800365
---
regress/knownhosts.sh | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/regress/knownhosts.sh b/regress/knownhosts.sh
index dfc768ac..7a9da5b1 100644
--- a/regress/knownhosts.sh
+++ b/regress/knownhosts.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: knownhosts.sh,v 1.1 2021/10/01 05:20:20 dtucker Exp $
+# $OpenBSD: knownhosts.sh,v 1.2 2023/02/09 09:55:33 dtucker Exp $
# Placed in the Public Domain.
tid="known hosts"
@@ -15,3 +15,21 @@ ${SSH} -ohashknownhosts=yes -o stricthostkeychecking=no $opts somehost true \
trace "test hashed known hosts"
${SSH} $opts somehost true || fail "reconnect with hashed known hosts"
+
+trace "no newline at end of known_hosts"
+printf "something" >$OBJ/known_hosts
+${SSH} $opts -ostricthostkeychecking=no somehost true \
+ || fail "hostkey update, missing newline, no strict"
+${SSH} $opts -ostricthostkeychecking=yes somehost true \
+ || fail "reconnect after adding with missing newline"
+
+trace "newline at end of known_hosts"
+printf "something\n" >$OBJ/known_hosts
+${SSH} $opts -ostricthostkeychecking=no somehost true \
+ || fail "hostkey update, newline, no strict"
+${SSH} $opts -ostricthostkeychecking=yes somehost true \
+ || fail "reconnect after adding without missing newline"
+lines=`wc -l <$OBJ/known_hosts`
+if [ $lines -ne 2 ]; then
+ fail "expected 2 lines in known_hosts, found $lines"
+fi
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list