From da3d68fc3ef5051cf4561a53c835c07cd4c4172f53b76d349fa065cfe2e0a81e Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Thu, 13 Aug 2009 00:21:58 +0000 Subject: [PATCH] Accepting request 17518 from network:utilities Copy from network:utilities/net-tools based on submit request 17518 from user sax2 OBS-URL: https://build.opensuse.org/request/show/17518 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/net-tools?expand=0&rev=20 --- net-tools-1.60-notrim.diff | 98 ++++++++++++++++++++++++++++++++++++++ net-tools.changes | 6 +++ net-tools.spec | 4 +- 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 net-tools-1.60-notrim.diff diff --git a/net-tools-1.60-notrim.diff b/net-tools-1.60-notrim.diff new file mode 100644 index 0000000..9b460a1 --- /dev/null +++ b/net-tools-1.60-notrim.diff @@ -0,0 +1,98 @@ +--- net-tools-1.60/netstat.c 2009-08-12 10:24:54.000000000 +0200 ++++ net-tools-1.60/netstat.c 2009-08-12 10:33:00.000000000 +0200 +@@ -179,6 +179,7 @@ + int flag_arg = 0; + int flag_ver = 0; + int flag_cacheof = 0; ++int flag_trim = 0; + + #define OPT_SCTP 0x100 + +@@ -887,10 +888,10 @@ + snprintf(buffer, sizeof(buffer), "%s", + get_sname(htons(local_port), "tcp", + flag_not & FLAG_NUM_PORT)); +- +- if ((strlen(local_addr) + strlen(buffer)) > 22) +- local_addr[22 - strlen(buffer)] = '\0'; +- ++ if (!flag_trim) { ++ if ((strlen(local_addr) + strlen(buffer)) > 22) ++ local_addr[22 - strlen(buffer)] = '\0'; ++ } + strcat(local_addr, ":"); + strcat(local_addr, buffer); + snprintf(buffer, sizeof(buffer), "%s", +@@ -1038,8 +1039,10 @@ + snprintf(buffer, sizeof(buffer), "%s", + get_sname(htons(local_port), "udp", + flag_not & FLAG_NUM_PORT)); +- if ((strlen(local_addr) + strlen(buffer)) > 22) +- local_addr[22 - strlen(buffer)] = '\0'; ++ if (!flag_trim) { ++ if ((strlen(local_addr) + strlen(buffer)) > 22) ++ local_addr[22 - strlen(buffer)] = '\0'; ++ } + strcat(local_addr, ":"); + strcat(local_addr, buffer); + +@@ -1510,8 +1513,10 @@ + flag_not & FLAG_NUM_PORT)); + safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr, + flag_not & FLAG_NUM_HOST), sizeof(local_addr)); +- if ((strlen(local_addr) + strlen(buffer)) > 22) +- local_addr[22 - strlen(buffer)] = '\0'; ++ if (!flag_trim) { ++ if ((strlen(local_addr) + strlen(buffer)) > 22) ++ local_addr[22 - strlen(buffer)] = '\0'; ++ } + strcat(local_addr, ":"); + strcat(local_addr, buffer); + +@@ -1981,6 +1986,7 @@ + fprintf(stderr, _(" -o, --timers display timers\n")); + fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n")); + fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n")); ++ fprintf(stderr, _(" -T, --notrim dont't trim address information\n")); + + fprintf(stderr, _(" ={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom --sctp\n")); + fprintf(stderr, _(" =Use '-A ' or '--'; default: %s\n"), DFLT_AF); +@@ -2026,6 +2032,7 @@ + {"cache", 0, 0, 'C'}, + {"fib", 0, 0, 'F'}, + {"groups", 0, 0, 'g'}, ++ {"notrim", 0, 0, 'T'}, + {NULL, 0, 0, 0} + }; + +@@ -2037,7 +2044,7 @@ + getroute_init(); /* Set up AF routing support */ + + afname[0] = '\0'; +- while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuVv?wxl", longopts, &lop)) != EOF) ++ while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuVv?wxlT", longopts, &lop)) != EOF) + switch (i) { + case -1: + break; +@@ -2137,6 +2144,10 @@ + usage(); + case 's': + flag_sta++; ++ break; ++ case 'T': ++ flag_trim++; ++ break; + } + + if (flag_int + flag_rou + flag_mas + flag_sta > 1) +--- net-tools-1.60/man/en_US/netstat.8 2009-08-12 10:20:38.000000000 +0200 ++++ net-tools-1.60/man/en_US/netstat.8 2009-08-12 10:23:27.000000000 +0200 +@@ -164,6 +164,8 @@ + Show both listening and non-listening sockets. With the + .B --interfaces + option, show interfaces that are not marked ++.SS "\-T, \-\-notrim" ++Don't trim the network address information + .SS "\-F" + Print routing information from the FIB. (This is the default.) + .SS "\-C" diff --git a/net-tools.changes b/net-tools.changes index ff8289b..3363cef 100644 --- a/net-tools.changes +++ b/net-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 12 10:38:32 CEST 2009 - ms@suse.de + +- added -T, --notrim option which prevents the address + field from being truncated (bnc #530196) + ------------------------------------------------------------------- Thu Aug 6 16:17:40 CEST 2009 - ms@suse.de diff --git a/net-tools.spec b/net-tools.spec index a4fd482..1a2fd82 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -28,7 +28,7 @@ Provides: iputils:/usr/share/man/man8/traceroute6.1.gz Obsoletes: traceroute net_tool AutoReqProv: on Version: 1.60 -Release: 730 +Release: 731 Summary: Important Programs for Networking BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: net-tools-%{version}.tar.bz2 @@ -72,6 +72,7 @@ Patch36: net-tools-1.60-printval-conversion.patch Patch37: traceroute-glibc210.diff #Patch38: net-tools-1.60-obsolete.diff Patch39: net-tools-1.60-fclose.diff +Patch40: net-tools-1.60-notrim.diff %description This package contains essential programs for network administration and @@ -129,6 +130,7 @@ cd .. %patch36 -p1 #%patch38 -p1 %patch39 -p1 +%patch40 -p1 %build make config