From 1d5cd6cf2708c32b4bf05e3d043cc24fefe74534 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Apr 21 2011 12:07:22 +0000 Subject: patch netstat to separate basename of -p only if it is absolute path --- diff --git a/net-tools-1.60-netstat-p-basename.patch b/net-tools-1.60-netstat-p-basename.patch new file mode 100644 index 0000000..6ead27c --- /dev/null +++ b/net-tools-1.60-netstat-p-basename.patch @@ -0,0 +1,12 @@ +diff -up net-tools-1.60/netstat.c.p-basename net-tools-1.60/netstat.c +--- net-tools-1.60/netstat.c.p-basename 2011-04-21 13:52:51.000000000 +0200 ++++ net-tools-1.60/netstat.c 2011-04-21 13:54:03.000000000 +0200 +@@ -484,7 +484,7 @@ static void prg_cache_load(void) + continue; + if (cmdllen < sizeof(cmdlbuf) - 1) + cmdlbuf[cmdllen]='\0'; +- if ((cmdlp = strrchr(cmdlbuf, '/'))) ++ if (cmdlbuf[0] == '/' && (cmdlp = strrchr(cmdlbuf, '/'))) + cmdlp++; + else + cmdlp = cmdlbuf; diff --git a/net-tools.spec b/net-tools.spec index 87a37bf..a69184b 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -1,7 +1,7 @@ Summary: Basic networking tools Name: net-tools Version: 1.60 -Release: 117%{?dist} +Release: 118%{?dist} License: GPL+ Group: System Environment/Base URL: http://net-tools.berlios.de/ @@ -145,6 +145,10 @@ Patch91: net-tools-1.60-arbitrary-device-names.patch # plipconfig man page and usage output fixes. (#694766) Patch92: net-tools-1.60-plipconfig.patch +# patch netstat to separate basename of -p only if it is absolute +# path (in order to make argv[0]="sshd pty/0" display as sshd, and not as /0). +Patch93: net-tools-1.60-netstat-p-basename.patch + BuildRequires: gettext, libselinux BuildRequires: libselinux-devel Requires: hostname @@ -241,6 +245,7 @@ Most of them are obsolete. For replacement check iproute package. %patch90 -p1 -b .ifdef-vs-if %patch91 -p1 -b .arbitrary-device-names %patch92 -p1 -b .plipconfig +%patch93 -p1 -b .p-basename cp %SOURCE1 ./config.h cp %SOURCE2 ./config.make @@ -340,6 +345,10 @@ rm -rf %{buildroot} %config(noreplace) %{_sysconfdir}/ethers %changelog +* Thu Apr 21 2011 Jiri Popelka - 1.60-118 +- patch netstat to separate basename of -p only if it is absolute + path (in order to make argv[0]="sshd pty/0" display as sshd, and not as /0). + * Thu Apr 14 2011 Jiri Popelka - 1.60-117 - plipconfig man page and usage output fixes. (#694766)