diff --git a/CHANGES b/CHANGES index 2bb7622..c096470 100644 --- a/CHANGES +++ b/CHANGES @@ -44,6 +44,8 @@ Corrections: always the signal handler messages socket pair open. This fix avoids this socketpair in standalone Filan. + Corrected printf format for type socklen_t in two places. + Porting: OpenSSL, at least 1.1 on Ubuntu, crashed with SIGSEGV under certain conditions: client connection to server with certificate with empty @@ -128,9 +130,9 @@ Testing: UNIX_TO_FILE UNIX_TO_ORPHANED GOPEN_TO_DENIED GOPEN_TO_DIRECTORY GOPEN_TO_ORPHANED - On RHEL-9 and Ubuntu-22.04 there is SCTP support for development but - not in kernel. test.sh now detects this situation and reacts with - warnings. + On RHEL-9 SCTP support requires installation of package + kernel-modules-extra. test.sh now detects when SCTP is missing in + kernel and reacts with warnings instead of errors. VSOCK loopback still does not seem to work even in kernel 5.13, so just issue warning on "No such device". diff --git a/fdname.c b/fdname.c index 459c083..bc8d629 100644 --- a/fdname.c +++ b/fdname.c @@ -266,7 +266,7 @@ int sockname(int fd, FILE *outfile, char style) { #else "SO_PROTOTYPE" #endif - ", &%p, {"F_Zu"}): errno=%d (%s)", fd, &proto, optlen, errno, strerror(errno)); + ", &%p, {"F_socklen"}): errno=%d (%s)", fd, &proto, optlen, errno, strerror(errno)); } proto = 0; #endif /* defined(SO_PROTOCOL) || defined(SO_PROTOTYPE) */ diff --git a/test.sh b/test.sh index 40a4820..1dfad1f 100755 --- a/test.sh +++ b/test.sh @@ -13910,7 +13910,7 @@ da="test$N $(date) $RANDOM" CMD0="$TRACE $SOCAT $opts -u FILE:$td/ab\"cd FILE:/dev/null" printf "test $F_n $TEST... " $N $CMD0 >/dev/null 2>"${te}0" -if grep -q "syntax error" "${te}0"; then +if grep -q -i -e "syntax error" -e "unexpected end" "${te}0"; then $PRINTF "$OK\n" if [ "$VERBOSE" ]; then echo "$CMD0" >&2; fi if [ "$debug" ]; then cat ${te} >&2; fi @@ -15323,19 +15323,19 @@ case "$entry" in denied) pid0=; rm -f $ts; touch $ts; chmod 000 $ts ;; directory) pid0=; mkdir -p $ts ;; orphaned) pid0= # the remainder of a UNIX socket in FS - $SOCAT $opts UNIX-LISTEN:$ts,unlink-close=0 /dev/null >${tf}0 2>${te}0 & + SOCAT_MAIN_WAIT= $SOCAT $opts UNIX-LISTEN:$ts,unlink-close=0 /dev/null >${tf}0 2>${te}0 & waitunixport $ts 1 - $SOCAT $opts /dev/null UNIX-CONNECT:$ts + SOCAT_MAIN_WAIT= $SOCAT $opts /dev/null UNIX-CONNECT:$ts >>${tf}0 2>>${te}0 ;; file) pid0=; rm -f $ts; touch $ts ;; stream) CMD0="$SOCAT $opts UNIX-LISTEN:$ts /dev/null" - $CMD0 >${tf}0 2>${te}0 & + SOCAT_MAIN_WAIT= $CMD0 >${tf}0 2>${te}0 & pid0=$! ;; dgram) CMD0="$SOCAT $opts -u UNIX-RECV:$ts /dev/null" - $CMD0 >${tf}0 2>${te}0 & + SOCAT_MAIN_WAIT= $CMD0 >${tf}0 2>${te}0 & pid0=$! ;; - seqpacket) CMD0="$SOCAT $opts UNIX-LISTEN:$ts,socktype=$SOCK_SEQPACKET= /dev/null" - $CMD0 >${tf}0 2>${te}0 & + seqpacket) CMD0="$SOCAT $opts UNIX-LISTEN:$ts,socktype=$SOCK_SEQPACKET /dev/null" + SOCAT_MAIN_WAIT= $CMD0 >${tf}0 2>${te}0 & pid0=$! ;; esac [ "$pid0" ] && waitunixport $ts 1 @@ -15628,8 +15628,7 @@ TEST="$NAME: capability to display symlink target" if ! eval $NUMCOND; then :; else tf="$td/test$N.file" tl="$td/test$N.symlink" -te1="$td/test$N.stderr1" # socat -te2="$td/test$N.stderr2" # filan +te="$td/test$N.stderr" printf "test $F_n $TEST... " $N touch "$tf" ln -s "$tf" "$tl" diff --git a/xio-unix.c b/xio-unix.c index 84b6df2..898a83b 100644 --- a/xio-unix.c +++ b/xio-unix.c @@ -286,7 +286,7 @@ static int xioopen_unix_connect(int argc, const char *argv[], struct opt *opts, if (result != 0) { char infobuff[256]; /* we caller must handle this */ - Msg3(level, "connect(, %s, "F_Zd"): %s", + Msg3(level, "connect(, %s, "F_socklen"): %s", sockaddr_info((struct sockaddr *)&them, themlen, infobuff, sizeof(infobuff)), themlen, strerror(errno)); }