From 355e536d27f325a36aaec5a0145f8deafdc1813f Mon Sep 17 00:00:00 2001 From: dtucker Date: Sun, 29 Oct 2023 06:22:07 +0000 Subject: [PATCH] Only try to chown logfiles that exist to prevent spurious errors. --- regress/usr.bin/ssh/test-exec.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/regress/usr.bin/ssh/test-exec.sh b/regress/usr.bin/ssh/test-exec.sh index 3ee5f636d7e..4ccefe7e3eb 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.101 2023/10/20 07:37:07 dtucker Exp $ +# $OpenBSD: test-exec.sh,v 1.102 2023/10/29 06:22:07 dtucker Exp $ # Placed in the Public Domain. #SUDO=sudo @@ -316,10 +316,12 @@ save_debug_log () testname=`echo $tid | tr ' ' _` tarname="$OBJ/failed-$testname-logs.tar" - if [ ! -z "$SUDO" ] ; then - $SUDO chown -R $USER $TEST_SSH_LOGDIR $TEST_REGRESS_LOGFILE \ - $TEST_SSH_LOGFILE $TEST_SSHD_LOGFILE - fi + for logfile in $TEST_SSH_LOGDIR $TEST_REGRESS_LOGFILE \ + $TEST_SSH_LOGFILE $TEST_SSHD_LOGFILE; do + if [ ! -z "$SUDO" ] && [ -f "$logfile" ]; then + $SUDO chown -R $USER $logfile + fi + done echo $@ >>$TEST_REGRESS_LOGFILE echo $@ >>$TEST_SSH_LOGFILE echo $@ >>$TEST_SSHD_LOGFILE -- 2.20.1