From owner-freebsd-audit Sun Feb 4 8:40:26 2001 Delivered-To: freebsd-audit@freebsd.org Received: from critter.freebsd.dk (flutter.freebsd.dk [212.242.40.147]) by hub.freebsd.org (Postfix) with ESMTP id 47A0237B491 for ; Sun, 4 Feb 2001 08:40:09 -0800 (PST) Received: from critter (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.1/8.11.1) with ESMTP id f14GeHB19499 for ; Sun, 4 Feb 2001 17:40:17 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: audit@freebsd.org Subject: if_multiaddrs.patch From: Poul-Henning Kamp Date: Sun, 04 Feb 2001 17:40:17 +0100 Message-ID: <19497.981304817@critter> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG http://phk.freebsd.dk/patch 2001-02-04 if_multiaddrs.patch Convert if_multiaddrs from LIST to TAILQ so that it can be traversed backwards also. To be committed 2001-02-08 -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Feb 4 9: 7:18 2001 Delivered-To: freebsd-audit@freebsd.org Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.161.193]) by hub.freebsd.org (Postfix) with ESMTP id 57A9437B401; Sun, 4 Feb 2001 09:07:00 -0800 (PST) Received: from mail.vt.edu (gkar.cc.vt.edu [198.82.161.190]) by lennier.cc.vt.edu (8.11.0/8.11.0) with ESMTP id f14H6wu86157; Sun, 4 Feb 2001 12:06:58 -0500 (EST) Received: from enterprise.muriel.penguinpowered.com ([198.82.100.151]) by gkar.cc.vt.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0G8800L1GSVLGB@gkar.cc.vt.edu>; Sun, 4 Feb 2001 12:06:57 -0500 (EST) Date: Sun, 04 Feb 2001 12:06:57 -0500 (EST) From: Mike Heffner Subject: RE: if_multiaddrs.patch In-reply-to: <19497.981304817@critter> To: Poul-Henning Kamp Cc: audit@freebsd.org Message-id: MIME-version: 1.0 X-Mailer: XFMail 1.4.6-3 on FreeBSD Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 8bit X-Priority: 3 (Normal) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Looks good to me. One thing I noticed was that in sys/pci/if_xl.c, functions xl_setmulti() and xl_setmulti_hash(), the variable mcnt isn't needed and TAILQ_EMPTY() could be used instead. In the following case, it would remove one loop. Index: pci/if_xl.c =================================================================== RCS file: /home/ncvs/src/sys/pci/if_xl.c,v retrieving revision 1.90 diff -u -r1.90 if_xl.c --- pci/if_xl.c 2001/02/03 16:29:10 1.90 +++ pci/if_xl.c 2001/02/04 16:11:58 @@ -808,7 +808,7 @@ return; } - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) mcnt++; if (mcnt) On 04-Feb-2001 Poul-Henning Kamp wrote: | | http://phk.freebsd.dk/patch | | 2001-02-04 if_multiaddrs.patch | | Convert if_multiaddrs from LIST to TAILQ so that it can | be traversed backwards also. | | To be committed 2001-02-08 | -- Mike Heffner Blacksburg, VA ICQ# 882073 http://filebox.vt.edu/users/mheffner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Feb 4 16:27: 6 2001 Delivered-To: freebsd-audit@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id E710B37B401 for ; Sun, 4 Feb 2001 16:26:41 -0800 (PST) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.2/8.11.2) with ESMTP id f150QZ207592 for ; Mon, 5 Feb 2001 00:26:39 GMT (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.2/8.11.1) with ESMTP id f150SNa01592; Mon, 5 Feb 2001 00:28:23 GMT (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200102050028.f150SNa01592@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: freebsd-audit@FreeBSD.org Cc: Brian Somers Subject: Reporting failed secondary dns transfers from /etc/security Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 05 Feb 2001 00:28:23 +0000 From: Brian Somers Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, Any thoughts/objections to this ? It's half of a suggestion made by glenn@intextonline.com in April 2000 (posted to freebsd-bugs). The other half is to display the output of ``netstat -rn'' - something I don't plan on adding as it wouldn't fit in very well with people running routing daemons. I'll commit this in a few days if nobody objects. -- Brian Don't _EVER_ lose your sense of humour ! Index: security =================================================================== RCS file: /home/ncvs/src/etc/security,v retrieving revision 1.46 diff -u -r1.46 security --- security 2001/02/03 01:28:46 1.46 +++ security 2001/02/05 00:20:55 @@ -197,6 +197,13 @@ n=$(catmsgs | grep -i "^$yesterday.*refused connect" | tee /dev/stderr | wc -l) [ $n -gt 0 -a $rc -lt 1 ] && rc=1 +# Show denied secondary bind transfer attempts +# +separator +echo "$host checking for denied secondary zone transfers:" +n=$(catmsgs | grep -i "unapproved AXFR from" | tee /dev/stderr | wc -l) +[ $n -gt 0 -a $rc -lt 1 ] && rc=1 + rm -f ${TMP} exit $rc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Feb 4 20:39:33 2001 Delivered-To: freebsd-audit@freebsd.org Received: from citusc17.usc.edu (citusc17.usc.edu [128.125.38.177]) by hub.freebsd.org (Postfix) with ESMTP id 88C0737B401 for ; Sun, 4 Feb 2001 20:39:15 -0800 (PST) Received: (from kris@localhost) by citusc17.usc.edu (8.11.1/8.11.1) id f155Oui96977; Sun, 4 Feb 2001 21:24:56 -0800 (PST) (envelope-from kris) Date: Sun, 4 Feb 2001 21:24:51 -0800 From: Kris Kennaway To: Brian Somers Cc: freebsd-audit@FreeBSD.ORG Subject: Re: Reporting failed secondary dns transfers from /etc/security Message-ID: <20010204212451.A96886@citusc17.usc.edu> References: <200102050028.f150SNa01592@hak.lan.Awfulhak.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200102050028.f150SNa01592@hak.lan.Awfulhak.org>; from brian@Awfulhak.org on Mon, Feb 05, 2001 at 12:28:23AM +0000 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 05, 2001 at 12:28:23AM +0000, Brian Somers wrote: > Hi, >=20 > Any thoughts/objections to this ? It's half of a suggestion made by=20 Good idea - looks fine to me! Kris --=20 NOTE: To fetch an updated copy of my GPG key which has not expired, finger kris@FreeBSD.org --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE6fjkjWry0BWjoQKURApmvAJ9UIm+VdbdvTTRvRGJnt1zdnu/7/gCfSzDx cUgrYkKYZS+hZfIZLsyYPeE= =BzBY -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Feb 6 16:25:45 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.gmx.net (pop.gmx.de [194.221.183.20]) by hub.freebsd.org (Postfix) with SMTP id 196F837B401 for ; Tue, 6 Feb 2001 16:25:27 -0800 (PST) Received: (qmail 15708 invoked by uid 0); 7 Feb 2001 00:25:25 -0000 Received: from p3e9bc2c4.dip.t-dialin.net (HELO forge.local) (62.155.194.196) by mail.gmx.net (mail02) with SMTP; 7 Feb 2001 00:25:25 -0000 Received: from thomas by forge.local with local (Exim 3.20 #1) id 14QIQC-000E20-00 for ; Wed, 07 Feb 2001 01:25:20 +0100 Date: Wed, 7 Feb 2001 01:25:20 +0100 From: Thomas Moestl To: freebsd-audit@freebsd.org Subject: patches to remove setgid kmem from systat Message-ID: <20010207012520.A53599@crow.dom2ip.de> Mail-Followup-To: Thomas Moestl , freebsd-audit@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, here is a second set of patches (partly dependent on those previously posted for top), this time to remove setgid kmem from systat. Most data needed for systat -vmstat was already exported; I needed to add three sysctls, hw.nintr, hw.intrnames and hw.intrcnt. Those export the number of interrups, a list of zero-terminated interrupt names and a list if interrupt counters. I did not split the lists into various sysctls because I wanted to keep the old structures in the kernel (other programs might still use it), and doing it with the existing structures would be kind of a hassle. I think that is OK, though. For this, I had to add an include file for i386 and change one for alpha and ia64; I do not expect problems, but it would be good if someone could do a test-compile on one of these archs. systat -netstat uses only information that is currently exported via sysctl. For a large number of sockets, the new code might be slow, so the kvm code is still used if we have the privileges to access the relevant devices. For normal use, I think it is OK to remove setgid. The new patches are at: - for systat: http://www.tu-bs.de/~y0015675/systat.diff - for the kernel: http://www.tu-bs.de/~y0015675/sysctl2.diff The top changes are at: - for top: http://www.tu-bs.de/~y0015675/top.diff - for libkvm: http://www.tu-bs.de/~y0015675/libkvm.diff - for the kernel: http://www.tu-bs.de/~y0015675/sysctl.diff (those have been updated since my last post to remove some compile-time warnings, most of which weren't my fault ;-) Could these patches please reviewed and committed if OK? - thomas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Feb 6 22:37:11 2001 Delivered-To: freebsd-audit@freebsd.org Received: from dragon.nuxi.com (trang.nuxi.com [209.152.133.57]) by hub.freebsd.org (Postfix) with ESMTP id 9BCCA37B491; Tue, 6 Feb 2001 22:36:52 -0800 (PST) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.2/8.11.1) id f176aiF95368; Tue, 6 Feb 2001 22:36:44 -0800 (PST) (envelope-from obrien) Date: Tue, 6 Feb 2001 22:36:44 -0800 From: "David O'Brien" To: Warner Losh Cc: freebsd-audit@FreeBSD.ORG, freebsd-bugs@FreeBSD.ORG Subject: Re: bin/23944: Proposed modification to ftpd Message-ID: <20010206223644.A95171@dragon.nuxi.com> Reply-To: audit@FreeBSD.ORG References: <20010107091220.B94566@dragon.nuxi.com> <20010107085658.A94429@dragon.nuxi.com> <3A536F7C.71DA4C2E@colltech.com> <200101041351.KAA96373@ns1.via-net-works.net.ar> <20010107085658.A94429@dragon.nuxi.com> <200101071701.f07H1Ts32049@harmony.village.org> <20010107091220.B94566@dragon.nuxi.com> <200101071723.f07HNMs32219@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200101071723.f07HNMs32219@harmony.village.org>; from imp@harmony.village.org on Sun, Jan 07, 2001 at 10:23:22AM -0700 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Jan 07, 2001 at 10:23:22AM -0700, Warner Losh wrote: > In message <20010107091220.B94566@dragon.nuxi.com> "David O'Brien" writes: > : I'll forward them to Luke. You were also one that wanted to see us use a > : common ftpd. IMO we can loose a few of those features to get all the > : features LukeFTPD gives us. Or is someone going to add the features to > : our ftpd so that so many poeple can stop using wu-ftpd and proftpd -- we > : know about their vunlerability records. > > I want a common ftpd. Has anything happened on this? -- -- David (obrien@FreeBSD.org) GNU is Not Unix / Linux Is Not UniX To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Feb 7 15: 1: 9 2001 Delivered-To: freebsd-audit@freebsd.org Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.161.193]) by hub.freebsd.org (Postfix) with ESMTP id C261637B6C4 for ; Wed, 7 Feb 2001 15:00:51 -0800 (PST) Received: from mail.vt.edu (gkar.cc.vt.edu [198.82.161.190]) by lennier.cc.vt.edu (8.11.0/8.11.0) with ESMTP id f17N0ou377417 for ; Wed, 7 Feb 2001 18:00:51 -0500 (EST) Received: from enterprise.muriel.penguinpowered.com ([198.82.100.151]) by gkar.cc.vt.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0G8E00LS0T9DJI@gkar.cc.vt.edu> for FreeBSD-audit@freebsd.org; Wed, 7 Feb 2001 18:00:49 -0500 (EST) Date: Wed, 07 Feb 2001 18:00:49 -0500 (EST) From: Mike Heffner Subject: RE: lam(1) patch In-reply-to: To: Mike Heffner Cc: FreeBSD-audit Message-id: MIME-version: 1.0 X-Mailer: XFMail 1.4.7 on FreeBSD Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 8bit X-Priority: 3 (Normal) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 26-Jan-2001 Mike Heffner wrote: | | The following patch fixes the following: | | - sprintf() -> snprintf() | - manual (unbounded) while() loop string copying -> strlcpy() | - use tolower() rather than bit or'ing | - sanity check the user specified printf() format | - prevent walking off end of inputfile array | - some other string bounds issues | | Reviews please? | | | Also available from: | http://filebox.vt.edu/users/mheffner/patches/lam.patch Any objections to me committing this? Also, should I follow it up with a de-__P() patch? -- Mike Heffner Blacksburg, VA http://filebox.vt.edu/users/mheffner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Feb 7 15:19:13 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (unknown [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 3F88B37B6C3 for ; Wed, 7 Feb 2001 15:18:54 -0800 (PST) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.1/8.11.1) with ESMTP id f17NIj996425; Wed, 7 Feb 2001 16:18:46 -0700 (MST) (envelope-from imp@harmony.village.org) Message-Id: <200102072318.f17NIj996425@harmony.village.org> To: Mike Heffner Subject: Re: lam(1) patch Cc: FreeBSD-audit In-reply-to: Your message of "Wed, 07 Feb 2001 18:00:49 EST." References: Date: Wed, 07 Feb 2001 16:18:45 -0700 From: Warner Losh Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message Mike Heffner writes: : | Also available from: : | http://filebox.vt.edu/users/mheffner/patches/lam.patch : Any objections to me committing this? @@ -130,7 +131,7 @@ ip++; continue; } - switch (*(c = ++p) | 040) { + switch (tolower(*(c = ++p))) { case 's': if (*++p || (p = *++av)) ip->sepstring = p; The tolower function will only evaluate the arguments once, but the tolower macro might evaluate them multiple times. Maybe I'm recalling things too far back. In any event, I'd be tempted to write it like: + c = ++p; + switch (tolower(*c)) { @@ -175,13 +182,12 @@ pad(ip) struct openfile *ip; { - register char *p = ip->sepstring; - register char *lp = linep; + char *lp = linep; - while (*p) - *lp++ = *p++; + strlcpy(lp, ip->sepstring, line + sizeof(line) - lp); + lp += strlen(lp); if (ip->pad) { - sprintf(lp, ip->format, ""); + snprintf(lp, line + sizeof(line) - lp, ip->format, ""); lp += strlen(lp); } return (lp); This appaers to introduce an extra dependencies on line. However, pad() and gatherline() already depend on this to an unhealthy degree, so you aren't introducing any really gross. The code is already somewhat gross :-(. : Also, should I follow it up with a de-__P() patch? Yes. So long as you make all the old K&R style decls into ANSI ones at the same time. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Feb 7 16: 8:44 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id 8766A37B65D for ; Wed, 7 Feb 2001 16:08:26 -0800 (PST) Received: by gw.nectar.com (Postfix, from userid 1001) id 05C8718C93; Wed, 7 Feb 2001 18:08:25 -0600 (CST) Date: Wed, 7 Feb 2001 18:08:25 -0600 From: "Jacques A. Vidrine" To: Warner Losh Cc: Mike Heffner , FreeBSD-audit Subject: Re: lam(1) patch Message-ID: <20010207180825.A85807@spawn.nectar.com> Mail-Followup-To: "Jacques A. Vidrine" , Warner Losh , Mike Heffner , FreeBSD-audit References: <200102072318.f17NIj996425@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200102072318.f17NIj996425@harmony.village.org>; from imp@harmony.village.org on Wed, Feb 07, 2001 at 04:18:45PM -0700 X-Url: http://www.nectar.com/ Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Feb 07, 2001 at 04:18:45PM -0700, Warner Losh wrote: > The tolower function will only evaluate the arguments once, but the > tolower macro might evaluate them multiple times. Maybe I'm recalling > things too far back. C99 7.1.4.1 says, ``Any invocation of a library function that is implemented as a macro shall expand to code that evaluates each of its arguments exactly once, fully protected by parentheses where necessary, so it is generally safe to use arbitrary expressions as arguments.'' Our tolower is implemented as an inline. I'd like to know when this was first spelled out -- I don't have a C89 reference handy. Cheers, -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Feb 7 18:12: 6 2001 Delivered-To: freebsd-audit@freebsd.org Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.161.193]) by hub.freebsd.org (Postfix) with ESMTP id 44FB037B503 for ; Wed, 7 Feb 2001 18:11:46 -0800 (PST) Received: from mail.vt.edu (gkar.cc.vt.edu [198.82.161.190]) by lennier.cc.vt.edu (8.11.0/8.11.0) with ESMTP id f182Biu431207; Wed, 7 Feb 2001 21:11:44 -0500 (EST) Received: from enterprise.muriel.penguinpowered.com ([198.82.100.151]) by gkar.cc.vt.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0G8F00NWT23J2Q@gkar.cc.vt.edu>; Wed, 7 Feb 2001 21:11:43 -0500 (EST) Date: Wed, 07 Feb 2001 21:11:43 -0500 (EST) From: Mike Heffner Subject: Re: lam(1) patch In-reply-to: <20010207180825.A85807@spawn.nectar.com> To: "Jacques A. Vidrine" Cc: FreeBSD-audit Cc: FreeBSD-audit , Warner Losh Message-id: MIME-version: 1.0 X-Mailer: XFMail 1.4.7 on FreeBSD Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 8bit X-Priority: 3 (Normal) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Even though our implementation is inlined, I think I'll take Warner's suggestion so that it's clear. As I found out in the following, it wasn't what I would have expected: #define xtolower(c) ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z'))) int main(int ac, char **av) { char *c, *p = "HELLO"; switch(xtolower(*(c = ++p))) { default: printf("Char: '%c'\n", *c); } printf("String: '%s'\n", p); } [spock@enterprise]:117 $ ./test Char: 'L' String: 'LO' On 08-Feb-2001 Jacques A. Vidrine wrote: | On Wed, Feb 07, 2001 at 04:18:45PM -0700, Warner Losh wrote: |> The tolower function will only evaluate the arguments once, but the |> tolower macro might evaluate them multiple times. Maybe I'm recalling |> things too far back. | | C99 7.1.4.1 says, ``Any invocation of a library function that is | implemented as a macro shall expand to code that evaluates each of its | arguments exactly once, fully protected by parentheses where necessary, | so it is generally safe to use arbitrary expressions as arguments.'' | | Our tolower is implemented as an inline. | | I'd like to know when this was first spelled out -- I don't have a | C89 reference handy. | | Cheers, | -- | Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org | | | To Unsubscribe: send mail to majordomo@FreeBSD.org | with "unsubscribe freebsd-audit" in the body of the message -- Mike Heffner Blacksburg, VA http://filebox.vt.edu/users/mheffner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Feb 7 18:39:24 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (unknown [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 9120D37B401 for ; Wed, 7 Feb 2001 18:39:07 -0800 (PST) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.1/8.11.1) with ESMTP id f182d3997909; Wed, 7 Feb 2001 19:39:03 -0700 (MST) (envelope-from imp@harmony.village.org) Message-Id: <200102080239.f182d3997909@harmony.village.org> To: Mike Heffner Subject: Re: lam(1) patch Cc: "Jacques A. Vidrine" , FreeBSD-audit In-reply-to: Your message of "Wed, 07 Feb 2001 21:11:43 EST." References: Date: Wed, 07 Feb 2001 19:39:03 -0700 From: Warner Losh Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message Mike Heffner writes: : Even though our implementation is inlined, I think I'll take : Warner's suggestion so that it's clear. As I found out in the : following, it wasn't what I would have expected: Yes. That's the point I was trying to make. At one time your xlower #define was considered "standards conforming" but times have changed. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Feb 8 7:38:54 2001 Delivered-To: freebsd-audit@freebsd.org Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.161.193]) by hub.freebsd.org (Postfix) with ESMTP id 8C4E037B401 for ; Thu, 8 Feb 2001 07:38:34 -0800 (PST) Received: from mail.vt.edu (gkar.cc.vt.edu [198.82.161.190]) by lennier.cc.vt.edu (8.11.0/8.11.0) with ESMTP id f18FcWu40865; Thu, 8 Feb 2001 10:38:32 -0500 (EST) Received: from enterprise.muriel.penguinpowered.com ([198.82.100.151]) by gkar.cc.vt.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0G8G000JN3G6FC@gkar.cc.vt.edu>; Thu, 8 Feb 2001 10:38:30 -0500 (EST) Date: Thu, 08 Feb 2001 10:38:30 -0500 (EST) From: Mike Heffner Subject: Re: lam(1) patch In-reply-to: <200102072318.f17NIj996425@harmony.village.org> To: Warner Losh Cc: FreeBSD-audit Message-id: MIME-version: 1.0 X-Mailer: XFMail 1.4.7 on FreeBSD Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 8bit X-Priority: 3 (Normal) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 07-Feb-2001 Warner Losh wrote: | In message Mike Heffner writes: |: | Also available from: |: | http://filebox.vt.edu/users/mheffner/patches/lam.patch |: Any objections to me committing this? [ snip ] |: Also, should I follow it up with a de-__P() patch? | | Yes. So long as you make all the old K&R style decls into ANSI ones | at the same time. | Ok, after screwing up the last style patch, here is a the latest version I've put together. I think this fulfills all the style(9) requirements and everyones comments from the last patch (accept keeping the K&R style). Spaces after function names were removed and the char** has been restored to char *[]. Index: lam.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lam/lam.c,v retrieving revision 1.6 diff -u -r1.6 lam.c --- lam.c 2001/02/08 05:58:55 1.6 +++ lam.c 2001/02/08 15:28:50 @@ -73,13 +73,13 @@ char line[BIGBUFSIZ]; char *linep; -char *gatherline (struct openfile *); -void getargs (char **); -char *pad (struct openfile *); -static void usage (void); +char *gatherline(struct openfile *); +void getargs(char *[]); +char *pad(struct openfile *); +static void usage(void); int -main(int argc, char **argv) +main(int argc, char *argv[]) { struct openfile *ip; @@ -100,7 +100,7 @@ } void -getargs(char **av) +getargs(char *av[]) { struct openfile *ip = input; char *p, *c; (also at: http://filebox.vt.edu/users/mheffner/patches/lam.style.patch) -- Mike Heffner Blacksburg, VA http://filebox.vt.edu/users/mheffner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Feb 8 13:19: 6 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id A8BD237B401 for ; Thu, 8 Feb 2001 13:18:46 -0800 (PST) Received: from hamlet.nectar.com (hamlet.nectar.com [10.0.1.102]) by gw.nectar.com (Postfix) with ESMTP id 2B33D18C93 for ; Thu, 8 Feb 2001 15:18:46 -0600 (CST) Received: (from nectar@localhost) by hamlet.nectar.com (8.11.2/8.9.3) id f18LIkt58897 for freebsd-audit@freebsd.org; Thu, 8 Feb 2001 15:18:46 -0600 (CST) (envelope-from nectar@spawn.nectar.com) Date: Thu, 8 Feb 2001 15:18:45 -0600 From: "Jacques A. Vidrine" To: freebsd-audit@freebsd.org Subject: login: exporting PAM environment Message-ID: <20010208151845.A58884@hamlet.nectar.com> Mail-Followup-To: "Jacques A. Vidrine" , freebsd-audit@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Url: http://www.nectar.com/ Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, Please have a look at the following patch. This corrects login so that it exports environmental variables set by PAM modules. This is particularly important for certain options of pam_krb5. --- login.c.orig Thu Feb 8 07:14:50 2001 +++ login.c Thu Feb 8 15:13:44 2001 @@ -106,6 +106,8 @@ #ifndef NO_PAM static int auth_pam __P((void)); +static int export_pam_environment __P((void)); +static int ok_to_export __P((const char *)); #endif static int auth_traditional __P((void)); extern void login __P((struct utmp *)); @@ -128,6 +130,9 @@ int failures; char *term, *envinit[1], *hostname, *username, *tty; char full_hostname[MAXHOSTNAMELEN]; +#ifndef NO_PAM +static char **environ_pam; +#endif int main(argc, argv) @@ -548,6 +553,15 @@ if (!pflag) environ = envinit; +#ifndef NO_PAM + /* + * Add any environmental variables that the + * PAM modules may have set. + */ + if (environ_pam) + export_pam_environment(); +#endif + /* * We don't need to be root anymore, so * set the user and session context @@ -718,6 +732,7 @@ PAM_SUCCESS) syslog(LOG_ERR, "Couldn't establish credentials: %s", pam_strerror(pamh, e)); + environ_pam = pam_getenvlist(pamh); rval = 0; break; @@ -737,6 +752,47 @@ rval = -1; } return rval; +} + +static int +export_pam_environment() +{ + char **pp; + + for (pp = environ_pam; *pp != NULL; pp++) { + if (ok_to_export(*pp)) + (void) putenv(*pp); + free(*pp); + } + return PAM_SUCCESS; +} + +/* + * Sanity checks on PAM environmental variables: + * - Make sure there is an '=' in the string. + * - Make sure the string doesn't run on too long. + * - Do not export certain variables. This list was taken from the + * Solaris pam_putenv(3) man page. + */ +static int +ok_to_export(s) + const char *s; +{ + static const char *noexport[] = { + "SHELL", "HOME", "LOGNAME", "MAIL", "CDPATH", + "IFS", "PATH", NULL + }; + const char **pp; + + if (strlen(s) > 1024 || strchr(s, '=') == NULL) + return 0; + if (strncmp(s, "LD_", 3) == 0) + return 0; + for (pp = noexport; *pp != NULL; pp++) { + if (strcmp(s, *pp) == 0) + return 0; + } + return 1; } #endif /* NO_PAM */ Cheers, -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Feb 8 15:36:15 2001 Delivered-To: freebsd-audit@freebsd.org Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.161.193]) by hub.freebsd.org (Postfix) with ESMTP id 0044037B401 for ; Thu, 8 Feb 2001 15:35:54 -0800 (PST) Received: from mail.vt.edu (gkar.cc.vt.edu [198.82.161.190]) by lennier.cc.vt.edu (8.11.0/8.11.0) with ESMTP id f18NZnu161513; Thu, 8 Feb 2001 18:35:49 -0500 (EST) Received: from enterprise.muriel.penguinpowered.com ([198.82.100.151]) by gkar.cc.vt.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0G8G00KBAPJOQU@gkar.cc.vt.edu>; Thu, 8 Feb 2001 18:35:48 -0500 (EST) Date: Thu, 08 Feb 2001 18:35:47 -0500 (EST) From: Mike Heffner Subject: RE: login: exporting PAM environment In-reply-to: <20010208151845.A58884@hamlet.nectar.com> To: "Jacques A. Vidrine" Cc: freebsd-audit@freebsd.org Message-id: MIME-version: 1.0 X-Mailer: XFMail 1.4.7 on FreeBSD Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 8bit X-Priority: 3 (Normal) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 08-Feb-2001 Jacques A. Vidrine wrote: | Hello, | | Please have a look at the following patch. This corrects login so | that it exports environmental variables set by PAM modules. This is | particularly important for certain options of pam_krb5. [ snip ] | +static int | +ok_to_export(s) | + const char *s; | +{ | + static const char *noexport[] = { | + "SHELL", "HOME", "LOGNAME", "MAIL", "CDPATH", | + "IFS", "PATH", NULL | + }; | + const char **pp; | + | + if (strlen(s) > 1024 || strchr(s, '=') == NULL) | + return 0; | + if (strncmp(s, "LD_", 3) == 0) | + return 0; | + for (pp = noexport; *pp != NULL; pp++) { | + if (strcmp(s, *pp) == 0) | + return 0; This needs to be strncmp(s, *pp, strlen(*pp)), otherwise the comparison will always fail. -- Mike Heffner Blacksburg, VA http://filebox.vt.edu/users/mheffner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Feb 8 17:18:37 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id 6CA2837B69D for ; Thu, 8 Feb 2001 17:18:19 -0800 (PST) Received: by gw.nectar.com (Postfix, from userid 1001) id 7016618C93; Thu, 8 Feb 2001 19:18:18 -0600 (CST) Date: Thu, 8 Feb 2001 19:18:18 -0600 From: "Jacques A. Vidrine" To: Mike Heffner Cc: freebsd-audit@freebsd.org Subject: Re: login: exporting PAM environment Message-ID: <20010208191818.A91745@spawn.nectar.com> Mail-Followup-To: "Jacques A. Vidrine" , Mike Heffner , freebsd-audit@freebsd.org References: <20010208151845.A58884@hamlet.nectar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mheffner@vt.edu on Thu, Feb 08, 2001 at 06:35:47PM -0500 X-Url: http://www.nectar.com/ Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Feb 08, 2001 at 06:35:47PM -0500, Mike Heffner wrote: > | +static int > | +ok_to_export(s) > | + const char *s; > | +{ > | + static const char *noexport[] = { > | + "SHELL", "HOME", "LOGNAME", "MAIL", "CDPATH", > | + "IFS", "PATH", NULL > | + }; > | + const char **pp; > | + > | + if (strlen(s) > 1024 || strchr(s, '=') == NULL) > | + return 0; > | + if (strncmp(s, "LD_", 3) == 0) > | + return 0; > | + for (pp = noexport; *pp != NULL; pp++) { > | + if (strcmp(s, *pp) == 0) > | + return 0; > > This needs to be strncmp(s, *pp, strlen(*pp)), otherwise the comparison will > always fail. Duh, oh yeah, thanks. Good catch. That's not quite right either, though. Think MAILDIR, for example. I'll fix it some other way. -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Feb 9 0:35:18 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (pool180-tch-2.Sofia.0rbitel.net [212.95.171.180]) by hub.freebsd.org (Postfix) with SMTP id 73A2737B491 for ; Fri, 9 Feb 2001 00:34:59 -0800 (PST) Received: (qmail 2617 invoked by uid 1000); 9 Feb 2001 08:33:14 -0000 Date: Fri, 9 Feb 2001 10:33:14 +0200 From: Peter Pentchev To: "Jacques A. Vidrine" Cc: Mike Heffner , freebsd-audit@freebsd.org Subject: Re: login: exporting PAM environment Message-ID: <20010209103314.A348@ringworld.oblivion.bg> Mail-Followup-To: "Jacques A. Vidrine" , Mike Heffner , freebsd-audit@freebsd.org References: <20010208151845.A58884@hamlet.nectar.com> <20010208191818.A91745@spawn.nectar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010208191818.A91745@spawn.nectar.com>; from n@nectar.com on Thu, Feb 08, 2001 at 07:18:18PM -0600 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Feb 08, 2001 at 07:18:18PM -0600, Jacques A. Vidrine wrote: > On Thu, Feb 08, 2001 at 06:35:47PM -0500, Mike Heffner wrote: > > | +static int > > | +ok_to_export(s) > > | + const char *s; > > | +{ > > | + static const char *noexport[] = { > > | + "SHELL", "HOME", "LOGNAME", "MAIL", "CDPATH", > > | + "IFS", "PATH", NULL > > | + }; > > | + const char **pp; > > | + > > | + if (strlen(s) > 1024 || strchr(s, '=') == NULL) > > | + return 0; > > | + if (strncmp(s, "LD_", 3) == 0) > > | + return 0; > > | + for (pp = noexport; *pp != NULL; pp++) { > > | + if (strcmp(s, *pp) == 0) > > | + return 0; > > > > This needs to be strncmp(s, *pp, strlen(*pp)), otherwise the comparison will > > always fail. > > Duh, oh yeah, thanks. Good catch. That's not quite right either, > though. Think MAILDIR, for example. I'll fix it some other way. Well, you could always tag a " && (s[strlen(pp)] == '=') " or something.. brrr.. ugly :( G'luck, Peter -- If this sentence were in Chinese, it would say something else. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Feb 10 18: 5:24 2001 Delivered-To: freebsd-audit@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id 84FAF37B4EC for ; Sat, 10 Feb 2001 18:05:05 -0800 (PST) Received: from zeppo.feral.com (IDENT:mjacob@zeppo [192.67.166.71]) by feral.com (8.9.3/8.9.3) with ESMTP id SAA29388; Sat, 10 Feb 2001 18:05:06 -0800 Date: Sat, 10 Feb 2001 18:05:03 -0800 (PST) From: Matthew Jacob Reply-To: mjacob@feral.com To: audit@freebsd.org Cc: "Kenneth D. Merry" , "Justin T. Gibbs" , Gerard Roudier Subject: a couple of minor but important changes to SCSI error handling Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG First is scsi_all.c: Index: scsi_all.c =================================================================== RCS file: /home/ncvs/src/sys/cam/scsi/scsi_all.c,v retrieving revision 1.17 diff -u -r1.17 scsi_all.c --- scsi_all.c 2000/10/30 08:08:00 1.17 +++ scsi_all.c 2001/02/11 02:03:01 @@ -2177,16 +2177,16 @@ /* These should be filtered by the peripheral drivers */ /* FALLTHROUGH */ case SSD_KEY_MISCOMPARE: - print_sense = FALSE; - /* FALLTHROUGH */ - case SSD_KEY_RECOVERED_ERROR: - /* decrement the number of retries */ retry = ccb->ccb_h.retry_count > 0; - if (retry) + if (retry) { + error = ERESTART; ccb->ccb_h.retry_count--; - - error = 0; + } else { + error = EIO; + } + case SSD_KEY_RECOVERED_ERROR: + error = 0; /* not an error */ break; case SSD_KEY_ILLEGAL_REQUEST: if (((sense_flags & SF_QUIET_IR) != 0) @@ -2241,6 +2241,7 @@ } } break; + case SSD_KEY_ABORTED_COMMAND: default: /* decrement the number of retries */ retry = ccb->ccb_h.retry_count > 0; @@ -2255,6 +2256,13 @@ error = error_action & SS_ERRMASK; } + /* + * Make sure ABORTED COMMAND errors get + * printed as they're indicative of marginal + * SCSI busses that people should address. + */ + if (sense_key == SSD_KEY_ABORTED_COMMAND) + print_sense = TRUE; } break; } --------------------- 1. The key SSD_KEY_RECOVERED_ERROR is not an error at all and should not be retried. It is an indication that there was an error that was corrected during the execution of the command. This is per ANSI SCSI2 spec. It's possible that these should also be noted to the console (as indicative, perhaps, of growing media defect lists in drives), but the default of printing errors out if bootverbose in this case is probably enough. Also, there'd been a missing ERESTART for that clause anyway. 2. If you have an ABORTED COMMAND, it's almost invariably a SCSI parity error. You should never be silent about these since users should do something about this if it occurs (moving that power cord *away* from the SCSI cable is always a good first start). This should print irrespective of bootverbose because it's an actual real error even if we retry a transmission. Second is scsi_da.c: Index: scsi_da.c =================================================================== RCS file: /home/ncvs/src/sys/cam/scsi/scsi_da.c,v retrieving revision 1.65 diff -u -r1.65 scsi_da.c --- scsi_da.c 2001/02/07 07:05:58 1.65 +++ scsi_da.c 2001/02/11 01:59:42 @@ -1127,7 +1127,7 @@ tag_code = MSG_SIMPLE_Q_TAG; } scsi_read_write(&start_ccb->csio, - /*retries*/4, + /*retries*/10, /* retry a few times */ dadone, tag_code, bp->bio_cmd == BIO_READ, ------ 10 retries with a .5 second delay between each is still only 5 seconds. 10 retries might be more appropriate to a SAN environment with at least a couple of seconds of different initiators spasming the loop. -matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Feb 10 21:23:58 2001 Delivered-To: freebsd-audit@freebsd.org Received: from aslan.scsiguy.com (mail.scsiguy.com [63.229.232.106]) by hub.freebsd.org (Postfix) with ESMTP id 78F2037B401 for ; Sat, 10 Feb 2001 21:23:41 -0800 (PST) Received: from scsiguy.com (localhost [127.0.0.1]) by aslan.scsiguy.com (8.11.2/8.9.3) with ESMTP id f1B5NbO10383; Sat, 10 Feb 2001 22:23:38 -0700 (MST) (envelope-from gibbs@scsiguy.com) Message-Id: <200102110523.f1B5NbO10383@aslan.scsiguy.com> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: mjacob@feral.com Cc: audit@freebsd.org, "Kenneth D. Merry" , Gerard Roudier Subject: Re: a couple of minor but important changes to SCSI error handling In-Reply-To: Your message of "Sat, 10 Feb 2001 18:05:03 PST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 10 Feb 2001 22:23:37 -0700 From: "Justin T. Gibbs" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >First is scsi_all.c: This looks fine. I also verified that the new error recovery code that Ken is reviewing right now also gets this right. >Second is scsi_da.c: ... >10 retries with a .5 second delay between each is still only 5 seconds. 10 >retries might be more appropriate to a SAN environment with at least a couple >of seconds of different initiators spasming the loop. Depending on the error, I don't know that we would necessarily delay or not here. If an initiator is spamming the loop, what does the peripheral driver see? A command timeout? Something reported as a "selection timeout"? If you can be more specific, perhaps we can make the da error handler smarter so that certain types of errors get additional retries (similar perhaps to how we do a series of TURs for some errors in cam_periph_error()). -- Justin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Feb 10 22: 2:35 2001 Delivered-To: freebsd-audit@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id 5647C37B401 for ; Sat, 10 Feb 2001 22:02:17 -0800 (PST) Received: from beppo (beppo [192.67.166.79]) by feral.com (8.9.3/8.9.3) with ESMTP id WAA29941; Sat, 10 Feb 2001 22:02:17 -0800 Date: Sat, 10 Feb 2001 22:02:13 -0800 (PST) From: Matthew Jacob Reply-To: mjacob@feral.com To: "Justin T. Gibbs" Cc: audit@freebsd.org, "Kenneth D. Merry" , Gerard Roudier Subject: Re: a couple of minor but important changes to SCSI error handling In-Reply-To: <200102110523.f1B5NbO10383@aslan.scsiguy.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 10 Feb 2001, Justin T. Gibbs wrote: > > > >First is scsi_all.c: > > This looks fine. I also verified that the new error recovery code that > Ken is reviewing right now also gets this right. Good! > > >Second is scsi_da.c: > > ... > > >10 retries with a .5 second delay between each is still only 5 seconds. 10 > >retries might be more appropriate to a SAN environment with at least a couple > >of seconds of different initiators spasming the loop. > > Depending on the error, I don't know that we would necessarily delay or not > here. If an initiator is spamming the loop, what does the peripheral driver > see? A command timeout? Something reported as a "selection timeout"? If > you can be more specific, perhaps we can make the da error handler smarter > so that certain types of errors get additional retries (similar perhaps to > how we do a series of TURs for some errors in cam_periph_error()). Well, the default action for selection timeout is to delay .5 seconds. That's what this affects. There's a bit of uncertainty when a device leaves the loop (or the fabric) as to really whether it's left for good or just temporarily. I'd like to give a device we'd seen before a bit more grace before we give up on it. When I did the Solaris SCSA stuff, I did 30 retries, but I didn't give it enough grace time- if it's device with mounted filesystems, you should give somebody a chance to see the message spewing out and enough time for them to go back and plug the cable back in that they unplugged. So, really, 5 seconds isn't enough..... this may be more in the new error recovery zone. Note that this affects the read/write code only- not the probe or sync cache or read capacity or 'other' code. -matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message