- added note to hostname(1) (#140239)

- fixed --num-ports option for netstat (#115100)
This commit is contained in:
Radek Vokál 2004-11-25 14:07:55 +00:00
parent 98d766b986
commit 6390381340
3 changed files with 101 additions and 2 deletions

13
net-tools-1.60-note.patch Normal file
View File

@ -0,0 +1,13 @@
--- net-tools-1.60/man/en_US/hostname.1.note 2004-11-24 12:09:28.000000000 +0100
+++ net-tools-1.60/man/en_US/hostname.1 2004-11-24 12:16:41.121050760 +0100
@@ -191,6 +191,10 @@
) then root can also set a new NIS domain.
.SH FILES
.B /etc/hosts
+.B /etc/sysconfig/network
+.SH NOTE
+Note that hostname doesn't change anything permanently. After reboot
+original names from \fI/etc/hosts\fR are used again.
.SH AUTHOR
Peter Tobias, <tobias@et-inf.fho-emden.de>
.br

View File

@ -0,0 +1,78 @@
--- net-tools-1.60/netstat.c.num-ports 2004-11-24 12:19:24.000000000 +0100
+++ net-tools-1.60/netstat.c 2004-11-25 16:00:45.208367104 +0100
@@ -765,8 +765,8 @@
txq = 0L;
}
safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
- flag_not), sizeof(local_addr));
- safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not),
+ flag_not & FLAG_NUM_HOST), sizeof(local_addr));
+ safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not & FLAG_NUM_HOST),
sizeof(rem_addr));
if (flag_all || (flag_lst && !rem_port) || (!flag_lst && rem_port)) {
snprintf(buffer, sizeof(buffer), "%s",
@@ -921,11 +921,11 @@
if (flag_all || (notnull(remaddr) && !flag_lst) || (!notnull(remaddr) && flag_lst))
{
safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
- flag_not), sizeof(local_addr));
+ flag_not & FLAG_NUM_HOST), sizeof(local_addr));
snprintf(buffer, sizeof(buffer), "%s",
get_sname(htons(local_port), "udp",
flag_not & FLAG_NUM_PORT));
- if ((strlen(local_addr) + strlen(buffer)) > 22)
+ if ((strlen(local_addr) + strlen(buffer)) >= 27)
local_addr[22 - strlen(buffer)] = '\0';
strcat(local_addr, ":");
strncat(local_addr, buffer, sizeof(local_addr));
@@ -934,8 +934,8 @@
snprintf(buffer, sizeof(buffer), "%s",
get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
- flag_not), sizeof(rem_addr));
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
+ flag_not & FLAG_NUM_HOST), sizeof(rem_addr));
+ if ((strlen(rem_addr) + strlen(buffer)) >= 27)
rem_addr[22 - strlen(buffer)] = '\0';
strcat(rem_addr, ":");
strncat(rem_addr, buffer, sizeof(rem_addr));
@@ -958,7 +958,7 @@
retr, timeout);
break;
}
- printf("udp %6ld %6ld %-23s %-23s %-12s",
+ printf("udp %6ld %6ld %-27s %-27s %-12s",
rxq, txq, local_addr, rem_addr, udp_state);
finish_this_one(uid,inode,timers);
@@ -1045,8 +1045,8 @@
get_sname(htons(local_port), "raw",
flag_not & FLAG_NUM_PORT));
safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
- flag_not), sizeof(local_addr));
- if ((strlen(local_addr) + strlen(buffer)) > 22)
+ flag_not & FLAG_NUM_HOST), sizeof(local_addr));
+ if ((strlen(local_addr) + strlen(buffer)) >= 27)
local_addr[22 - strlen(buffer)] = '\0';
strcat(local_addr, ":");
strncat(local_addr, buffer, sizeof(local_addr));
@@ -1055,8 +1055,8 @@
snprintf(buffer, sizeof(buffer), "%s",
get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
- flag_not), sizeof(rem_addr));
- if ((strlen(rem_addr) + strlen(buffer)) > 22)
+ flag_not & FLAG_NUM_HOST), sizeof(rem_addr));
+ if ((strlen(rem_addr) + strlen(buffer)) >= 27)
rem_addr[22 - strlen(buffer)] = '\0';
strcat(rem_addr, ":");
strncat(rem_addr, buffer, sizeof(rem_addr));
@@ -1081,7 +1081,7 @@
retr, timeout);
break;
}
- printf("raw %6ld %6ld %-23s %-23s %-12d",
+ printf("raw %6ld %6ld %-27s %-27s %-12d",
rxq, txq, local_addr, rem_addr, state);
finish_this_one(uid,inode,timers);

View File

@ -3,7 +3,7 @@
Summary: Basic networking tools.
Name: net-tools
Version: 1.60
Release: 40
Release: 41
License: GPL
Group: System Environment/Base
Source0: http://www.tazenda.demon.co.uk/phil/net-tools/net-tools-%{version}.tar.bz2
@ -38,6 +38,8 @@ Patch24: net-tools-1.60-ulong.patch
Patch25: net-tools-1.60-bcast.patch
Patch26: net-tools-1.60-mii-tool-obsolete.patch
Patch27: net-tools-1.60-netstat_ulong.patch
Patch28: net-tools-1.60-note.patch
Patch29: net-tools-1.60-num-ports.patch
BuildRoot: %{_tmppath}/%{name}-root
Requires(post,preun): chkconfig
BuildRequires: gettext
@ -75,6 +77,8 @@ ifconfig, netstat, route, and others.
%patch25 -p1 -b .bcast
%patch26 -p1 -b .obsolete
%patch27 -p1 -b .netstat_ulong
%patch28 -p1 -b .note
%patch29 -p1 -b .num-ports
cp %SOURCE2 ./config.h
cp %SOURCE3 ./config.make
@ -166,9 +170,13 @@ exit 0
%{_sysconfdir}/rc.d/init.d/netplugd
%changelog
* Thu Nov 25 2004 Radek Vokal <rvokal@redhat.com> 1.60-41
- added note to hostname(1) (#140239)
- fixed --num-ports option for netstat (#115100)
* Thu Nov 11 2004 Radek Vokal <rvokal@redhat.com> 1.60-40
- mii-tool(8) fixed, labeled as obsolete, added info (#138687)
- netstat crashing on i64 fixed (#138804)
- netstat crashing on i64 fixed (#138804) Patch by <Andreas.Hirstius@cern.ch>
* Thu Nov 04 2004 Radek Vokal <rvokal@redhat.com> 1.60-39
- IBM patch for netstat -s returning negative values on 64bit arch (#144064)