]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Don't try to use sudo inside sshd log wrapper.
authordtucker@openbsd.org <dtucker@openbsd.org>
Tue, 31 Oct 2023 04:15:40 +0000 (04:15 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Tue, 31 Oct 2023 04:35:53 +0000 (15:35 +1100)
We still need to check if we're using sudo since we don't want to chown
unecessarily, as on some platforms this causes an error which pollutes
stderr. We also don't want to unnecessarily invoke sudo, since it's
running in the context of the proxycommand, on *other* platforms it
may not be able to authenticate, and if we're using SUDO then it should
already be privileged.

OpenBSD-Regress-ID: 70d58df7503db699de579a9479300e5f3735f4ee

regress/test-exec.sh

index aae90f2430abac4e6cef4e6826fbd762a5f81f43..089ef73c4ebbcd4b71ba54ed124a69facb7818a0 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: test-exec.sh,v 1.104 2023/10/31 02:58:45 dtucker Exp $
+#      $OpenBSD: test-exec.sh,v 1.105 2023/10/31 04:15:40 dtucker Exp $
 #      Placed in the Public Domain.
 
 #SUDO=sudo
@@ -322,7 +322,7 @@ timestamp="\`$OBJ/timestamp\`"
 logfile="${TEST_SSH_LOGDIR}/\${timestamp}.sshd.\$\$.log"
 rm -f $TEST_SSHD_LOGFILE
 touch \$logfile
-test -z "$SUDO" || "$SUDO" chown $USER \$logfile
+test -z "$SUDO" || chown $USER \$logfile
 ln -f -s \${logfile} $TEST_SSHD_LOGFILE
 echo "Executing: ${SSHD} \$@" log \${logfile} >>$TEST_REGRESS_LOGFILE
 echo "Executing: ${SSHD} \$@" >>\${logfile}