Debian Bug report logs - #10486
nc doesn't understand ports in /etc/services that have a '-' in them

version graph

Package: netcat; Maintainer for netcat is Anibal Monsalve Salazar <anibal@debian.org>; Source for netcat is src:netcat (PTS, buildd, popcon).

Reported by: Chris Fearnley <cjf@netaxs.com>

Date: Tue, 10 Jun 1997 22:03:02 UTC

Severity: normal

Fixed in version netcat/1.10-25

Done: Decklin Foster <decklin@red-bean.com>

Bug is archived. No further changes may be made.

Forwarded to Chris Fearnley <cjf@netaxs.com>, 10486-forwarded@bugs.debian.org, hobbit@avian.org

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Michael Shields <shields@crosslink.net>:
Bug#10486; Package netcat. (full text, mbox, link).


Acknowledgement sent to Chris Fearnley <cjf@netaxs.com>:
New bug report received and forwarded. Copy sent to Michael Shields <shields@crosslink.net>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Chris Fearnley <cjf@netaxs.com>
To: submit@bugs.debian.org
Subject: nc doesn't understand ports in /etc/services that have a '-' in them
Date: Tue, 10 Jun 1997 18:00:16 -0400 (EDT)
Package: netcat
Version: 1.10-3

$ nc -zvv hilda pop-3
invalid port pop
$ nc -vvz hilda re-mail-ck
invalid port mail-ck

But

$ telnet hilda pop-3

works and I connect to qpopper without problems.

$ egrep '(re-mail-ck|pop-3)' /etc/services
re-mail-ck      50/tcp                          # Remote Mail Checking Protocol
re-mail-ck      50/udp                          # Remote Mail Checking Protocol
pop-3           110/tcp                         # POP version 3
pop-3           110/udp

-- 
Christopher J. Fearnley          |  Linux/Internet Consulting
cjf@netaxs.com                   |  Design Science Revolutionary
http://www.netaxs.com/~cjf       |  Explorer in Universe
ftp://ftp.netaxs.com/people/cjf  |  "Dare to be Naive" -- Bucky Fuller


Reply sent to shields@crosslink.net (Michael Shields):
You have marked bug as forwarded. (full text, mbox, link).


Message #8 received at 10486-forwarded@bugs.debian.org (full text, mbox, reply):

From: shields@crosslink.net (Michael Shields)
To: Chris Fearnley <cjf@netaxs.com>, 10486-forwarded@bugs.debian.org, hobbit@avian.org
Subject: Re: Bug#10486: nc doesn't understand ports in /etc/services that have a '-' in them
Date: 19 Jun 1997 22:12:23 -0000
> $ nc -zvv hilda pop-3
> invalid port pop
> $ nc -vvz hilda re-mail-ck
> invalid port mail-ck

This isn't a parsing error, but ambiguous syntax.  The problem is that
netcat treats "pop-3" as a range of ports to scan, "pop" through "3".

The best thing would be to change the delimiter to a slash, but I
don't really want to make a change to the Debian package that makes it
incompatible with the official version.  So I don't know what a good
solution is.
-- 
Shields, CrossLink.


Message #9 received at 10486-forwarded@bugs.debian.org (full text, mbox, reply):

From: Chris Fearnley <cjf@netaxs.com>
To: shields@crosslink.net (Michael Shields)
Cc: cjf@netaxs.com, 10486-forwarded@bugs.debian.org, hobbit@avian.org
Subject: Re: Bug#10486: nc doesn't understand ports in /etc/services that have a '-' in them
Date: Thu, 19 Jun 1997 19:05:02 -0400 (EDT)
'Michael Shields wrote:'
>
>> $ nc -zvv hilda pop-3
>> invalid port pop
>> $ nc -vvz hilda re-mail-ck
>> invalid port mail-ck
>
>This isn't a parsing error, but ambiguous syntax.  The problem is that
>netcat treats "pop-3" as a range of ports to scan, "pop" through "3".
>
>The best thing would be to change the delimiter to a slash, but I
>don't really want to make a change to the Debian package that makes it
>incompatible with the official version.  So I don't know what a good
>solution is.

