mirror of
https://repo.or.cz/socat.git
synced 2024-12-22 23:42:34 +00:00
end-close "did not apply" to some addresses
This commit is contained in:
parent
de4f373bd5
commit
7b61382c76
6 changed files with 47 additions and 11 deletions
4
CHANGES
4
CHANGES
|
@ -1,4 +1,8 @@
|
|||
|
||||
corrections:
|
||||
option end-close "did not apply" to addresses PTY, SOCKET-CONNECT,
|
||||
and most UNIX-* and ABSTRACT-*
|
||||
|
||||
####################### V 1.7.0.0:
|
||||
|
||||
new features:
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
"1.7.0.0"
|
||||
"1.7.0.0+endclose"
|
||||
|
|
33
test.sh
33
test.sh
|
@ -1,6 +1,6 @@
|
|||
#! /bin/bash
|
||||
# source: test.sh
|
||||
# Copyright Gerhard Rieger 2001-2008
|
||||
# Copyright Gerhard Rieger 2001-2009
|
||||
# Published under the GNU General Public License V.2, see file COPYING
|
||||
|
||||
# perform lots of tests on socat
|
||||
|
@ -7483,6 +7483,37 @@ esac
|
|||
N=$((N+1))
|
||||
|
||||
|
||||
# up to 1.7.0.0 option end-close led to an error with some address types due to
|
||||
# bad internal handling. here we check it for address PTY
|
||||
NAME=PTYENDCLOSE
|
||||
case "$TESTS" in
|
||||
*%functions%*|*%bugs%*|*%pty%*|*%$NAME%*)
|
||||
TEST="$NAME: PTY handles option end-close"
|
||||
# with the bug, socat exits with error. we invoke socat in a no-op mode and
|
||||
# check its return status.
|
||||
if ! eval $NUMCOND; then :;
|
||||
else
|
||||
tf="$td/test$N.stout"
|
||||
te="$td/test$N.stderr"
|
||||
CMD="$SOCAT $opts /dev/null pty,end-close"
|
||||
printf "test $F_n $TEST... " $N
|
||||
$CMD 2>"${te}"
|
||||
rc=$?
|
||||
if [ "$rc" = 0 ]; then
|
||||
$PRINTF "$OK\n"
|
||||
numOK=$((numOK+1))
|
||||
else
|
||||
$PRINTF "$FAILED\n"
|
||||
echo "$CMD"
|
||||
cat "${te}"
|
||||
numFAIL=$((numFAIL+1))
|
||||
fi
|
||||
fi # NUMCOND
|
||||
;;
|
||||
esac
|
||||
N=$((N+1))
|
||||
|
||||
|
||||
NAME=UDP6LISTENBIND
|
||||
# this tests for a bug in (up to) 1.5.0.0:
|
||||
# with udp*-listen, the bind option supported only IPv4
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* source: xio-pty.c */
|
||||
/* Copyright Gerhard Rieger 2002-2008 */
|
||||
/* Copyright Gerhard Rieger 2002-2009 */
|
||||
/* Published under the GNU General Public License V.2, see file COPYING */
|
||||
|
||||
/* this file contains the source for creating pty addresses */
|
||||
|
@ -49,8 +49,8 @@ static int xioopen_pty(int argc, const char *argv[], struct opt *opts, int xiofl
|
|||
|
||||
xfd->stream.howtoend = END_CLOSE;
|
||||
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
if (applyopts_single(&xfd->stream, opts, PH_INIT) < 0) return -1;
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
|
||||
retropt_bool(opts, OPT_UNLINK_CLOSE, &opt_unlink_close);
|
||||
|
||||
|
@ -82,8 +82,8 @@ static int xioopen_pty(int argc, const char *argv[], struct opt *opts, int xiofl
|
|||
retropt_timespec(opts, OPT_PTY_INTERVALL, &pollintv);
|
||||
#endif /* HAVE_POLL */
|
||||
|
||||
applyopts2(-1, opts, PH_INIT, PH_EARLY);
|
||||
if (applyopts_single(&xfd->stream, opts, PH_INIT) < 0) return -1;
|
||||
applyopts2(-1, opts, PH_INIT, PH_EARLY);
|
||||
|
||||
applyopts(-1, opts, PH_PREBIGEN);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* source: xio-socket.c */
|
||||
/* Copyright Gerhard Rieger 2001-2008 */
|
||||
/* Copyright Gerhard Rieger 2001-2009 */
|
||||
/* Published under the GNU General Public License V.2, see file COPYING */
|
||||
|
||||
/* this file contains the source for socket related functions, and the
|
||||
|
@ -237,8 +237,8 @@ int xioopen_socket_connect(int argc, const char *argv[], struct opt *opts,
|
|||
/*retropt_int(opts, OPT_IP_PROTOCOL, &proto);*/
|
||||
xfd->howtoend = END_SHUTDOWN;
|
||||
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
if (applyopts_single(xfd, opts, PH_INIT) < 0) return -1;
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
applyopts(-1, opts, PH_EARLY);
|
||||
|
||||
themlen = 0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* source: xio-unix.c */
|
||||
/* Copyright Gerhard Rieger 2001-2008 */
|
||||
/* Copyright Gerhard Rieger 2001-2009 */
|
||||
/* Published under the GNU General Public License V.2, see file COPYING */
|
||||
|
||||
/* this file contains the source for opening addresses of UNIX socket type */
|
||||
|
@ -155,6 +155,7 @@ static int xioopen_unix_listen(int argc, const char *argv[], struct opt *opts, i
|
|||
}
|
||||
}
|
||||
|
||||
if (applyopts_single(xfd, opts, PH_INIT) < 0) return STAT_NORETRY;
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
applyopts(-1, opts, PH_EARLY);
|
||||
|
||||
|
@ -227,8 +228,8 @@ static int xioopen_unix_connect(int argc, const char *argv[], struct opt *opts,
|
|||
xfd->opt_unlink_close = true;
|
||||
}
|
||||
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
if (applyopts_single(xfd, opts, PH_INIT) < 0) return -1;
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
applyopts(-1, opts, PH_EARLY);
|
||||
|
||||
if ((result =
|
||||
|
@ -290,8 +291,8 @@ static int xioopen_unix_sendto(int argc, const char *argv[], struct opt *opts, i
|
|||
xfd->opt_unlink_close = true;
|
||||
}
|
||||
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
if (applyopts_single(xfd, opts, PH_INIT) < 0) return -1;
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
|
||||
return
|
||||
_xioopen_dgram_sendto(needbind?&us:NULL, uslen,
|
||||
|
@ -463,8 +464,8 @@ _xioopen_unix_client(xiosingle_t *xfd, int xioflags, unsigned groups,
|
|||
struct opt *opts0;
|
||||
int result;
|
||||
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
if (applyopts_single(xfd, opts, PH_INIT) < 0) return -1;
|
||||
applyopts(-1, opts, PH_INIT);
|
||||
|
||||
xfd->howtoend = END_SHUTDOWN;
|
||||
retropt_socket_pf(opts, &pf);
|
||||
|
|
Loading…
Reference in a new issue