[openssh-commits] [openssh] 01/01: Actually skip pty tests when needed.

git+noreply at mindrot.org git+noreply at mindrot.org
Wed May 13 15:25:42 AEST 2020


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit f700d316c6b15a9cfbe87230d2dca81a5d916279
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Wed May 13 15:24:51 2020 +1000

    Actually skip pty tests when needed.
---
 regress/key-options.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/regress/key-options.sh b/regress/key-options.sh
index 112c9bd8..097f46eb 100644
--- a/regress/key-options.sh
+++ b/regress/key-options.sh
@@ -7,6 +7,12 @@ origkeys="$OBJ/authkeys_orig"
 authkeys="$OBJ/authorized_keys_${USER}"
 cp $authkeys $origkeys
 
+# Allocating ptys can require privileges on some platforms.
+skip_pty=""
+if ! config_defined HAVE_OPENPTY && [ "x$SUDO" == "x" ]; then
+	skip_pty="no openpty(3) and SUDO not set"
+fi
+
 # Test command= forced command
 for c in 'command="echo bar"' 'no-pty,command="echo bar"'; do
 	sed "s/.*/$c &/" $origkeys >$authkeys
@@ -27,7 +33,7 @@ expect_pty_succeed() {
 	rm -f $OBJ/data
 	sed "s/.*/$opts &/" $origkeys >$authkeys
 	verbose "key option pty $which"
-	config_defined HAVE_OPENPTY || verbose "skipped for no openpty(3)"
+	[ "x$skip_pty" != "x" ] && verbose "skipped because $skip_pty" && return
 	${SSH} -ttq -F $OBJ/ssh_proxy somehost "tty > $OBJ/data; exit 0"
 	if [ $? -ne 0 ] ; then
 		fail "key option failed $which"
@@ -45,7 +51,7 @@ expect_pty_fail() {
 	rm -f $OBJ/data
 	sed "s/.*/$opts &/" $origkeys >$authkeys
 	verbose "key option pty $which"
-	config_defined HAVE_OPENPTY || verbose "skipped for no openpty(3)"
+	[ "x$skip_pty" != "x" ] && verbose "skipped because $skip_pty" && return
 	${SSH} -ttq -F $OBJ/ssh_proxy somehost "tty > $OBJ/data; exit 0"
 	if [ $? -eq 0 ]; then
 		r=`cat $OBJ/data`

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


More information about the openssh-commits mailing list