Bug 4345 - netcat: wrong program name in usage text
: netcat: wrong program name in usage text
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/netcat)
: unstable
: all Linux
: P2 minor
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2004-06-11 15:03 by
Modified: 2009-05-10 09:32 (History)


Attachments


Note

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


Description From 2004-06-11 15:03:30
$ netcat
usage: nc [-46Uhklnrtuvz] [-i interval] [-p source port]
          [-s ip address] [-w timeout] [-X vers] [-x proxy address [:port]]
          [hostname] [port[s...]]

Такая вот постенькая бага, лечится элементарно патчем:
--- nc-3.2/usr.bin/nc/netcat.c.orig     2004-06-11 15:02:06 +0400
+++ nc-3.2/usr.bin/nc/netcat.c  2004-06-11 15:02:13 +0400
@@ -76,6 +76,8 @@
 int family = AF_INET;
 char *portlist[PORT_MAX];
 
+char *progname;
+
 ssize_t        atomicio(ssize_t (*)(), int, void *, size_t);
 void   atelnet(int, unsigned char *, unsigned int);
 void   build_ports(char *);
@@ -103,6 +105,8 @@
        char *proxyhost = "", *proxyport = NULL;
        struct addrinfo proxyhints;
 
+       progname=argv[0];
+
        ret = 1;
        s = 0;
        socksv = 5;
@@ -756,7 +760,7 @@
 void
 usage(int ret)
 {
-       fprintf(stderr, "usage: nc [-46Uhklnrtuvz] [-i interval] [-p source
port]\n");
+       fprintf(stderr, "usage: %s [-46Uhklnrtuvz] [-i interval] [-p source
port]\n", progname);
        fprintf(stderr, "\t  [-s ip address] [-w timeout] [-X vers] [-x proxy
address [:port]]\n");
        fprintf(stderr, "\t  [hostname] [port[s...]]\n");
        if (ret)
------- Comment #1 From 2004-06-27 04:04:41 -------
Исправить надо, но не таким патчем.
------- Comment #2 From 2004-07-02 18:14:41 -------
Fixed in netcat-3.2-alt2