Corrected printf format for type socklen_t in two places; minor corrs in test.sh

This commit is contained in:
Gerhard Rieger 2022-10-30 15:50:44 +01:00
parent 2882ac6976
commit db80b7752a
4 changed files with 15 additions and 14 deletions

View file

@ -44,6 +44,8 @@ Corrections:
always the signal handler messages socket pair open. This fix avoids always the signal handler messages socket pair open. This fix avoids
this socketpair in standalone Filan. this socketpair in standalone Filan.
Corrected printf format for type socklen_t in two places.
Porting: Porting:
OpenSSL, at least 1.1 on Ubuntu, crashed with SIGSEGV under certain OpenSSL, at least 1.1 on Ubuntu, crashed with SIGSEGV under certain
conditions: client connection to server with certificate with empty 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 UNIX_TO_FILE UNIX_TO_ORPHANED GOPEN_TO_DENIED GOPEN_TO_DIRECTORY
GOPEN_TO_ORPHANED GOPEN_TO_ORPHANED
On RHEL-9 and Ubuntu-22.04 there is SCTP support for development but On RHEL-9 SCTP support requires installation of package
not in kernel. test.sh now detects this situation and reacts with kernel-modules-extra. test.sh now detects when SCTP is missing in
warnings. kernel and reacts with warnings instead of errors.
VSOCK loopback still does not seem to work even in kernel 5.13, so just VSOCK loopback still does not seem to work even in kernel 5.13, so just
issue warning on "No such device". issue warning on "No such device".

View file

@ -266,7 +266,7 @@ int sockname(int fd, FILE *outfile, char style) {
#else #else
"SO_PROTOTYPE" "SO_PROTOTYPE"
#endif #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; proto = 0;
#endif /* defined(SO_PROTOCOL) || defined(SO_PROTOTYPE) */ #endif /* defined(SO_PROTOCOL) || defined(SO_PROTOTYPE) */

17
test.sh
View file

@ -13910,7 +13910,7 @@ da="test$N $(date) $RANDOM"
CMD0="$TRACE $SOCAT $opts -u FILE:$td/ab\"cd FILE:/dev/null" CMD0="$TRACE $SOCAT $opts -u FILE:$td/ab\"cd FILE:/dev/null"
printf "test $F_n $TEST... " $N printf "test $F_n $TEST... " $N
$CMD0 >/dev/null 2>"${te}0" $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" $PRINTF "$OK\n"
if [ "$VERBOSE" ]; then echo "$CMD0" >&2; fi if [ "$VERBOSE" ]; then echo "$CMD0" >&2; fi
if [ "$debug" ]; then cat ${te} >&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 ;; denied) pid0=; rm -f $ts; touch $ts; chmod 000 $ts ;;
directory) pid0=; mkdir -p $ts ;; directory) pid0=; mkdir -p $ts ;;
orphaned) pid0= # the remainder of a UNIX socket in FS 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 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 ;; file) pid0=; rm -f $ts; touch $ts ;;
stream) CMD0="$SOCAT $opts UNIX-LISTEN:$ts /dev/null" 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=$! ;; pid0=$! ;;
dgram) CMD0="$SOCAT $opts -u UNIX-RECV:$ts /dev/null" 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=$! ;; pid0=$! ;;
seqpacket) CMD0="$SOCAT $opts UNIX-LISTEN:$ts,socktype=$SOCK_SEQPACKET= /dev/null" seqpacket) CMD0="$SOCAT $opts UNIX-LISTEN:$ts,socktype=$SOCK_SEQPACKET /dev/null"
$CMD0 >${tf}0 2>${te}0 & SOCAT_MAIN_WAIT= $CMD0 >${tf}0 2>${te}0 &
pid0=$! ;; pid0=$! ;;
esac esac
[ "$pid0" ] && waitunixport $ts 1 [ "$pid0" ] && waitunixport $ts 1
@ -15628,8 +15628,7 @@ TEST="$NAME: capability to display symlink target"
if ! eval $NUMCOND; then :; else if ! eval $NUMCOND; then :; else
tf="$td/test$N.file" tf="$td/test$N.file"
tl="$td/test$N.symlink" tl="$td/test$N.symlink"
te1="$td/test$N.stderr1" # socat te="$td/test$N.stderr"
te2="$td/test$N.stderr2" # filan
printf "test $F_n $TEST... " $N printf "test $F_n $TEST... " $N
touch "$tf" touch "$tf"
ln -s "$tf" "$tl" ln -s "$tf" "$tl"

View file

@ -286,7 +286,7 @@ static int xioopen_unix_connect(int argc, const char *argv[], struct opt *opts,
if (result != 0) { if (result != 0) {
char infobuff[256]; char infobuff[256];
/* we caller must handle this */ /* 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)), sockaddr_info((struct sockaddr *)&them, themlen, infobuff, sizeof(infobuff)),
themlen, strerror(errno)); themlen, strerror(errno));
} }