Bug 1243773 - nc (nmap-ncat) does not support -z option
Summary: nc (nmap-ncat) does not support -z option
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: nmap
Version: 22
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-16 09:35 UTC by Jakub Vavra
Modified: 2021-03-18 12:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-04 09:46:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jakub Vavra 2015-07-16 09:35:04 UTC
Description of problem:
nc no longer supports -z switch as before.

 -z      Specifies that nc should just scan for listening daemons, without
             sending any data to them.  It is an error to use this option in
             conjunction with the -l option.

This introduces random incompatibility (for example Bug 891109) as nc is used like in scripts to verify that port is open.
Nc is used as it is a tool that is usually present on the system and can be used by unprivileged user.


Version-Release number of selected component (if applicable):

nmap-ncat-2:6.47-2.fc22.x86_64 : Nmap's Netcat replacement

How reproducible:
always

Steps to Reproduce:
1. run nc -zv <machine> <port>


Actual results:
$ nc -zv localhost 2222
nc: invalid option -- 'z'
Ncat: Try `--help' or man(1) ncat for more information, usage options and help. QUITTING.


Expected results:
$ nc -zv localhost 22
Connection to localhost 22 port [tcp/ssh] succeeded!

or 

$ nc -zv localhost 666
nc: connect to localhost port 666 (tcp) failed: Connection refused


Additional info:
Maybe, if the replacement for nc is is incomplete, until it is finished the original package should be put back at least as an optional package that can be installed and configured using update-alternatives.

Comment 1 Michal Hlavinka 2015-09-04 09:46:03 UTC
(In reply to Jakub Vavra from comment #0)
> Description of problem:
> nc no longer supports -z switch as before.
> 
>  -z      Specifies that nc should just scan for listening daemons, without
>              sending any data to them.  It is an error to use this option in
>              conjunction with the -l option.

This was discussed some time ago. This change won't be accepted upstream. If you want to test open ports, you should use nmap

> Additional info:
> Maybe, if the replacement for nc is is incomplete, until it is finished 

ncat is "finished", it is not a drop-in replacement and never will be

> the original package should be put back at least as an optional package that can
> be installed and configured using update-alternatives.

It does not depend on me. You'd have to find someone willing to maintain nc. Then I can remove the nc->ncat link so it won't conflict with it. I won't argue :)


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