[openssh-commits] [openssh] 02/02: upstream: Only try to chown logfiles that exist to prevent spurious

git+noreply at mindrot.org git+noreply at mindrot.org
Sun Oct 29 21:18:52 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 1d6a878ceba60b9dc14037dddc8f036070c0065f
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Sun Oct 29 06:22:07 2023 +0000

    upstream: Only try to chown logfiles that exist to prevent spurious
    
    errors.
    
    OpenBSD-Regress-ID: f1b20a476734e885078c481f1324c9ea03af991e
---
 regress/test-exec.sh | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 928aaf2f..5b2f2938 100644
--- a/regress/test-exec.sh
+++ b/regress/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
@@ -502,10 +502,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

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list