Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jan 2010 15:04:14 GMT
From:      Yasir <yasir27@mail.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   docs/142243: Netcat (nc(1)) manual mistake
Message-ID:  <201001021504.o02F4EAU016709@www.freebsd.org>
Resent-Message-ID: <201001021510.o02FA4H0088131@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         142243
>Category:       docs
>Synopsis:       Netcat (nc(1)) manual mistake
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 02 15:10:04 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Yasir
>Release:        7.1-RELEASE
>Organization:
>Environment:
FreeBSD conductor.loc 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan  1 14:37:25 UTC 2009     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
man 1 nc states in TALKING TO SERVERS section:
[..]
For example, to retrieve the home page of a web site:

           $ echo -n "GET / HTTP/1.0\r\n\r\n" | nc host.example.com 80
[..]

But this kind of request often returns either nothing or something irrelevant, maybe due to a strong server implementation (e.g. meets RFCs).
>How-To-Repeat:
According to man one could do the following:

           $ echo "GET / HTTP/1.0\r\n\r\n" | nc example.com 80

But nothing is returned upon request.

Another attempt which also fails:
           $ echo "HEAD / HTTP/1.0\r\n\r\n" | nc ya.ru 80
           <html>
           <head><title>400 Bad Request</title></head>
           <body bgcolor="white">
           <center><h1>400 Bad Request</h1></center>
           <hr><center>nginx</center>
           </body>
           </html>
>Fix:
There should have been used printf(1) instead.
Man should be corrected, namely, sed 's/echo -n/printf/'

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001021504.o02F4EAU016709>