Bug 170591 - nc does not accept port names when using timeout option (nc: port range not valid)
nc does not accept port names when using timeout option (nc: port range not v...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: nc (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-13 04:22 EDT by Bernhard Erdmann
Modified: 2007-11-30 17:11 EST (History)
0 users

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


Attachments (Terms of Use)

  None (edit)
Description Bernhard Erdmann 2005-10-13 04:22:51 EDT
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 Vokal 2005-10-18 04:43:21 EDT
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.