diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2021-08-08 06:38:33 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2021-08-08 17:19:56 +1000 |
commit | f0aca2706c710a0da1a4be705f825a807cd15400 (patch) | |
tree | bcf02ddc8b38eae4258d3f3d791651c27152cfe4 /regress/test-exec.sh | |
parent | cf27810a649c5cfae60f8ce66eeb25caa53b13bc (diff) | |
download | openssh-git-f0aca2706c710a0da1a4be705f825a807cd15400.tar.gz |
upstream: Drop -q in ssh-log-wrapper.sh to preserve logs.
scp and sftp like to add -q to the command line passed to ssh which
overrides the LogLevel we set in the config files and suppresses output
to the debug logs so drop any "-q" from the invoked ssh. In the one
case where we actually want to use -q in the banner test, call the ssh
binary directly bypassing the logging wrapper.
OpenBSD-Regress-ID: e2c97d3c964bda33a751374c56f65cdb29755b75
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index 706c532b..67136ab6 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh @@ -1,4 +1,4 @@ -# $OpenBSD: test-exec.sh,v 1.82 2021/06/10 09:37:59 dtucker Exp $ +# $OpenBSD: test-exec.sh,v 1.84 2021/08/08 06:38:33 dtucker Exp $ # Placed in the Public Domain. #SUDO=sudo @@ -254,10 +254,15 @@ fi >$TEST_REGRESS_LOGFILE # Create wrapper ssh with logging. We can't just specify "SSH=ssh -E..." -# because sftp and scp don't handle spaces in arguments. +# because sftp and scp don't handle spaces in arguments. scp and sftp like +# to use -q so we remove those to preserve our debug logging. In the rare +# instance where -q is desirable -qq is equivalent and is not removed. SSHLOGWRAP=$OBJ/ssh-log-wrapper.sh -echo "#!/bin/sh" > $SSHLOGWRAP -echo "exec ${SSH} -E${TEST_SSH_LOGFILE} "'"$@"' >>$SSHLOGWRAP +cat >$SSHLOGWRAP <<EOD +#!/bin/sh +for i; do shift; case "\$i" in -q) :;; *) set -- "\$@" "\$i";; esac; done +exec ${SSH} -E${TEST_SSH_LOGFILE} "\$@" +EOD chmod a+rx $OBJ/ssh-log-wrapper.sh REAL_SSH="$SSH" |