Aha, how about checking if getservbyname() returns anything reasonable
before interpreting a '-' as a range operator.

-- 
Christopher J. Fearnley          |  Linux/Internet Consulting
cjf@netaxs.com                   |  Design Science Revolutionary
http://www.netaxs.com/~cjf       |  Explorer in Universe
ftp://ftp.netaxs.com/people/cjf  |  "Dare to be Naive" -- Bucky Fuller


Message #10 received at 10486-forwarded@bugs.debian.org (full text, mbox, reply):

From: shields@crosslink.net (Michael Shields)
To: Chris Fearnley <cjf@netaxs.com>
Cc: 10486-forwarded@bugs.debian.org, hobbit@avian.org
Subject: Re: Bug#10486: nc doesn't understand ports in /etc/services that have a '-' in them
Date: 20 Jun 1997 16:17:20 -0000
> Aha, how about checking if getservbyname() returns anything reasonable
> before interpreting a '-' as a range operator.

It would still be ambiguous.  Is `re-mail-ck' to be parsed as "re
through mail-ck" or "re-mail through ck"?  You'd have to iterate
across each possibility (is there a port called re-mail? is there a
port called mail-ck?) and hope it resolves to something non-ambiguous.
-- 
Shields, CrossLink.


Reply sent to Decklin Foster <decklin@red-bean.com>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Chris Fearnley <cjf@netaxs.com>:
Bug acknowledged by developer. (full text, mbox, link).


Message #15 received at 10486-close@bugs.debian.org (full text, mbox, reply):

From: Decklin Foster <decklin@red-bean.com>
To: 10486-close@bugs.debian.org
Subject: Bug#10486: fixed in netcat 1.10-25
Date: Sat, 02 Oct 2004 11:32:05 -0400
Source: netcat
Source-Version: 1.10-25

We believe that the bug you reported is fixed in the latest version of
netcat, which is due to be installed in the Debian FTP archive:

netcat_1.10-25.diff.gz
  to pool/main/n/netcat/netcat_1.10-25.diff.gz
netcat_1.10-25.dsc
  to pool/main/n/netcat/netcat_1.10-25.dsc
netcat_1.10-25_i386.deb
  to pool/main/n/netcat/netcat_1.10-25_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 10486@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Decklin Foster <decklin@red-bean.com> (supplier of updated netcat package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat,  2 Oct 2004 09:54:56 -0400
Source: netcat
Binary: netcat
Architecture: source i386
Version: 1.10-25
Distribution: unstable
Urgency: low
Maintainer: Decklin Foster <decklin@red-bean.com>
Changed-By: Decklin Foster <decklin@red-bean.com>
Description: 
 netcat     - TCP/IP swiss army knife
Closes: 10486 247895
Changes: 
 netcat (1.10-25) unstable; urgency=low
 .
   * Included new example script, ncmeter, by Karsten Köm <koem@petoria.de>.
   * Added patch by Mike Sullivan <msully4321@gmail.com> to allow the use of
     port names containing "-", as long as the dash is escaped with a
     backslash. (e.g. "netcat localhost 'ftp\-data'"). (Closes: #10486)
   * Updated 12_single_verbose to be quiet if -z is on. (Closes: #247895)
Files: 
 ff0c176e3feb9f69f51c898cf4187089 568 net optional netcat_1.10-25.dsc
 7ce761af85e8dcd76c48f07435eeddc7 12891 net optional netcat_1.10-25.diff.gz
 028d368d01c46b25abdbf90b5cd69d99 65100 net optional netcat_1.10-25_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBXrzfuIJGh/GWjRsRAjl6AJwLm6Gof3MpcLN5Jx7peeThBSrpWwCfT8u9
+o6lRaR+TXT4T5l/oo3UEyI=
=nMIC
-----END PGP SIGNATURE-----




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat May 4 15:10:16 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.