Bug 132973 - Timeout option not working when SIGALRM blocked
Timeout option not working when SIGALRM blocked
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: nc (Show other bugs)
2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-09-20 11:31 EDT by Florin Malita
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-21 04:41:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Unblock SIGALRM (810 bytes, patch)
2004-09-20 11:34 EDT, Florin Malita
no flags Details | Diff

  None (edit)
Description Florin Malita 2004-09-20 11:31:21 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20040914
Firefox/0.10

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):
nc-1.10-*

How reproducible:
Always

Steps to Reproduce:
1. launch nc with SIGALRM blocked, a short timeout (-w 2) and an
unreachable target
    

Actual Results:  nc hangs for a long time, until the connect() call
bails out.

Expected Results:  nc should have timed out after the specified interval.

Additional info:

This is pretty straightforward to fix: just unblock SIGALRM - see patch.
Comment 1 Florin Malita 2004-09-20 11:34:30 EDT
Created attachment 104018 [details]
Unblock SIGALRM
Comment 2 Radek Vokal 2004-09-21 04:41:09 EDT
Fixed in nc-1.10-22

Note You need to log in before you can comment on or make changes to this bug.