Bug 170591 - nc does not accept port names when using timeout option (nc: port range not valid)
Summary: nc does not accept port names when using timeout option (nc: port range not v...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: nc
Version: 4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Radek Vokál
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-10-13 08:22 UTC by Bernhard Erdmann
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-10-18 08:43:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Bernhard Erdmann 2005-10-13 08:22:51 UTC
Description of problem:
netcat does not accept port names instead of port numbers if option "-w" is
used. The commandline parsing seems to be broken. netcat of FC3 did not have
this problem.

Version-Release number of selected component (if applicable):
nc-1.82-fc4.1

How reproducible:
always

Steps to Reproduce:
1. nc mailserver 25
2. nc mailserver smtp
3. nc -w 5 mailserver 25
4. nc -w 5 mailserver smtp
  
Actual results:
1. ok, smtp banner is shown
2. ok, smtp banner is shown
3. ok, smtp banner is shown
4. failure, error "nc: port range not valid"

Expected results:
4. ok, smtp banner is shown

Additional info:

/etc/services:
smtp            25/tcp          mail
smtp            25/udp          mail

/etc/nsswitch.conf:
services:   files

Comment 1 Radek Vokál 2005-10-18 08:43:21 UTC
I'm suprised that this works for you. I don't see a simple line in the code or
in man page that port names should be resolved to port numbers .. 

~# nc mail.localhost smtp
nc: port range not valid
~# nc mail.localhost 25
220 mail.localhost ESMTP Sendmail 8.12.8/8.12.8; Tue, 18 Oct 2005 10:42:37 +0200



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