Under certain circumstances, options of the first address were applied to the second address

This commit is contained in:
Gerhard Rieger 2019-12-30 10:27:46 +01:00
parent 420835bf2a
commit 5ebf36038f
3 changed files with 41 additions and 1 deletions

View file

@ -5,6 +5,12 @@ Corrections:
Thanks to Joe Strout and others for reporting this bug. Thanks to Joe Strout and others for reporting this bug.
Thanks to Andrew Childs and others for sending a patch. Thanks to Andrew Childs and others for sending a patch.
Under certain circumstances, termios options of the first address were
applied to the second address, resulting in error
"Inappropriate ioctl for device"
This affected version 1.7.3.3 only.
Thanks to Ivan J. for reporting this issue.
####################### V 1.7.3.3: ####################### V 1.7.3.3:
Corrections: Corrections:

34
test.sh
View file

@ -13027,6 +13027,40 @@ esac
N=$((N+1)) N=$((N+1))
# test for a bug in Socat version 1.7.3.3 where
# termios options of the first address were applied to the second address.
NAME=TERMIOS_PH_ALL
case "$TESTS" in
*%$N%*|*%functions%*|*%bugs%*|*%termios%*|*%$NAME%*)
TEST="$NAME: are termios options applied to the correct address"
# add a termios option to the first address, a tty, and have a second address
# with pipe. If no error occurs the termios option was not applied to the pipe,
# thus the test succeeded.
if ! eval $NUMCOND; then :; else
tf="$td/test$N.stdout"
te="$td/test$N.stderr"
tdiff="$td/test$N.diff"
da="test$N $(date) $RANDOM"
CMD0="$TRACE $SOCAT $opts -T 1 STDIO,echo=0 EXEC:cat"
printf "test $F_n $TEST... " $N
$CMD0 2>"${te}0"
rc0=$?
if [ $rc0 -eq 0 ]; then
$PRINTF "$OK\n"
numOK=$((numOK+1))
else
$PRINTF "$FAILED\n"
echo "$CMD0"
numFAIL=$((numFAIL+1))
listFAIL="$listFAIL $N"
fi
fi # NUMCOND
;;
esac
PORT=$((PORT+1))
N=$((N+1))
################################################################################## ##################################################################################
#================================================================================= #=================================================================================
# here come tests that might affect your systems integrity. Put normal tests # here come tests that might affect your systems integrity. Put normal tests

View file

@ -3581,7 +3581,7 @@ int applyopts(int fd, struct opt *opts, enum e_phase phase) {
} }
#if WITH_TERMIOS #if WITH_TERMIOS
if (phase == PH_FD) { if (phase == PH_FD || phase == PH_ALL) {
xiotermios_flush(fd); xiotermios_flush(fd);
} }
#endif /* WITH_TERMIOS */ #endif /* WITH_TERMIOS */