diff options
author | 2017-01-23 22:03:46 +0000 | |
---|---|---|
committer | 2017-01-23 22:03:46 +0000 | |
commit | e7a58ceaf74aeb3ddb7ab465584068d8a0e08dbd (patch) | |
tree | f932cc6d0fb4616bd51a43870ce2cedbfef190c4 | |
parent | The function raw_input() has not been called since netiso has been (diff) | |
download | wireguard-openbsd-e7a58ceaf74aeb3ddb7ab465584068d8a0e08dbd.tar.xz wireguard-openbsd-e7a58ceaf74aeb3ddb7ab465584068d8a0e08dbd.zip |
When run as root, fstat prints the pcb pointer instead of 0x0.
Force netcat and ftp to use IPv4. Unset ftp proxy environment.
-rw-r--r-- | regress/usr.bin/ftp/redirect.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/regress/usr.bin/ftp/redirect.sh b/regress/usr.bin/ftp/redirect.sh index 83a7a1b1031..2d6590ebeb0 100644 --- a/regress/usr.bin/ftp/redirect.sh +++ b/regress/usr.bin/ftp/redirect.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: redirect.sh,v 1.3 2017/01/19 08:41:50 beck Exp $ +# $OpenBSD: redirect.sh,v 1.4 2017/01/23 22:03:46 bluhm Exp $ : ${FTP:=ftp} @@ -13,16 +13,19 @@ req2=$3 echo "Testing $req1 => $loc => $req2" # Be sure to kill any previous nc running on our port -while pkill -fx "nc -l $rport1" && sleep 1; do done +while pkill -fx "nc -4 -l $rport1" && sleep 1; do done -echo "HTTP/1.0 302 Found\r\nLocation: $loc\r\n\r" | nc -l $rport1 >/dev/null & +echo "HTTP/1.0 302 Found\r\nLocation: $loc\r\n\r" | \ + nc -4 -l $rport1 >/dev/null & # Wait for the "server" to start -until fstat | egrep 'nc[ ]+.*tcp 0x0 \*:9000' > /dev/null; do +until fstat | egrep 'nc[ ]+.*tcp 0x[0-9a-f]* \*:9000' > /dev/null; do sleep .1 done -res=$(${FTP} -o/dev/null $req1 2>&1 | sed '/^Redirected to /{s///;x;};$!d;x') +unset ftp_proxy + +res=$(${FTP} -4 -o/dev/null $req1 2>&1 | sed '/^Redirected to /{s///;x;};$!d;x') if [ X"$res" != X"$req2" ]; then echo "*** Fail; expected \"$req2\", got \"$res\"" |