Bug 132973 - Timeout option not working when SIGALRM blocked
Summary: Timeout option not working when SIGALRM blocked
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: nc   
(Show other bugs)
Version: 2
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Radek Vokal
QA Contact: Ben Levenson
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-09-20 15:31 UTC by Florin Malita
Modified: 2007-11-30 22:10 UTC (History)
0 users

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


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

Description Florin Malita 2004-09-20 15:31:21 UTC
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 15:34:30 UTC
Created attachment 104018 [details]
Unblock SIGALRM

Comment 2 Radek Vokal 2004-09-21 08:41:09 UTC
Fixed in nc-1.10-22


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