Darren Tucker | 59d928d | 2013-05-17 15:32:29 +1000 | [diff] [blame] | 1 | # $OpenBSD: stderr-after-eof.sh,v 1.2 2013/05/17 04:29:14 dtucker Exp $ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="stderr data after eof" |
| 5 | |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 6 | # setup data |
| 7 | rm -f ${DATA} ${COPY} |
| 8 | cp /dev/null ${DATA} |
| 9 | for i in 1 2 3 4 5 6; do |
Darren Tucker | f8d5b34 | 2013-05-17 19:53:25 +1000 | [diff] [blame] | 10 | (date;echo $i) | md5 >> ${DATA} |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 11 | done |
| 12 | |
| 13 | ${SSH} -2 -F $OBJ/ssh_proxy otherhost \ |
| 14 | exec sh -c \'"exec > /dev/null; sleep 2; cat ${DATA} 1>&2 $s"\' \ |
| 15 | 2> ${COPY} |
| 16 | r=$? |
| 17 | if [ $r -ne 0 ]; then |
| 18 | fail "ssh failed with exit code $r" |
| 19 | fi |
| 20 | egrep 'Disconnecting: Received extended_data after EOF' ${COPY} && |
| 21 | fail "ext data received after eof" |
| 22 | cmp ${DATA} ${COPY} || fail "stderr corrupt" |
| 23 | |
| 24 | rm -f ${DATA} ${COPY} |