From owner-freebsd-audit Sun Jan 5 23:50:45 2003 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A4A9437B401 for ; Sun, 5 Jan 2003 23:50:42 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id BECE743ED1 for ; Sun, 5 Jan 2003 23:50:41 -0800 (PST) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-a233.otenet.gr [212.205.215.233]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id h067oY4V020063 for ; Mon, 6 Jan 2003 09:50:37 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.6/8.12.6) with ESMTP id h067oXbl000789 for ; Mon, 6 Jan 2003 09:50:34 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.12.6/8.12.6/Submit) id h066NAtY037143 for freebsd-audit@freebsd.org; Mon, 6 Jan 2003 08:23:10 +0200 (EET) (envelope-from keramida@freebsd.org) Date: Mon, 6 Jan 2003 08:23:09 +0200 From: Giorgos Keramidas To: freebsd-audit@freebsd.org Subject: hopefully, a fix for an old uncompress(1) bug Message-ID: <20030106062309.GA37109@gothmog.gr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Dxnq1zWXvFF0Q93v" Content-Disposition: inline Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Gary Swearingen brought the following bug to my attention while posting a `fix' for the manpage of compress(1) and uncompress(1). Instead of documenting the bug, I thought we might try to fix it. When uncompress is called with an input filename that does not end in a .Z extension, it attempts to add the necessary extension anyway. The order of file opening in the compress() and decompress() functions is reversed though, and it causes the following `interesting' behavior: % ls -l -rw-rw-r-- 1 giorgos wheel - 0 Jan 6 08:04 lala % uncompress -f lala uncompress: lala.Z: No such file or directory % ls -l % The file called `lala' just happened to have an unfortunate file name and was unlinked at the end of decompress() function :-/ The following patch seems to fix this for me, but I'm not sure if it breaks the `expected' behavior of uncompress for some case I haven't thought about yet. The compress() and decompress() functions in compress.c are almost identical and they have been since revision 1.1 of the file, and I have only tested this lightly: % ls -l total 16 -rw-rw-r-- 1 giorgos wheel - 0 Jan 6 08:17 bar -rwxrwxr-x 1 giorgos wheel - 14681 Jan 6 08:04 uncompress % ./uncompress -f bar uncompress: bar.Z: No such file or directory % ls -l total 16 -rw-rw-r-- 1 giorgos wheel - 0 Jan 6 08:17 bar -rwxrwxr-x 1 giorgos wheel - 14681 Jan 6 08:04 uncompress % What's your opinion all? %%% Index: compress.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/compress/compress.c,v retrieving revision 1.20 diff -u -5 -r1.20 compress.c --- compress.c 28 Jul 2002 15:32:17 -0000 1.20 +++ compress.c 6 Jan 2003 06:15:06 -0000 @@ -298,26 +298,25 @@ if (!force && exists && S_ISREG(sb.st_mode) && !permission(out)) return; isreg =3D oreg =3D !exists || S_ISREG(sb.st_mode); =20 ifp =3D ofp =3D NULL; - if ((ofp =3D fopen(out, "w")) =3D=3D NULL) { - cwarn("%s", out); - return; - } - if ((ifp =3D zopen(in, "r", bits)) =3D=3D NULL) { cwarn("%s", in); - goto err; + return; } if (stat(in, &sb)) { cwarn("%s", in); goto err; } if (!S_ISREG(sb.st_mode)) isreg =3D 0; =20 + if ((ofp =3D fopen(out, "w")) =3D=3D NULL) { + cwarn("%s", out); + goto err; + } while ((nr =3D fread(buf, 1, sizeof(buf), ifp)) !=3D 0) if (fwrite(buf, 1, nr, ofp) !=3D nr) { cwarn("%s", out); goto err; } %%% --Dxnq1zWXvFF0Q93v Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+GSDN1g+UGjGGA7YRAv1LAJ9b3aPht3Xpy5OjRIGWw5zY5q5mIgCdFMYy hC59Wi5t9n2VPBLRjW+Cklk= =/zIe -----END PGP SIGNATURE----- --Dxnq1zWXvFF0Q93v-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jan 6 0:10:46 2003 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C8CF837B401 for ; Mon, 6 Jan 2003 00:10:43 -0800 (PST) Received: from straylight.ringlet.net (office.sbnd.net [217.75.140.130]) by mx1.FreeBSD.org (Postfix) with SMTP id 83CA543ED8 for ; Mon, 6 Jan 2003 00:10:36 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 4394 invoked by uid 1000); 6 Jan 2003 08:09:50 -0000 Date: Mon, 6 Jan 2003 10:09:50 +0200 From: Peter Pentchev To: Giorgos Keramidas Cc: freebsd-audit@freebsd.org Subject: Re: hopefully, a fix for an old uncompress(1) bug Message-ID: <20030106080949.GA382@straylight.oblivion.bg> Mail-Followup-To: Giorgos Keramidas , freebsd-audit@freebsd.org References: <20030106062309.GA37109@gothmog.gr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline In-Reply-To: <20030106062309.GA37109@gothmog.gr> User-Agent: Mutt/1.5.3i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --envbJBWh7q8WU6mo Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 06, 2003 at 08:23:09AM +0200, Giorgos Keramidas wrote: > Gary Swearingen brought the following bug to my attention while > posting a `fix' for the manpage of compress(1) and uncompress(1). > Instead of documenting the bug, I thought we might try to fix it. Good catch - to both Gary and you! Just a minor note inline... > %%% > Index: compress.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /home/ncvs/src/usr.bin/compress/compress.c,v > retrieving revision 1.20 > diff -u -5 -r1.20 compress.c > --- compress.c 28 Jul 2002 15:32:17 -0000 1.20 > +++ compress.c 6 Jan 2003 06:15:06 -0000 > @@ -298,26 +298,25 @@ [snip] > if ((ifp =3D zopen(in, "r", bits)) =3D=3D NULL) { > cwarn("%s", in); > - goto err; > + return; Is this change really needed? It is true that the code at 'err' would be a no-op at this point, when neither ifp nor ofp has been opened, but it strikes me as a bit more semantically correct to invoke the "real" error-handling procedures at any error, just in case something changes in the future and some error-handling does indeed become necessary. Other than that, the patch seems just fine - and it works :) Attached is the version without the 'goto err' change, for the minor convenience of future reviewers and committers. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 If this sentence didn't exist, somebody would have invented it. Index: src/usr.bin/compress/compress.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/compress/compress.c,v retrieving revision 1.20 diff -u -r1.20 compress.c --- src/usr.bin/compress/compress.c 28 Jul 2002 15:32:17 -0000 1.20 +++ src/usr.bin/compress/compress.c 6 Jan 2003 08:04:51 -0000 @@ -300,11 +300,6 @@ isreg =3D oreg =3D !exists || S_ISREG(sb.st_mode); =20 ifp =3D ofp =3D NULL; - if ((ofp =3D fopen(out, "w")) =3D=3D NULL) { - cwarn("%s", out); - return; - } - if ((ifp =3D zopen(in, "r", bits)) =3D=3D NULL) { cwarn("%s", in); goto err; @@ -316,6 +311,10 @@ if (!S_ISREG(sb.st_mode)) isreg =3D 0; =20 + if ((ofp =3D fopen(out, "w")) =3D=3D NULL) { + cwarn("%s", out); + goto err; + } while ((nr =3D fread(buf, 1, sizeof(buf), ifp)) !=3D 0) if (fwrite(buf, 1, nr, ofp) !=3D nr) { cwarn("%s", out); --envbJBWh7q8WU6mo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+GTnN7Ri2jRYZRVMRAnD0AKCZX1XfaZWR4pPdhJKh/hAY7C6hswCffgBz mi9ZmYanRLWwBAe/T1CMfqI= =C3ql -----END PGP SIGNATURE----- --envbJBWh7q8WU6mo-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jan 6 0:22: 0 2003 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3AFEC37B405 for ; Mon, 6 Jan 2003 00:21:59 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FC9A43EC2 for ; Mon, 6 Jan 2003 00:21:57 -0800 (PST) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-a233.otenet.gr [212.205.215.233]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id h068Ls4V017856 for ; Mon, 6 Jan 2003 10:21:55 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.6/8.12.6) with ESMTP id h068Lsbj001386 for ; Mon, 6 Jan 2003 10:21:54 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.12.6/8.12.6/Submit) id h068LspV001385 for freebsd-audit@freebsd.org; Mon, 6 Jan 2003 10:21:54 +0200 (EET) (envelope-from keramida@freebsd.org) Date: Mon, 6 Jan 2003 10:21:54 +0200 From: Giorgos Keramidas To: freebsd-audit@freebsd.org Subject: Re: hopefully, a fix for an old uncompress(1) bug Message-ID: <20030106082154.GE1094@gothmog.gr> References: <20030106062309.GA37109@gothmog.gr> <20030106080949.GA382@straylight.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030106080949.GA382@straylight.oblivion.bg> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2003-01-06 10:09, Peter Pentchev wrote: > On Mon, Jan 06, 2003 at 08:23:09AM +0200, Giorgos Keramidas wrote: > > diff -u -5 -r1.20 compress.c > > --- compress.c 28 Jul 2002 15:32:17 -0000 1.20 > > +++ compress.c 6 Jan 2003 06:15:06 -0000 > > @@ -298,26 +298,25 @@ > [snip] > > if ((ifp = zopen(in, "r", bits)) == NULL) { > > cwarn("%s", in); > > - goto err; > > + return; > > Is this change really needed? It is true that the code at 'err' would > be a no-op at this point, when neither ifp nor ofp has been opened, but > it strikes me as a bit more semantically correct to invoke the "real" > error-handling procedures at any error, just in case something changes > in the future and some error-handling does indeed become necessary. Probably not. I'm happy with any of them two versions. Your diff is even better since it reduces the changes to the absolute minimum. - Giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jan 6 20: 2:31 2003 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 989D537B401 for ; Mon, 6 Jan 2003 20:02:28 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB1EA43E4A for ; Mon, 6 Jan 2003 20:02:27 -0800 (PST) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-a105.otenet.gr [212.205.215.105]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id h0742M4V002312; Tue, 7 Jan 2003 06:02:23 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.6/8.12.6) with ESMTP id h0742MZx004449; Tue, 7 Jan 2003 06:02:22 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.12.6/8.12.6/Submit) id h0742GjF004448; Tue, 7 Jan 2003 06:02:16 +0200 (EET) (envelope-from keramida@freebsd.org) Date: Tue, 7 Jan 2003 06:02:16 +0200 From: Giorgos Keramidas To: freebsd-audit@freebsd.org Cc: Peter Pentchev Subject: Re: hopefully, a fix for an old uncompress(1) bug Message-ID: <20030107040216.GB4071@gothmog.gr> References: <20030106062309.GA37109@gothmog.gr> <20030106080949.GA382@straylight.oblivion.bg> <20030106082154.GE1094@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030106082154.GE1094@gothmog.gr> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2003-01-06 10:21, Giorgos Keramidas wrote: > On 2003-01-06 10:09, Peter Pentchev wrote: > > > if ((ifp = zopen(in, "r", bits)) == NULL) { > > > cwarn("%s", in); > > > - goto err; > > > + return; > > > > Is this change really needed? It is true that the code at 'err' would > > be a no-op at this point, when neither ifp nor ofp has been opened, but > > it strikes me as a bit more semantically correct to invoke the "real" > > error-handling procedures at any error, just in case something changes > > in the future and some error-handling does indeed become necessary. > > Probably not. I'm happy with any of them two versions. Your diff is > even better since it reduces the changes to the absolute minimum. Hmmm, it seems that I spoke too hastily. No, we shouldn't `goto err' in compress() or decompress() before we successfully open the output file. This is because unlink() is run to the output file under err: and we don't know if we are permitted to run unlink() on the output file. Not until we are sure that it was *us* that created it. I'm still not 100% happy with the fact that failures during the compression or decompression of files will cause the `output' file to be removed, but solving that would require a temporary file and I'm nont sure I like that either :-( When decompress() runs there are two bugs with the repository version right now. When uncompress(1) is run as: % uncompress -f foo the decompress() function runs with `in' set to "foo.Z" and `out' set to "foo". The first problem is that decompress() tries to open the output file first and then notice that its input file (foo.Z) fails to zopen(). When this happens, it promptly goes ahead and tries to unlink `foo' which is supposed to be the outfile. If a file happens to be named `foo' it is unconditionally removed. This is the behavior shown below: % ls -l -rw-rw-r-- 1 giorgos wheel - 0 Jan 6 08:04 lala % uncompress -f lala uncompress: lala.Z: No such file or directory % ls -l % Reversing the order of `in' and `out' file opening fixes this problem, but there is one more which is a bit more difficult to notice. The second problem. If the input file of decompress() does exist but is not a valid .Z file the zopen() call will work fine only to fail later on when we try to fread() data from it. This is shown below: $ cp /COPYRIGHT lala.Z $ touch lala $ ls -l lala* -rw-rw-r-- 1 giorgos giorgos - 0 Jan 7 05:42 lala -r--r--r-- 1 giorgos giorgos - 4735 Jan 7 05:42 lala.Z $ ./uncompress -f lala uncompress: lala.Z: Inappropriate file type or format $ ls -l lala* -r--r--r-- 1 giorgos giorgos - 4735 Jan 7 05:42 lala.Z $ I tried to solve this, by attempting to successfully read at least one byte of data from the .Z file before even attempting to open the output file. I also changed all the `goto err' parts before the output file is opened to avoid unlinking() a file that we haven't previously fopen()ed. Hopefully, this fixes both the problems :-/ %%% Index: compress.c =================================================================== RCS file: /home/ncvs/src/usr.bin/compress/compress.c,v retrieving revision 1.20 diff -u -r1.20 compress.c --- compress.c 28 Jul 2002 15:32:17 -0000 1.20 +++ compress.c 7 Jan 2003 03:57:26 -0000 @@ -300,14 +300,9 @@ isreg = oreg = !exists || S_ISREG(sb.st_mode); ifp = ofp = NULL; - if ((ofp = fopen(out, "w")) == NULL) { - cwarn("%s", out); - return; - } - if ((ifp = zopen(in, "r", bits)) == NULL) { cwarn("%s", in); - goto err; + return; } if (stat(in, &sb)) { cwarn("%s", in); @@ -315,6 +310,18 @@ } if (!S_ISREG(sb.st_mode)) isreg = 0; + + /* + * Try to read the first few uncompressed bytes from the input file + * before blindly truncating the output file. + */ + if ((nr = fread(buf, 1, sizeof(buf), ifp)) == 0 || + (ofp = fopen(out, "w")) == NULL || + (nr != 0 && fwrite(buf, 1, nr, ofp) != nr)) { + cwarn("%s", out); + (void)fclose(ifp); + return; + } while ((nr = fread(buf, 1, sizeof(buf), ifp)) != 0) if (fwrite(buf, 1, nr, ofp) != nr) { %%% To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jan 8 1:44: 8 2003 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3FFBB37B401; Wed, 8 Jan 2003 01:44:03 -0800 (PST) Received: from pool-151-200-10-97.res.east.verizon.net (pool-151-200-44-148.res.east.verizon.net [151.200.44.148]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B97643ED1; Wed, 8 Jan 2003 01:44:02 -0800 (PST) (envelope-from mtm@identd.net) Received: from localhost.identd.net (localhost [IPv6:::1]) by pool-151-200-10-97.res.east.verizon.net (8.12.6/8.12.6) with ESMTP id h089i0mQ007656; Wed, 8 Jan 2003 04:44:00 -0500 (EST) (envelope-from mtm@identd.net) Received: (from mtm@localhost) by localhost.identd.net (8.12.6/8.12.6/Submit) id h089i0t5007642; Wed, 8 Jan 2003 04:44:00 -0500 (EST) X-Authentication-Warning: localhost.identd.net: mtm set sender to mtm@identd.net using -f Date: Wed, 8 Jan 2003 04:44:00 -0500 From: Mike Makonnen To: freebsd-audit@freebsd.org Cc: Mark Murray Subject: Minor fixes to netstat Message-ID: <20030108094400.GA7614@quark> Mail-Followup-To: freebsd-audit@freebsd.org, Mark Murray Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZoaI/ZTpAVc4A5k6" Content-Disposition: inline X-Operating-System: FreeBSD/5.0-CURRENT (i386) User-Agent: Mutt/1.5.1i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --ZoaI/ZTpAVc4A5k6 Content-Type: multipart/mixed; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi folks, Does anyone have any objections to the following patch to netstat? It basically, fixes some typos/grammar nits and adds another mini-function to correctly handle singular/plurals of words ending in 'ly'. netstat.diff - the patch out.diff - the result of the patch Cheers. --=20 Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: D228 1A6F C64E 120A A1C9 A3AA DAE1 E2AF DBCC= 68B9 --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="netstat.diff" Content-Transfer-Encoding: quoted-printable Index: usr.bin/netstat/inet.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/netstat/inet.c,v retrieving revision 1.55 diff -u -r1.55 inet.c --- usr.bin/netstat/inet.c 5 Sep 2002 17:06:51 -0000 1.55 +++ usr.bin/netstat/inet.c 25 Dec 2002 02:40:50 -0000 @@ -630,7 +630,7 @@ =20 p(icps_error, "\t%lu call%s to icmp_error\n"); p(icps_oldicmp, - "\t%lu error%s not generated 'cuz old message was icmp\n"); + "\t%lu error%s not generated in response to an icmp message\n"); for (first =3D 1, i =3D 0; i < ICMP_MAXTYPE + 1; i++) if (icmpstat.icps_outhist[i] !=3D 0) { if (first) { Index: usr.bin/netstat/inet6.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/netstat/inet6.c,v retrieving revision 1.20 diff -u -r1.20 inet6.c --- usr.bin/netstat/inet6.c 5 Sep 2002 17:06:51 -0000 1.20 +++ usr.bin/netstat/inet6.c 25 Dec 2002 03:02:34 -0000 @@ -416,7 +416,7 @@ "\t%llu packet%s whose headers are not continuous\n"); p(ip6s_nogif, "\t%llu tunneling packet%s that can't find gif\n"); p(ip6s_toomanyhdr, - "\t%llu packet%s discarded due to too may headers\n"); + "\t%llu packet%s discarded because of too many headers\n"); =20 /* for debugging source address selection */ #define PRINT_SCOPESTAT(s,i) do {\ @@ -538,7 +538,7 @@ p(ifs6_out_fragcreat, "\t%llu output datagram%s succeeded on fragment\n"); p(ifs6_reass_reqd, "\t%llu incoming datagram%s fragmented\n"); p(ifs6_reass_ok, "\t%llu datagram%s reassembled\n"); - p(ifs6_reass_fail, "\t%llu datagram%s failed on reassembling\n"); + p(ifs6_reass_fail, "\t%llu datagram%s failed on reassembly\n"); p(ifs6_in_mcast, "\t%llu multicast datagram%s received\n"); p(ifs6_out_mcast, "\t%llu multicast datagram%s sent\n"); =20 @@ -834,11 +834,11 @@ printf(m, (unsigned long long)icmp6stat.f, plural(icmp6stat.f)) #define p_5(f, m) printf(m, (unsigned long long)icmp6stat.f) =20 - p(icp6s_error, "\t%llu call%s to icmp_error\n"); + p(icp6s_error, "\t%llu call%s to icmp6_error\n"); p(icp6s_canterror, - "\t%llu error%s not generated because old message was icmp error or s= o\n"); + "\t%llu error%s not generated in response to an icmp6 message\n"); p(icp6s_toofreq, - "\t%llu error%s not generated because rate limitation\n"); + "\t%llu error%s not generated because of rate limitation\n"); #define NELEM (int)(sizeof(icmp6stat.icp6s_outhist)/sizeof(icmp6stat.icp6s= _outhist[0])) for (first =3D 1, i =3D 0; i < NELEM; i++) if (icmp6stat.icp6s_outhist[i] !=3D 0) { @@ -903,6 +903,8 @@ int s; #define p(f, m) if (ifr.ifr_ifru.ifru_icmp6stat.f || sflag <=3D 1) \ printf(m, (unsigned long long)ifr.ifr_ifru.ifru_icmp6stat.f, plural(if= r.ifr_ifru.ifru_icmp6stat.f)) +#define p2(f, m) if (ifr.ifr_ifru.ifru_icmp6stat.f || sflag <=3D 1) \ + printf(m, (unsigned long long)ifr.ifr_ifru.ifru_icmp6stat.f, pluralies= (ifr.ifr_ifru.ifru_icmp6stat.f)) =20 if ((s =3D socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { perror("Warning: socket(AF_INET6)"); @@ -925,13 +927,13 @@ p(ifs6_in_paramprob, "\t%llu input parameter problem error%s\n"); p(ifs6_in_pkttoobig, "\t%llu input packet too big error%s\n"); p(ifs6_in_echo, "\t%llu input echo request%s\n"); - p(ifs6_in_echoreply, "\t%llu input echo reply%s\n"); + p2(ifs6_in_echoreply, "\t%llu input echo repl%s\n"); p(ifs6_in_routersolicit, "\t%llu input router solicitation%s\n"); p(ifs6_in_routeradvert, "\t%llu input router advertisement%s\n"); p(ifs6_in_neighborsolicit, "\t%llu input neighbor solicitation%s\n"); p(ifs6_in_neighboradvert, "\t%llu input neighbor advertisement%s\n"); p(ifs6_in_redirect, "\t%llu input redirect%s\n"); - p(ifs6_in_mldquery, "\t%llu input MLD query%s\n"); + p2(ifs6_in_mldquery, "\t%llu input MLD quer%s\n"); p(ifs6_in_mldreport, "\t%llu input MLD report%s\n"); p(ifs6_in_mlddone, "\t%llu input MLD done%s\n"); =20 @@ -943,13 +945,13 @@ p(ifs6_out_paramprob, "\t%llu output parameter problem error%s\n"); p(ifs6_out_pkttoobig, "\t%llu output packet too big error%s\n"); p(ifs6_out_echo, "\t%llu output echo request%s\n"); - p(ifs6_out_echoreply, "\t%llu output echo reply%s\n"); + p2(ifs6_out_echoreply, "\t%llu output echo repl%s\n"); p(ifs6_out_routersolicit, "\t%llu output router solicitation%s\n"); p(ifs6_out_routeradvert, "\t%llu output router advertisement%s\n"); p(ifs6_out_neighborsolicit, "\t%llu output neighbor solicitation%s\n"); p(ifs6_out_neighboradvert, "\t%llu output neighbor advertisement%s\n"); p(ifs6_out_redirect, "\t%llu output redirect%s\n"); - p(ifs6_out_mldquery, "\t%llu output MLD query%s\n"); + p2(ifs6_out_mldquery, "\t%llu output MLD quer%s\n"); p(ifs6_out_mldreport, "\t%llu output MLD report%s\n"); p(ifs6_out_mlddone, "\t%llu output MLD done%s\n"); =20 Index: usr.bin/netstat/main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/netstat/main.c,v retrieving revision 1.58 diff -u -r1.58 main.c --- usr.bin/netstat/main.c 5 Sep 2002 17:06:51 -0000 1.58 +++ usr.bin/netstat/main.c 25 Dec 2002 02:56:14 -0000 @@ -703,6 +703,12 @@ return (n !=3D 1 ? "es" : ""); } =20 +const char * +pluralies(int n) +{ + return (n !=3D 1 ? "ies" : "y"); +} + /* * Find the protox for the given "well-known" name. */ --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="out.diff" Content-Transfer-Encoding: quoted-printable 'netstat -s' output:=20 icmp: 0 calls to icmp_error - 0 errors not generated 'cuz old message was icmp + 0 errors not generated in response to an icmp message =2E.. - 0 packets discarded due to too may headers + 0 packets discarded because of too many headers =2E.. - 0 calls to icmp_error - 0 errors not generated because old message was icmp error or so - 0 errors not generated because rate limitation + 0 calls to icmp6_error + 0 errors not generated in response to an icmp6 message + 0 errors not generated because of rate limitation 'netstat -I dc0 -s' output: =20 - 0 datagrams failed on reassembling + 0 datagrams failed on reassembly =2E.. - 0 input echo replys + 0 input echo replies =2E.. - 0 input MLD querys + 0 input MLD queries =2E.. - 0 output echo replys + 0 output echo replies =2E.. - 0 output MLD querys + 0 output MLD queries 2 output MLD reports 0 output MLD dones --jI8keyz6grp/JLjh-- --ZoaI/ZTpAVc4A5k6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+G/Lf2uHir9vMaLkRAl7FAKDpFAQI34/dwmzHJskt5v6m57kOsACfY9Eh 737Z/BaLz3hzxiXyT2Z7YAA= =z3P8 -----END PGP SIGNATURE----- --ZoaI/ZTpAVc4A5k6-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message