Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-release-src > by-pkgid > 86d02c6716e421acdde40e1f95bd1d59 > files > 21

netcat-traditional-1.10-40.mga6.src.rpm

Summary: Print connection-refused message.
Contributor: Decklin Foster <decklin@red-bean.com>

Index: netcat-1.10/netcat.c
===================================================================
--- netcat-1.10.orig/netcat.c	2006-03-24 12:26:37.000000000 -0500
+++ netcat-1.10/netcat.c	2006-03-24 12:26:39.000000000 -0500
@@ -1640,8 +1640,16 @@
 /* if we're scanning at a "one -v" verbosity level, don't print refusals.
    Give it another -v if you want to see everything. */
 	if ((Single || (o_verbose > 1)) || (errno != ECONNREFUSED))
+	{
+	  /* bug 65413 - if we're not scanning, (and if we're not doing
+	   * zero-io! see bug 247895) we always want an error to be printed
+	   * for refused connects. This is a disgustingly ugly way to do it;
+	   * I really should just rewrite the holler() interface... */
+	  if (Single && !o_zero) o_verbose++;
 	  holler ("%s [%s] %d (%s)",
 	    whereto->name, whereto->addrs[0], curport, portpoop->name);
+	  if (Single && !o_zero) o_verbose--;
+	}
       } /* if netfd */
       close (netfd);			/* just in case we didn't already */
       if (o_interval)