docs/142243: Netcat (nc(1)) manual mistake

Yasir yasir27 at mail.ru
Sat Jan 2 15:10:05 UTC 2010


>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 at 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:



More information about the freebsd-doc mailing list