Skip to content

Commit 32a2797

Browse files
authored
Merge pull request #2472 from Tazmaniac/zombies-fix-3.2
Fix subshell killing to avoid zombies
2 parents 19607d7 + af20952 commit 32a2797

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

testssl.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -17083,11 +17083,12 @@ run_renego() {
1708317083
(for ((i=0; i < ssl_reneg_attempts; i++ )); do echo R; sleep $ssl_reneg_wait; done) | \
1708417084
$OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI") >$TMPFILE 2>>$ERRFILE &
1708517085
pid=$!
17086-
( sleep $(($ssl_reneg_attempts*3)) && kill $pid && touch $TEMPDIR/was_killed ) >&2 2>/dev/null &
17086+
( sleep $(($ssl_reneg_attempts*3)) && pkill -HUP -P $pid && wait $pid && touch $TEMPDIR/was_killed ) >&2 2>/dev/null &
1708717087
watcher=$!
1708817088
# Trick to get the return value of the openssl command, output redirection and a timeout. Yes, some target hang/block after some tries.
17089-
wait $pid && pkill -HUP -P $watcher
17089+
wait $pid && pkill -HUP -P $watcher
1709017090
tmp_result=$?
17091+
wait $watcher
1709117092
# If we are here, we have done two successful renegotiation (-2) and do the loop
1709217093
loop_reneg=$(($(grep -ac '^RENEGOTIATING' $ERRFILE )-2))
1709317094
if [[ -f $TEMPDIR/was_killed ]]; then

0 commit comments

Comments
 (0)