Red Hat Bugzilla – Bug 132973
Timeout option not working when SIGALRM blocked
Last modified: 2007-11-30 17:10:49 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20040914
Description of problem:
The timeout option (-w) relies on SIGALRM being delivered so if for
some reason that signal is blocked it will simply not work.
It bit me when using nc in a piranha/nanny external script: apparently
nanny blocks SIGALRM before executing the script so nc can hang for a
long time trying to connect despite the timeout option.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. launch nc with SIGALRM blocked, a short timeout (-w 2) and an
Actual Results: nc hangs for a long time, until the connect() call
Expected Results: nc should have timed out after the specified interval.
This is pretty straightforward to fix: just unblock SIGALRM - see patch.
Created attachment 104018 [details]
Fixed in nc-1.10-22