mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-31 04:41:15 +01:00
Merge pull request #2472 from Tazmaniac/zombies-fix-3.2
Fix subshell killing to avoid zombies
This commit is contained in:
commit
32a279730f
@ -17083,11 +17083,12 @@ run_renego() {
|
|||||||
(for ((i=0; i < ssl_reneg_attempts; i++ )); do echo R; sleep $ssl_reneg_wait; done) | \
|
(for ((i=0; i < ssl_reneg_attempts; i++ )); do echo R; sleep $ssl_reneg_wait; done) | \
|
||||||
$OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI") >$TMPFILE 2>>$ERRFILE &
|
$OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI") >$TMPFILE 2>>$ERRFILE &
|
||||||
pid=$!
|
pid=$!
|
||||||
( sleep $(($ssl_reneg_attempts*3)) && kill $pid && touch $TEMPDIR/was_killed ) >&2 2>/dev/null &
|
( sleep $(($ssl_reneg_attempts*3)) && pkill -HUP -P $pid && wait $pid && touch $TEMPDIR/was_killed ) >&2 2>/dev/null &
|
||||||
watcher=$!
|
watcher=$!
|
||||||
# Trick to get the return value of the openssl command, output redirection and a timeout. Yes, some target hang/block after some tries.
|
# Trick to get the return value of the openssl command, output redirection and a timeout. Yes, some target hang/block after some tries.
|
||||||
wait $pid && pkill -HUP -P $watcher
|
wait $pid && pkill -HUP -P $watcher
|
||||||
tmp_result=$?
|
tmp_result=$?
|
||||||
|
wait $watcher
|
||||||
# If we are here, we have done two successful renegotiation (-2) and do the loop
|
# If we are here, we have done two successful renegotiation (-2) and do the loop
|
||||||
loop_reneg=$(($(grep -ac '^RENEGOTIATING' $ERRFILE )-2))
|
loop_reneg=$(($(grep -ac '^RENEGOTIATING' $ERRFILE )-2))
|
||||||
if [[ -f $TEMPDIR/was_killed ]]; then
|
if [[ -f $TEMPDIR/was_killed ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user