upstream commit

use printf instead of echo -n to reduce diff against
 -portable
This commit is contained in:
djm@openbsd.org 2015-01-27 12:01:36 +00:00 committed by Damien Miller
parent 9f7637f56e
commit e56aa87502
2 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: hostkey-agent.sh,v 1.3 2015/01/20 08:02:33 djm Exp $
# $OpenBSD: hostkey-agent.sh,v 1.4 2015/01/27 12:01:36 djm Exp $
# Placed in the Public Domain.
tid="hostkey agent"
@ -17,7 +17,7 @@ trace "load hostkeys"
for k in `${SSH} -Q key-plain` ; do
${SSHKEYGEN} -qt $k -f $OBJ/agent-key.$k -N '' || fatal "ssh-keygen $k"
(
echo -n 'localhost-with-alias,127.0.0.1,::1 '
printf 'localhost-with-alias,127.0.0.1,::1 '
cat $OBJ/agent-key.$k.pub
) >> $OBJ/known_hosts.orig
${SSHADD} $OBJ/agent-key.$k >/dev/null 2>&1 || \

View File

@ -1,4 +1,4 @@
# $OpenBSD: keygen-knownhosts.sh,v 1.1 2015/01/18 22:00:18 djm Exp $
# $OpenBSD: keygen-knownhosts.sh,v 1.2 2015/01/27 12:01:36 djm Exp $
# Placed in the Public Domain.
tid="ssh-keygen known_hosts"
@ -13,13 +13,13 @@ for x in host-a host-b host-c host-d host-e host-f host-a2 host-b2; do
echo "# $x" >> $OBJ/kh.hosts
(
case "$x" in
host-a|host-b) echo -n "$x " ;;
host-c) echo -n "@cert-authority $x " ;;
host-d) echo -n "@revoked $x " ;;
host-e) echo -n "host-e* " ;;
host-f) echo -n "host-f,host-g,host-h " ;;
host-a2) echo -n "host-a " ;;
host-b2) echo -n "host-b " ;;
host-a|host-b) printf "$x " ;;
host-c) printf "@cert-authority $x " ;;
host-d) printf "@revoked $x " ;;
host-e) printf "host-e* " ;;
host-f) printf "host-f,host-g,host-h " ;;
host-a2) printf "host-a " ;;
host-b2) printf "host-b " ;;
esac
cat $OBJ/kh.${x}.pub
# Blank line should be preserved.
@ -47,7 +47,7 @@ expect_key() {
test "x$_mark" = "xREVOKED" && _marker="@revoked "
test "x$_line" != "x" &&
echo "# Host $_host found: line $_line $_mark" >> $OBJ/kh.expect
echo -n "${_marker}$_hosts " >> $OBJ/kh.expect
printf "${_marker}$_hosts " >> $OBJ/kh.expect
cat $OBJ/kh.${_key}.pub >> $OBJ/kh.expect ||
fatal "${_key}.pub missing"
}