diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2013-05-17 00:37:41 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2013-05-17 00:37:41 +0000 |
commit | 877d2a384aa9768b397ad54bcefcb0c61f1cfbae (patch) | |
tree | 788ce89c79992b0b5d129ef7bd1e904cc9813575 | |
parent | 409be4d4675d916b5b1c9fa8479f8bfb976bf6f8 (diff) |
replace 'echo -n' with 'printf' since it's more portable
-rw-r--r-- | regress/usr.bin/ssh/agent.sh | 4 | ||||
-rw-r--r-- | regress/usr.bin/ssh/cert-hostkey.sh | 48 | ||||
-rw-r--r-- | regress/usr.bin/ssh/cert-userkey.sh | 10 | ||||
-rw-r--r-- | regress/usr.bin/ssh/cfgmatch.sh | 6 | ||||
-rw-r--r-- | regress/usr.bin/ssh/cipher-speed.sh | 6 | ||||
-rw-r--r-- | regress/usr.bin/ssh/forcecommand.sh | 10 | ||||
-rw-r--r-- | regress/usr.bin/ssh/keytype.sh | 4 | ||||
-rw-r--r-- | regress/usr.bin/ssh/proto-version.sh | 4 | ||||
-rw-r--r-- | regress/usr.bin/ssh/ssh-com.sh | 4 | ||||
-rw-r--r-- | regress/usr.bin/ssh/test-exec.sh | 6 |
10 files changed, 51 insertions, 51 deletions
diff --git a/regress/usr.bin/ssh/agent.sh b/regress/usr.bin/ssh/agent.sh index f17fde42e47..be7d91334d6 100644 --- a/regress/usr.bin/ssh/agent.sh +++ b/regress/usr.bin/ssh/agent.sh @@ -1,4 +1,4 @@ -# $OpenBSD: agent.sh,v 1.7 2007/11/25 15:35:09 jmc Exp $ +# $OpenBSD: agent.sh,v 1.8 2013/05/17 00:37:40 dtucker Exp $ # Placed in the Public Domain. tid="simple agent test" @@ -19,7 +19,7 @@ else fail "ssh-add -l did not fail with exit code 1" fi trace "overwrite authorized keys" - echo -n > $OBJ/authorized_keys_$USER + printf '' > $OBJ/authorized_keys_$USER for t in rsa rsa1; do # generate user key for agent rm -f $OBJ/$t-agent diff --git a/regress/usr.bin/ssh/cert-hostkey.sh b/regress/usr.bin/ssh/cert-hostkey.sh index 82bbee42a85..f4302852caf 100644 --- a/regress/usr.bin/ssh/cert-hostkey.sh +++ b/regress/usr.bin/ssh/cert-hostkey.sh @@ -1,4 +1,4 @@ -# $OpenBSD: cert-hostkey.sh,v 1.6 2011/05/20 02:43:36 djm Exp $ +# $OpenBSD: cert-hostkey.sh,v 1.7 2013/05/17 00:37:40 dtucker Exp $ # Placed in the Public Domain. tid="certified host keys" @@ -12,8 +12,8 @@ HOSTS='localhost-with-alias,127.0.0.1,::1' ${SSHKEYGEN} -q -N '' -t rsa -f $OBJ/host_ca_key ||\ fail "ssh-keygen of host_ca_key failed" ( - echo -n '@cert-authority ' - echo -n "$HOSTS " + printf '@cert-authority ' + printf "$HOSTS " cat $OBJ/host_ca_key.pub ) > $OBJ/known_hosts-cert @@ -60,23 +60,23 @@ done # Revoked certificates with key present ( - echo -n '@cert-authority ' - echo -n "$HOSTS " + printf '@cert-authority ' + printf "$HOSTS " cat $OBJ/host_ca_key.pub - echo -n '@revoked ' - echo -n "* " + printf '@revoked ' + printf "* " cat $OBJ/cert_host_key_rsa.pub - echo -n '@revoked ' - echo -n "* " + printf '@revoked ' + printf "* " cat $OBJ/cert_host_key_ecdsa.pub - echo -n '@revoked ' - echo -n "* " + printf '@revoked ' + printf "* " cat $OBJ/cert_host_key_dsa.pub - echo -n '@revoked ' - echo -n "* " + printf '@revoked ' + printf "* " cat $OBJ/cert_host_key_rsa_v00.pub - echo -n '@revoked ' - echo -n "* " + printf '@revoked ' + printf "* " cat $OBJ/cert_host_key_dsa_v00.pub ) > $OBJ/known_hosts-cert for privsep in yes no ; do @@ -100,11 +100,11 @@ done # Revoked CA ( - echo -n '@cert-authority ' - echo -n "$HOSTS " + printf '@cert-authority ' + printf "$HOSTS " cat $OBJ/host_ca_key.pub - echo -n '@revoked ' - echo -n "* " + printf '@revoked ' + printf "* " cat $OBJ/host_ca_key.pub ) > $OBJ/known_hosts-cert for ktype in rsa dsa ecdsa rsa_v00 dsa_v00 ; do @@ -124,8 +124,8 @@ done # Create a CA key and add it to known hosts ( - echo -n '@cert-authority ' - echo -n "$HOSTS " + printf '@cert-authority ' + printf "$HOSTS " cat $OBJ/host_ca_key.pub ) > $OBJ/known_hosts-cert @@ -192,7 +192,7 @@ for v in v01 v00 ; do -n $HOSTS $OBJ/cert_host_key_${ktype} || fail "couldn't sign cert_host_key_${ktype}" ( - echo -n "$HOSTS " + printf "$HOSTS " cat $OBJ/cert_host_key_${ktype}.pub ) > $OBJ/known_hosts-cert ( @@ -212,8 +212,8 @@ done # Wrong certificate ( - echo -n '@cert-authority ' - echo -n "$HOSTS " + printf '@cert-authority ' + printf "$HOSTS " cat $OBJ/host_ca_key.pub ) > $OBJ/known_hosts-cert for v in v01 v00 ; do diff --git a/regress/usr.bin/ssh/cert-userkey.sh b/regress/usr.bin/ssh/cert-userkey.sh index 8dc9a691ac8..45398748010 100644 --- a/regress/usr.bin/ssh/cert-userkey.sh +++ b/regress/usr.bin/ssh/cert-userkey.sh @@ -1,4 +1,4 @@ -# $OpenBSD: cert-userkey.sh,v 1.10 2013/01/18 00:45:29 djm Exp $ +# $OpenBSD: cert-userkey.sh,v 1.11 2013/05/17 00:37:40 dtucker Exp $ # Placed in the Public Domain. tid="certified user keys" @@ -120,7 +120,7 @@ for ktype in rsa dsa ecdsa rsa_v00 dsa_v00 ; do # Wrong principals list verbose "$tid: ${_prefix} wrong principals key option" ( - echo -n 'cert-authority,principals="gregorsamsa" ' + printf 'cert-authority,principals="gregorsamsa" ' cat $OBJ/user_ca_key.pub ) > $OBJ/authorized_keys_$USER ${SSH} -2i $OBJ/cert_user_key_${ktype} \ @@ -132,7 +132,7 @@ for ktype in rsa dsa ecdsa rsa_v00 dsa_v00 ; do # Correct principals list verbose "$tid: ${_prefix} correct principals key option" ( - echo -n 'cert-authority,principals="mekmitasdigoat" ' + printf 'cert-authority,principals="mekmitasdigoat" ' cat $OBJ/user_ca_key.pub ) > $OBJ/authorized_keys_$USER ${SSH} -2i $OBJ/cert_user_key_${ktype} \ @@ -148,7 +148,7 @@ basic_tests() { if test "x$auth" = "xauthorized_keys" ; then # Add CA to authorized_keys ( - echo -n 'cert-authority ' + printf 'cert-authority ' cat $OBJ/user_ca_key.pub ) > $OBJ/authorized_keys_$USER else @@ -258,7 +258,7 @@ test_one() { if test "x$auth" = "xauthorized_keys" ; then # Add CA to authorized_keys ( - echo -n "cert-authority${auth_opt} " + printf "cert-authority${auth_opt} " cat $OBJ/user_ca_key.pub ) > $OBJ/authorized_keys_$USER else diff --git a/regress/usr.bin/ssh/cfgmatch.sh b/regress/usr.bin/ssh/cfgmatch.sh index 4e36f4ffb4d..80cf22930ce 100644 --- a/regress/usr.bin/ssh/cfgmatch.sh +++ b/regress/usr.bin/ssh/cfgmatch.sh @@ -1,4 +1,4 @@ -# $OpenBSD: cfgmatch.sh,v 1.7 2013/04/06 06:00:22 dtucker Exp $ +# $OpenBSD: cfgmatch.sh,v 1.8 2013/05/17 00:37:40 dtucker Exp $ # Placed in the Public Domain. tid="sshd_config match" @@ -74,9 +74,9 @@ for p in 1 2; do done # Retry previous with key option, should also be denied. -echo -n 'permitopen="127.0.0.1:'$PORT'" ' >$OBJ/authorized_keys_$USER +printf 'permitopen="127.0.0.1:'$PORT'" ' >$OBJ/authorized_keys_$USER cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER -echo -n 'permitopen="127.0.0.1:'$PORT'" ' >>$OBJ/authorized_keys_$USER +printf 'permitopen="127.0.0.1:'$PORT'" ' >>$OBJ/authorized_keys_$USER cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER for p in 1 2; do trace "match permitopen proxy w/key opts proto $p" diff --git a/regress/usr.bin/ssh/cipher-speed.sh b/regress/usr.bin/ssh/cipher-speed.sh index 343b3ed572a..262cb2cf771 100644 --- a/regress/usr.bin/ssh/cipher-speed.sh +++ b/regress/usr.bin/ssh/cipher-speed.sh @@ -1,4 +1,4 @@ -# $OpenBSD: cipher-speed.sh,v 1.7 2013/01/12 11:23:53 djm Exp $ +# $OpenBSD: cipher-speed.sh,v 1.8 2013/05/17 00:37:40 dtucker Exp $ # Placed in the Public Domain. tid="cipher speed" @@ -23,7 +23,7 @@ macs="hmac-sha1 hmac-md5 umac-64@openssh.com umac-128@openssh.com for c in $ciphers; do n=0; for m in $macs; do trace "proto 2 cipher $c mac $m" for x in $tries; do - echo -n "$c/$m:\t" + printf "$c/$m:\t" ( ${SSH} -o 'compression no' \ -F $OBJ/ssh_proxy -2 -m $m -c $c somehost \ exec sh -c \'"dd of=/dev/null obs=32k"\' \ @@ -44,7 +44,7 @@ ciphers="3des blowfish" for c in $ciphers; do trace "proto 1 cipher $c" for x in $tries; do - echo -n "$c:\t" + printf "$c:\t" ( ${SSH} -o 'compression no' \ -F $OBJ/ssh_proxy -1 -c $c somehost \ exec sh -c \'"dd of=/dev/null obs=32k"\' \ diff --git a/regress/usr.bin/ssh/forcecommand.sh b/regress/usr.bin/ssh/forcecommand.sh index 796e7c2c094..44d2b7ffdab 100644 --- a/regress/usr.bin/ssh/forcecommand.sh +++ b/regress/usr.bin/ssh/forcecommand.sh @@ -1,13 +1,13 @@ -# $OpenBSD: forcecommand.sh,v 1.1 2006/07/19 13:09:28 dtucker Exp $ +# $OpenBSD: forcecommand.sh,v 1.2 2013/05/17 00:37:40 dtucker Exp $ # Placed in the Public Domain. tid="forced command" cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak -echo -n 'command="true" ' >$OBJ/authorized_keys_$USER +printf 'command="true" ' >$OBJ/authorized_keys_$USER cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER -echo -n 'command="true" ' >>$OBJ/authorized_keys_$USER +printf 'command="true" ' >>$OBJ/authorized_keys_$USER cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER for p in 1 2; do @@ -16,9 +16,9 @@ for p in 1 2; do fail "forced command in key proto $p" done -echo -n 'command="false" ' >$OBJ/authorized_keys_$USER +printf 'command="false" ' >$OBJ/authorized_keys_$USER cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER -echo -n 'command="false" ' >>$OBJ/authorized_keys_$USER +printf 'command="false" ' >>$OBJ/authorized_keys_$USER cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy diff --git a/regress/usr.bin/ssh/keytype.sh b/regress/usr.bin/ssh/keytype.sh index 7be3cc0c88b..1df2ad8577e 100644 --- a/regress/usr.bin/ssh/keytype.sh +++ b/regress/usr.bin/ssh/keytype.sh @@ -1,4 +1,4 @@ -# $OpenBSD: keytype.sh,v 1.1 2010/09/02 16:12:55 markus Exp $ +# $OpenBSD: keytype.sh,v 1.2 2013/05/17 00:37:40 dtucker Exp $ # Placed in the Public Domain. tid="login with different key types" @@ -33,7 +33,7 @@ for ut in $ktypes; do echo IdentityFile $OBJ/key.$ut ) > $OBJ/ssh_proxy ( - echo -n 'localhost-with-alias,127.0.0.1,::1 ' + printf 'localhost-with-alias,127.0.0.1,::1 ' cat $OBJ/key.$ht.pub ) > $OBJ/known_hosts cat $OBJ/key.$ut.pub > $OBJ/authorized_keys_$USER diff --git a/regress/usr.bin/ssh/proto-version.sh b/regress/usr.bin/ssh/proto-version.sh index 7dc616f5fed..b876dd7ec2b 100644 --- a/regress/usr.bin/ssh/proto-version.sh +++ b/regress/usr.bin/ssh/proto-version.sh @@ -1,4 +1,4 @@ -# $OpenBSD: proto-version.sh,v 1.3 2002/03/15 13:08:56 markus Exp $ +# $OpenBSD: proto-version.sh,v 1.4 2013/05/17 00:37:40 dtucker Exp $ # Placed in the Public Domain. tid="sshd version with different protocol combinations" @@ -8,7 +8,7 @@ check_version () { version=$1 expect=$2 - banner=`echo -n | ${SSHD} -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy` + banner=`printf '' | ${SSHD} -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy` case ${banner} in SSH-1.99-*) proto=199 diff --git a/regress/usr.bin/ssh/ssh-com.sh b/regress/usr.bin/ssh/ssh-com.sh index a293fc6a515..6c5cfe888db 100644 --- a/regress/usr.bin/ssh/ssh-com.sh +++ b/regress/usr.bin/ssh/ssh-com.sh @@ -1,4 +1,4 @@ -# $OpenBSD: ssh-com.sh,v 1.7 2004/02/24 17:06:52 markus Exp $ +# $OpenBSD: ssh-com.sh,v 1.8 2013/05/17 00:37:40 dtucker Exp $ # Placed in the Public Domain. tid="connect to ssh.com server" @@ -70,7 +70,7 @@ done # convert and append DSA hostkey ( - echo -n 'ssh2-localhost-with-alias,127.0.0.1,::1 ' + printf 'ssh2-localhost-with-alias,127.0.0.1,::1 ' ${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub ) >> $OBJ/known_hosts diff --git a/regress/usr.bin/ssh/test-exec.sh b/regress/usr.bin/ssh/test-exec.sh index a278168bc23..f2e2c0f8d3e 100644 --- a/regress/usr.bin/ssh/test-exec.sh +++ b/regress/usr.bin/ssh/test-exec.sh @@ -1,4 +1,4 @@ -# $OpenBSD: test-exec.sh,v 1.40 2013/04/07 02:16:03 dtucker Exp $ +# $OpenBSD: test-exec.sh,v 1.41 2013/05/17 00:37:40 dtucker Exp $ # Placed in the Public Domain. USER=`id -un` @@ -198,7 +198,7 @@ fail () fatal () { save_debug_log "FATAL: $@" - echo -n "FATAL: " + printf "FATAL: " fail "$@" cleanup exit $RESULT @@ -274,7 +274,7 @@ for t in rsa rsa1; do # known hosts file for client ( - echo -n 'localhost-with-alias,127.0.0.1,::1 ' + printf 'localhost-with-alias,127.0.0.1,::1 ' cat $OBJ/$t.pub ) >> $OBJ/known_hosts |