From owner-freebsd-audit Sun Aug 5 2:28:22 2001 Delivered-To: freebsd-audit@freebsd.org Received: from amsfep16-int.chello.nl (unknown [213.46.243.25]) by hub.freebsd.org (Postfix) with ESMTP id 8522237B403; Sun, 5 Aug 2001 02:28:18 -0700 (PDT) (envelope-from asmodai@wxs.nl) Received: from daemon.chronias.ninth-circle.org ([62.163.96.180]) by amsfep16-int.chello.nl (InterMail vM.5.01.03.06 201-253-122-118-106-20010523) with ESMTP id <20010805092507.IDHR2039.amsfep16-int.chello.nl@daemon.chronias.ninth-circle.org>; Sun, 5 Aug 2001 11:25:07 +0200 Received: (from asmodai@localhost) by daemon.chronias.ninth-circle.org (8.11.3/8.11.3) id f759S2193730; Sun, 5 Aug 2001 11:28:02 +0200 (CEST) (envelope-from asmodai) Date: Sun, 5 Aug 2001 11:28:02 +0200 From: Jeroen Ruigrok/Asmodai To: Alexey Zelkin Cc: Sheldon Hearn , Mike Barcroft , Peter Pentchev , audit@FreeBSD.org, ache@FreeBSD.org, des@FreeBSD.org, jabley@automagic.org Subject: Re: whois(1) new features for review Message-ID: <20010805112802.A93252@daemon.ninth-circle.org> References: <20010725120952.B77004@coffee.q9media.com> <6944.996077077@axl.seasidesoftware.co.za> <20010726174018.B28536@ark.cris.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010726174018.B28536@ark.cris.net> User-Agent: Mutt/1.3.19i Organisation: Ninth-Circle Enterprises 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 [20010726 17:21], Alexey Zelkin (phantom@FreeBSD.org) wrote: >According '-R' flag. I suggest to just document deprecation >of '-R' flag in manpage for 5.x branch. But in 4.x branch >make it in way proposed by Mike (runtime deprecation message) >and document it in manpage as well. That's a point of discussion btw: Since you introduce the changes in 5.0. Along with the deprecation points to be made. Therefore you remove the functionality in 6.0 and onward [next major release]. You do not touch 4.x, since that would mean a backport. Normally, in commercial environments (just for the sake of the discussion/through), you only backport fixes and not radical changes like this. [ObNote: Yes, I have been reading standards documents lately as well as maintaining and reading my share of commercial Unix systems and their associated documentation.] -- Jeroen Ruigrok van der Werven/Asmodai asmodai@[wxs.nl|freebsd.org|xmach.org] Documentation nutter/C-rated Coder, finger asmodai@ninth-circle.dnsalias.net http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/ We do not count a man's years, until he has nothing left to count... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Aug 5 7:19:34 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 63AD237B401; Sun, 5 Aug 2001 07:19:31 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id AAA18232; Mon, 6 Aug 2001 00:19:28 +1000 Date: Mon, 6 Aug 2001 00:16:56 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mike Barcroft Cc: Subject: Re: cmp(1) warns patch In-Reply-To: <20010804144439.A8069@coffee.q9media.com> Message-ID: <20010805235106.Y27651-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Sat, 4 Aug 2001, Mike Barcroft wrote: > On Sat, Aug 04, 2001 at 12:59:56PM +1000, Bruce Evans wrote: > > On Fri, 3 Aug 2001, Mike Barcroft wrote: > > > ... > > > Index: cmp/regular.c > > > =================================================================== > > > RCS file: /home/ncvs/src/usr.bin/cmp/regular.c,v > > > retrieving revision 1.10 > > > diff -u -r1.10 regular.c > > > --- cmp/regular.c 2000/06/20 20:28:40 1.10 > > > +++ cmp/regular.c 2001/08/04 01:02:33 > > > ... > > > @@ -81,7 +81,7 @@ > > > off2 = ROUNDPAGE(skip2); > > > > > > length = MIN(len1, len2); > > > - if (length > SIZE_T_MAX) > > > + if (length > (off_t)SIZE_T_MAX) > > > > This is broken on many machines, including alphas. On alphas, > > (off_t)SIZE_MAX overflows to -1, so `length' is always larger and the > > pessimized cspecial() method is always used. > ... > I guess I should have looked at the types a little more closely. Do > you have any suggestions for overcoming the comparison between signed > and unsigned warning on alpha? None very good. In general, the signed type must be promoted to a suitable unsigned type, but to do that you have to know too much about the signed type if that type is a typedefed type. Here we can't do anything better than promote to "unsigned long long". This assumes that "unsigned long long" can represent all possible file sizes. In the kernel, we could use uoff_t. I introduced uoff_t because promoting off_t's to an unsigned type is useful in other contexts. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Aug 5 8:30: 0 2001 Delivered-To: freebsd-audit@freebsd.org Received: from arb.arb.za.net (arb.arb.za.net [196.7.148.4]) by hub.freebsd.org (Postfix) with ESMTP id ABD3937B414 for ; Sun, 5 Aug 2001 08:29:54 -0700 (PDT) (envelope-from mark@grondar.za) Received: (from uucp@localhost) by arb.arb.za.net (8.11.3/8.11.3) with UUCP id f75FTqZ42541 for audit@freebsd.org; Sun, 5 Aug 2001 17:29:52 +0200 (SAST) (envelope-from mark@grondar.za) Received: from grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.za (8.11.5/8.11.4) with ESMTP id f75ExLZ04538 for ; Sun, 5 Aug 2001 15:59:21 +0100 (BST) (envelope-from mark@grondar.za) Message-Id: <200108051459.f75ExLZ04538@grimreaper.grondar.za> To: audit@freebsd.org Subject: New PAM Kerberos 5 (Heimdal) module. Date: Sun, 05 Aug 2001 15:59:21 +0100 From: Mark Murray 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 Hi all I have a new Kerberos5/Heimdal module for PAM, that is a whole bunch neater than its predecessor. Please look at and review this. http://people.freebsd.org/~markm/patches/pam_krb5.tar.gz (It is in a commit-ready state, and contains all the CVS/ dirs that I have locally) M -- Mark Murray Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Aug 5 19:59:13 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (unknown [217.75.135.248]) by hub.freebsd.org (Postfix) with SMTP id C68B037B401 for ; Sun, 5 Aug 2001 19:59:07 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 37697 invoked by uid 1000); 6 Aug 2001 02:57:59 -0000 Date: Mon, 6 Aug 2001 05:57:59 +0300 From: Peter Pentchev To: David O'Brien Cc: audit@FreeBSD.org Subject: [PATCH] fix a file(1) minor POLA stretching Message-ID: <20010806055759.E586@ringworld.oblivion.bg> Mail-Followup-To: David O'Brien , 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 List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, It seems that the new file(1), recently imported into -current and -stable, has a slightly changed behavior, which results in a minor POLA stretching (maybe not really a violation). This new version of file(1) can "compile" magic files into a new, binary database-like format. Whenever the file(1) utility is invoked to examine a file, it first tries to open this new binary magic db, and not finding it, falls back to the old, regular magic file. This results in a warning message sent to stderr for each and every invocation of file(1) :) The fix is simple: build and install the new magic database along with the old file. Patch attached. G'luck, Peter -- If I were you, who would be reading this sentence? Index: src/usr.bin/file/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/file/Makefile,v retrieving revision 1.18 diff -u -r1.18 Makefile --- src/usr.bin/file/Makefile 2001/07/30 03:50:04 1.18 +++ src/usr.bin/file/Makefile 2001/08/06 02:56:47 @@ -25,6 +25,7 @@ # Hacked and dismembered for bmake (Geoff Rehmet). MAGICFILE= /usr/share/misc/magic +MAGICDB= ${MAGICFILE}.mgc MAGICMODE= 444 SRCDIR= ${.CURDIR}/../../contrib/file @@ -40,17 +41,20 @@ MAN= file.1 magic.5 -CLEANFILES+= magic +CLEANFILES+= magic magic.mgc MAGFILES= ${SRCDIR}/Header\ ${SRCDIR}/Localstuff\ ${SRCDIR}/Magdir/[a-z]* -all: file magic +all: file magic magic.mgc magic: $(MAGFILES) cat $(MAGFILES) > $(.TARGET) +magic.mgc: file magic + ./file -C -m magic + CLEANFILES+= print-hacked.c print-hacked.c: print.c sed -e 's|daylight|0/*daylight*/|g' ${.ALLSRC} > ${.TARGET} @@ -58,5 +62,7 @@ beforeinstall: $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ magic $(DESTDIR)$(MAGICFILE) + $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ + magic.mgc $(DESTDIR)$(MAGICDB) .include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 6 1:17:55 2001 Delivered-To: freebsd-audit@freebsd.org Received: from axl.seasidesoftware.co.za (axl.seasidesoftware.co.za [196.31.7.201]) by hub.freebsd.org (Postfix) with ESMTP id 8CD2D37B403; Mon, 6 Aug 2001 01:17:52 -0700 (PDT) (envelope-from sheldonh@starjuice.net) Received: from sheldonh (helo=axl.seasidesoftware.co.za) by axl.seasidesoftware.co.za with local-esmtp (Exim 3.31 #1) id 15Tfb7-0003AR-00; Mon, 06 Aug 2001 10:18:49 +0200 From: Sheldon Hearn To: Peter Pentchev Cc: David O'Brien , audit@FreeBSD.org Subject: Re: [PATCH] fix a file(1) minor POLA stretching In-reply-to: Your message of "Mon, 06 Aug 2001 05:57:59 +0300." <20010806055759.E586@ringworld.oblivion.bg> Date: Mon, 06 Aug 2001 10:18:49 +0200 Message-ID: <12178.997085929@axl.seasidesoftware.co.za> 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 Mon, 06 Aug 2001 05:57:59 +0300, Peter Pentchev wrote: > The fix is simple: build and install the new magic database along > with the old file. Patch attached. Please commit this ASAP and ask re@FreeBSD.org for MFC permission. If you don't get MFC permission, please arrange for the file(1) update in RELENG_4 to be backed out. Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 6 7:21:52 2001 Delivered-To: freebsd-audit@freebsd.org Received: from dragon.nuxi.com (trang.nuxi.com [206.40.252.115]) by hub.freebsd.org (Postfix) with ESMTP id C4BEF37B401 for ; Mon, 6 Aug 2001 07:21:50 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.4/8.11.1) id f76EKwq79187; Mon, 6 Aug 2001 07:20:58 -0700 (PDT) (envelope-from obrien) Date: Mon, 6 Aug 2001 07:20:58 -0700 From: "David O'Brien" To: Sheldon Hearn Cc: Peter Pentchev , audit@FreeBSD.org Subject: Re: [PATCH] fix a file(1) minor POLA stretching Message-ID: <20010806072058.B78901@dragon.nuxi.com> Reply-To: obrien@FreeBSD.org References: <20010806055759.E586@ringworld.oblivion.bg> <12178.997085929@axl.seasidesoftware.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <12178.997085929@axl.seasidesoftware.co.za>; from sheldonh@starjuice.net on Mon, Aug 06, 2001 at 10:18:49AM +0200 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 List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Aug 06, 2001 at 10:18:49AM +0200, Sheldon Hearn wrote: > > The fix is simple: build and install the new magic database along > > with the old file. Patch attached. > > Please commit this ASAP and ask re@FreeBSD.org for MFC permission. If > you don't get MFC permission, please arrange for the file(1) update in > RELENG_4 to be backed out. I already have all the permission I need. Please be patient. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 6 13:24:45 2001 Delivered-To: freebsd-audit@freebsd.org Received: from obsecurity.dyndns.org (adsl-64-165-226-48.dsl.lsan03.pacbell.net [64.165.226.48]) by hub.freebsd.org (Postfix) with ESMTP id 1194F37B403; Mon, 6 Aug 2001 13:24:41 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 3382266CB5; Mon, 6 Aug 2001 13:24:38 -0700 (PDT) Date: Mon, 6 Aug 2001 13:24:37 -0700 From: Kris Kennaway To: David O'Brien Cc: Sheldon Hearn , Peter Pentchev , audit@FreeBSD.ORG Subject: Re: [PATCH] fix a file(1) minor POLA stretching Message-ID: <20010806132437.C34268@xor.obsecurity.org> References: <20010806055759.E586@ringworld.oblivion.bg> <12178.997085929@axl.seasidesoftware.co.za> <20010806072058.B78901@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="f+W+jCU1fRNres8c" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010806072058.B78901@dragon.nuxi.com>; from obrien@FreeBSD.ORG on Mon, Aug 06, 2001 at 07:20:58AM -0700 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 --f+W+jCU1fRNres8c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 06, 2001 at 07:20:58AM -0700, David O'Brien wrote: > On Mon, Aug 06, 2001 at 10:18:49AM +0200, Sheldon Hearn wrote: > > > The fix is simple: build and install the new magic database along > > > with the old file. Patch attached. > >=20 > > Please commit this ASAP and ask re@FreeBSD.org for MFC permission. If > > you don't get MFC permission, please arrange for the file(1) update in > > RELENG_4 to be backed out. >=20 > I already have all the permission I need. Please be patient. I've also been talking to Christos about the compilation bug on FreeBSD due to our very out of date tzcode code. I have a patch from him which works, but probably isn't going to go into the next release in the same form. Did you want it anyway? Kris --f+W+jCU1fRNres8c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7bv0EWry0BWjoQKURAjtmAJwJNm718MLi0p12c6Y4l+logstfhACfSCtp BnL5pHTDxO4EQx6O/Ai9UyU= =pVyp -----END PGP SIGNATURE----- --f+W+jCU1fRNres8c-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 6 13:39: 9 2001 Delivered-To: freebsd-audit@freebsd.org Received: from dragon.nuxi.com (trang.nuxi.com [206.40.252.115]) by hub.freebsd.org (Postfix) with ESMTP id A6CC837B401 for ; Mon, 6 Aug 2001 13:39:07 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.4/8.11.1) id f76KbxE83350; Mon, 6 Aug 2001 13:37:59 -0700 (PDT) (envelope-from obrien) Date: Mon, 6 Aug 2001 13:37:58 -0700 From: "David O'Brien" To: Kris Kennaway Cc: Sheldon Hearn , Peter Pentchev , audit@FreeBSD.ORG Subject: Re: [PATCH] fix a file(1) minor POLA stretching Message-ID: <20010806133758.A83311@dragon.nuxi.com> Reply-To: obrien@FreeBSD.ORG References: <20010806055759.E586@ringworld.oblivion.bg> <12178.997085929@axl.seasidesoftware.co.za> <20010806072058.B78901@dragon.nuxi.com> <20010806132437.C34268@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010806132437.C34268@xor.obsecurity.org>; from kris@obsecurity.org on Mon, Aug 06, 2001 at 01:24:37PM -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 List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Aug 06, 2001 at 01:24:37PM -0700, Kris Kennaway wrote: > I've also been talking to Christos about the compilation bug on > FreeBSD due to our very out of date tzcode code. I have a patch from > him which works, but probably isn't going to go into the next release > in the same form. Did you want it anyway? Please. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 7 8:41:38 2001 Delivered-To: freebsd-audit@freebsd.org Received: from arb.arb.za.net (arb.arb.za.net [196.7.148.4]) by hub.freebsd.org (Postfix) with ESMTP id D7C8C37B401 for ; Tue, 7 Aug 2001 08:41:29 -0700 (PDT) (envelope-from mark@grondar.za) Received: (from uucp@localhost) by arb.arb.za.net (8.11.3/8.11.3) with UUCP id f77FfTD07711 for audit@freebsd.org; Tue, 7 Aug 2001 17:41:29 +0200 (SAST) (envelope-from mark@grondar.za) Received: from grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.za (8.11.5/8.11.4) with ESMTP id f77Aw6Z43835 for ; Tue, 7 Aug 2001 11:58:06 +0100 (BST) (envelope-from mark@grondar.za) Message-Id: <200108071058.f77Aw6Z43835@grimreaper.grondar.za> To: audit@freebsd.org Subject: [patch] su(1) WARNS=2 cleanup Date: Tue, 07 Aug 2001 11:58:05 +0100 From: Mark Murray 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 Hi Please review. The PAM_SET_ITEM() thing is a separate commit. Thanks! M Index: Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/su/Makefile,v retrieving revision 1.32 diff -u -d -r1.32 Makefile --- Makefile 2001/05/26 09:52:36 1.32 +++ Makefile 2001/08/06 14:04:14 @@ -5,6 +5,7 @@ DPADD+= ${LIBUTIL} ${LIBPAM} LDADD+= -lutil ${MINUSLPAM} +WARNS?= 2 BINMODE=4555 INSTALLFLAGS=-fschg Index: su.c =================================================================== RCS file: /home/ncvs/src/usr.bin/su/su.c,v retrieving revision 1.39 diff -u -d -r1.39 su.c --- su.c 2001/05/26 09:52:36 1.39 +++ su.c 2001/08/06 14:07:11 @@ -67,7 +67,7 @@ #include #include -#define PAM_END do { \ +#define PAM_END() do { \ int local_ret; \ if (pamh != NULL && creds_set) { \ local_ret = pam_setcred(pamh, PAM_DELETE_CRED); \ @@ -120,9 +120,10 @@ gid_t gid; int asme, ch, asthem, fastlogin, prio, i, setwhat, retcode, statusp, child_pid, child_pgrp, ret_pid; - char *p, *user, *shell, *username, *cleanenv, **nargv, **np, - *class, *mytty, shellbuf[MAXPATHLEN], - myhost[MAXHOSTNAMELEN + 1]; + char *username, *cleanenv, **nargv, + *class, shellbuf[MAXPATHLEN], + myhost[MAXHOSTNAMELEN + 1], **np; + const char *p, *user, *shell, *mytty; shell = class = cleanenv = NULL; asme = asthem = fastlogin = statusp = 0; @@ -213,6 +214,8 @@ errx(1, "pam_start: %s", pam_strerror(pamh, retcode)); } + PAM_SET_ITEM(PAM_RUSER, (const void *)getlogin()); + gethostname(myhost, sizeof(myhost)); PAM_SET_ITEM(PAM_RHOST, myhost); @@ -325,11 +328,11 @@ } if (ret_pid == -1) err(1, "waitpid"); - PAM_END; + PAM_END(); exit(statusp); case -1: err(1, "fork"); - PAM_END; + PAM_END(); exit(1); case 0: /* @@ -378,18 +381,19 @@ if (iscsh == YES) { if (fastlogin) - *np-- = "-f"; + (const char *)(*np--) = "-f"; if (asme) - *np-- = "-m"; + (const char *)(*np--) = "-m"; } /* csh strips the first character... */ - *np = asthem ? "-su" : iscsh == YES ? "_su" : "su"; + (const char *)(*np) + = asthem ? "-su" : iscsh == YES ? "_su" : "su"; if (ruid != 0) syslog(LOG_NOTICE, "%s to %s%s", username, user, ontty()); - execv(shell, np); + execv(shell, (char * const *)np); err(1, "%s", shell); } } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 7 9:50: 4 2001 Delivered-To: freebsd-audit@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id 8CF2B37B403 for ; Tue, 7 Aug 2001 09:49:22 -0700 (PDT) (envelope-from dwmalone@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 7 Aug 2001 17:49:21 +0100 (BST) To: freebsd-audit@freebsd.org Cc: dwmalone@maths.tcd.ie Subject: Unix domain control messages. X-Request-Do: Date: Tue, 07 Aug 2001 17:49:21 +0100 From: David Malone Message-ID: <200108071749.aa74603@salmon.maths.tcd.ie> 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 I've produced a set of patches which aim to fix some of the problems with the unix domain control message passing code. I'm looking for someone who can review or comment on these changes. The patch aims to: 1) Allow the sending of more than one control message at a time over a unix domain socket. This should cover the recently submitted PR 29499. 2) This requires that unp_{ex,in}ternalize and unp_scan understand mbufs with more than one control message at a time. 3) Internalize and externalize used to work on the mbuf in-place. This made life quite complicated and the code for sizeof(int) < sizeof(file *) could end up doing the wrong thing. The patch always create a new mbuf/cluster now. Sbcreatecontrol has been extended to deal with this. 4) You can now send SCM_TIMESTAMP messages 'cos it was trivial to add. 5) Always use CMSG_DATA(cm) to determine the start where the data in unp_{ex,in}ternalize. It was using ((struct cmsghdr *)cm + 1) in some places, which gives the wrong alignment on the alpha. (NetBSD made this fix some time ago). 6) Fix userland programs to use CMSG_* macros too. 7) Be more careful about freeing mbufs containing (file *)s. To allow (7) and (2) I had to change the prototype of the domain externalize function. Since the unix domain is the only thing that uses the externalize method this isn't too serious. (5) results in an ABI change for the alpha. The old ABI isn't consistent with other uses of control messages in the kernel, isn't consistant with the ABI Stevens describes and isn't consistant with NetBSD. I think this suggests we can consider it a bug fix rather than something requiring new syscalls? (Passing of discriptors and creds is fairly rare so the impact should be small.) The code still has my debugging printfs in it, but I'd like to see if anyone could provide any useful feedback. David. Index: lib/libc/rpc/clnt_vc.c =================================================================== RCS file: /cvs/FreeBSD-CVS/src/lib/libc/rpc/clnt_vc.c,v retrieving revision 1.7 diff -u -r1.7 clnt_vc.c --- lib/libc/rpc/clnt_vc.c 2001/06/01 15:20:45 1.7 +++ lib/libc/rpc/clnt_vc.c 2001/07/15 15:18:58 @@ -793,7 +793,10 @@ { struct iovec iov[1]; struct msghdr msg; - struct cmessage cm; + union { + struct cmsghdr cmsg; + char control[CMSG_SPACE(sizeof(struct cmsgcred))]; + } cm; bzero((char *)&cm, sizeof(cm)); iov[0].iov_base = buf; @@ -804,7 +807,7 @@ msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_control = (caddr_t)&cm; - msg.msg_controllen = sizeof(struct cmessage); + msg.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred)); msg.msg_flags = 0; return(_recvmsg(sock, &msg, 0)); @@ -818,7 +821,10 @@ { struct iovec iov[1]; struct msghdr msg; - struct cmessage cm; + union { + struct cmsghdr cmsg; + char control[CMSG_SPACE(sizeof(struct cmsgcred))]; + } cm; bzero((char *)&cm, sizeof(cm)); iov[0].iov_base = buf; @@ -826,14 +832,14 @@ cm.cmsg.cmsg_type = SCM_CREDS; cm.cmsg.cmsg_level = SOL_SOCKET; - cm.cmsg.cmsg_len = sizeof(struct cmessage); + cm.cmsg.cmsg_len = CMSG_LEN(sizeof(struct cmsgcred)); msg.msg_iov = iov; msg.msg_iovlen = 1; msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_control = (caddr_t)&cm; - msg.msg_controllen = sizeof(struct cmessage); + msg.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred)); msg.msg_flags = 0; return(_sendmsg(sock, &msg, 0)); Index: lib/libc/rpc/svc_vc.c =================================================================== RCS file: /cvs/FreeBSD-CVS/src/lib/libc/rpc/svc_vc.c,v retrieving revision 1.5 diff -u -r1.5 svc_vc.c --- lib/libc/rpc/svc_vc.c 2001/04/02 21:41:44 1.5 +++ lib/libc/rpc/svc_vc.c 2001/07/15 15:38:39 @@ -400,8 +400,6 @@ struct pollfd pollfd; struct sockaddr *sa; struct cmessage *cm; - struct cmsghdr *cmp; - struct sockcred *sc; xprt = (SVCXPRT *)(void *)xprtp; assert(xprt != NULL); @@ -429,9 +427,7 @@ if (sa->sa_family == AF_LOCAL) { cm = (struct cmessage *)xprt->xp_verf.oa_base; if ((len = __msgread_withcred(sock, buf, len, cm)) > 0) { - cmp = &cm->cmsg; - sc = (struct sockcred *)(void *)CMSG_DATA(cmp); - xprt->xp_p2 = sc; + xprt->xp_p2 = &cm->cmcred; return (len); } } else { @@ -638,8 +634,14 @@ { struct iovec iov[1]; struct msghdr msg; + union { + struct cmsghdr cmsg; + char control[CMSG_SPACE(sizeof(struct cmsgcred))]; + } cm; + int ret; + - bzero(cmp, sizeof(*cmp)); + bzero(&cm, sizeof(cm)); iov[0].iov_base = buf; iov[0].iov_len = cnt; @@ -647,11 +649,14 @@ msg.msg_iovlen = 1; msg.msg_name = NULL; msg.msg_namelen = 0; - msg.msg_control = cmp; - msg.msg_controllen = sizeof(struct cmessage); + msg.msg_control = &cm; + msg.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred)); msg.msg_flags = 0; - return(_recvmsg(sock, &msg, 0)); + ret = _recvmsg(sock, &msg, 0); + bcopy(&cm.cmsg, &cmp->cmsg, sizeof(cmp->cmsg)); + bcopy(CMSG_DATA(&cm), &cmp->cmcred, sizeof(cmp->cmcred)); + return ret; } static int Index: sbin/mount_portalfs/activate.c =================================================================== RCS file: /cvs/FreeBSD-CVS/src/sbin/mount_portalfs/activate.c,v retrieving revision 1.7 diff -u -r1.7 activate.c --- sbin/mount_portalfs/activate.c 1999/08/28 00:13:35 1.7 +++ sbin/mount_portalfs/activate.c 2001/07/15 14:58:01 @@ -113,9 +113,9 @@ int n; struct iovec iov; struct msghdr msg; - struct { + union { struct cmsghdr cmsg; - int fd; + char control[CMSG_SPACE(sizeof(int))]; } ctl; /* @@ -137,10 +137,10 @@ * construct a suitable rights control message. */ if (fd >= 0) { - ctl.fd = fd; - ctl.cmsg.cmsg_len = sizeof(ctl); + ctl.cmsg.cmsg_len = CMSG_LEN(sizeof(int)); ctl.cmsg.cmsg_level = SOL_SOCKET; ctl.cmsg.cmsg_type = SCM_RIGHTS; + *((int *)CMSG_DATA(&ctl.cmsg)) = fd; msg.msg_control = (caddr_t) &ctl; msg.msg_controllen = ctl.cmsg.cmsg_len; } Index: sys/kern/uipc_socket.c =================================================================== RCS file: /cvs/FreeBSD-CVS/src/sys/kern/uipc_socket.c,v retrieving revision 1.97 diff -u -r1.97 uipc_socket.c --- sys/kern/uipc_socket.c 2001/05/01 08:12:58 1.97 +++ sys/kern/uipc_socket.c 2001/07/10 20:35:09 @@ -672,7 +672,7 @@ struct mbuf **controlp; int *flagsp; { - register struct mbuf *m, **mp; + struct mbuf *m, **mp; register int flags, len, error, s, offset; struct protosw *pr = so->so_proto; struct mbuf *nextrecord; @@ -798,23 +798,22 @@ m = m->m_next; } else { sbfree(&so->so_rcv, m); - if (controlp) { - if (pr->pr_domain->dom_externalize && - mtod(m, struct cmsghdr *)->cmsg_type == - SCM_RIGHTS) - error = (*pr->pr_domain->dom_externalize)(m); + so->so_rcv.sb_mb = m->m_next; + m->m_next = NULL; + if (pr->pr_domain->dom_externalize) + error = + (*pr->pr_domain->dom_externalize)(m, controlp); + else if (controlp) *controlp = m; - so->so_rcv.sb_mb = m->m_next; - m->m_next = 0; - m = so->so_rcv.sb_mb; - } else { - MFREE(m, so->so_rcv.sb_mb); - m = so->so_rcv.sb_mb; - } + else + m_freem(m); + m = so->so_rcv.sb_mb; } if (controlp) { orig_resid = 0; - controlp = &(*controlp)->m_next; + do + controlp = &(*controlp)->m_next; + while (*controlp != NULL); } } if (m) { Index: sys/kern/uipc_socket2.c =================================================================== RCS file: /cvs/FreeBSD-CVS/src/sys/kern/uipc_socket2.c,v retrieving revision 1.73 diff -u -r1.73 uipc_socket2.c --- sys/kern/uipc_socket2.c 2001/06/29 04:01:38 1.73 +++ sys/kern/uipc_socket2.c 2001/07/08 19:45:05 @@ -851,13 +852,23 @@ register struct cmsghdr *cp; struct mbuf *m; - if (CMSG_SPACE((u_int)size) > MLEN) + if (CMSG_SPACE((u_int)size) > MCLBYTES) return ((struct mbuf *) NULL); if ((m = m_get(M_DONTWAIT, MT_CONTROL)) == NULL) return ((struct mbuf *) NULL); + if (CMSG_SPACE((u_int)size) > MLEN) { + MCLGET(m, M_DONTWAIT); + if ((m->m_flags & M_EXT) == 0) { + m_free(m); + return ((struct mbuf *) NULL); + } + } cp = mtod(m, struct cmsghdr *); - /* XXX check size? */ - (void)memcpy(CMSG_DATA(cp), p, size); + m->m_len = 0; + KASSERT(CMSG_SPACE((u_int)size) <= M_TRAILINGSPACE(m), + ("sbcreatecontrol: short mbuf")); + if (p != NULL) + (void)memcpy(CMSG_DATA(cp), p, size); m->m_len = CMSG_SPACE(size); cp->cmsg_len = CMSG_LEN(size); cp->cmsg_level = level; Index: sys/kern/uipc_usrreq.c =================================================================== RCS file: /cvs/FreeBSD-CVS/src/sys/kern/uipc_usrreq.c,v retrieving revision 1.66 diff -u -r1.66 uipc_usrreq.c --- sys/kern/uipc_usrreq.c 2001/05/25 16:59:07 1.66 +++ sys/kern/uipc_usrreq.c 2001/07/15 13:42:17 @@ -90,7 +90,8 @@ static void unp_scan __P((struct mbuf *, void (*)(struct file *))); static void unp_mark __P((struct file *)); static void unp_discard __P((struct file *)); -static int unp_internalize __P((struct mbuf *, struct proc *)); +static void unp_freerights __P((struct file **, int)); +static int unp_internalize __P((struct mbuf **, struct proc *)); static int uipc_abort(struct socket *so) @@ -273,7 +274,7 @@ goto release; } - if (control && (error = unp_internalize(control, p))) + if (control && (error = unp_internalize(&control, p))) goto release; switch (so->so_type) { @@ -874,80 +875,129 @@ } #endif +static void +unp_freerights(rp, fdcount) + struct file **rp; + int fdcount; +{ + int i; + struct file *fp; + + for (i = 0; i < fdcount; i++) { + fp = *rp; + /* + * zero the pointer before calling + * unp_discard since it may end up + * in unp_gc().. + */ + *rp++ = 0; + unp_discard(fp); + } +} + int -unp_externalize(rights) - struct mbuf *rights; +unp_externalize(control, controlp) + struct mbuf *control, **controlp; { struct proc *p = curproc; /* XXX */ - register int i; - register struct cmsghdr *cm = mtod(rights, struct cmsghdr *); - register int *fdp; - register struct file **rp; - register struct file *fp; - int newfds = (cm->cmsg_len - (CMSG_DATA(cm) - (u_char *)cm)) - / sizeof (struct file *); + struct cmsghdr *cm = mtod(control, struct cmsghdr *); + int i; + int *fdp; + struct file **rp; + struct file *fp; + void *data; + socklen_t clen = control->m_len, datalen; + int error, newfds; int f; + u_int newlen; - /* - * if the new FD's will not fit, then we free them all - */ - if (!fdavail(p, newfds)) { - rp = (struct file **)CMSG_DATA(cm); - for (i = 0; i < newfds; i++) { - fp = *rp; + error = 0; + if (controlp != NULL) /* controlp == NULL => free control messages */ + *controlp = NULL; + + while (cm != NULL) { + if (sizeof(*cm) > clen || cm->cmsg_len > clen) { + error = EINVAL; + break; + } + + data = CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; + + /* DMXXX */ printf("PID %d Externalising (%d:%d) size %d (%d) in %d\n", p->p_pid, cm->cmsg_level, cm->cmsg_type, datalen, CMSG_SPACE(datalen), clen); + + if (cm->cmsg_level == SOL_SOCKET + && cm->cmsg_type == SCM_RIGHTS) { + newfds = datalen / sizeof(struct file *); + rp = data; + + /* If we're not outputting the discriptors free them. */ + if (error || controlp == NULL) { + unp_freerights(rp, newfds); + goto next; + } + /* if the new FD's will not fit free them. */ + if (!fdavail(p, newfds)) { + error = EMSGSIZE; + unp_freerights(rp, newfds); + goto next; + } /* - * zero the pointer before calling unp_discard, - * since it may end up in unp_gc().. + * now change each pointer to an fd in the global + * table to an integer that is the index to the + * local fd table entry that we set up to point + * to the global one we are transferring. */ - *rp++ = 0; - unp_discard(fp); - } - return (EMSGSIZE); - } - /* - * now change each pointer to an fd in the global table to - * an integer that is the index to the local fd table entry - * that we set up to point to the global one we are transferring. - * If sizeof (struct file *) is bigger than or equal to sizeof int, - * then do it in forward order. In that case, an integer will - * always come in the same place or before its corresponding - * struct file pointer. - * If sizeof (struct file *) is smaller than sizeof int, then - * do it in reverse order. - */ - if (sizeof (struct file *) >= sizeof (int)) { - fdp = (int *)(cm + 1); - rp = (struct file **)CMSG_DATA(cm); - for (i = 0; i < newfds; i++) { - if (fdalloc(p, 0, &f)) - panic("unp_externalize"); - fp = *rp++; - p->p_fd->fd_ofiles[f] = fp; - fp->f_msgcount--; - unp_rights--; - *fdp++ = f; + newlen = newfds * sizeof(int); + *controlp = sbcreatecontrol(NULL, newlen, + SCM_RIGHTS, SOL_SOCKET); + if (*controlp == NULL) { + error = E2BIG; + unp_freerights(rp, newfds); + goto next; + } + + fdp = (int *) + CMSG_DATA(mtod(*controlp, struct cmsghdr *)); + for (i = 0; i < newfds; i++) { + if (fdalloc(p, 0, &f)) + panic("unp_externalize fdalloc failed"); + fp = *rp++; + p->p_fd->fd_ofiles[f] = fp; + fp->f_msgcount--; + unp_rights--; + *fdp++ = f; + } + } else { /* We can just copy anything else across */ + if (error || controlp == NULL) + goto next; + *controlp = sbcreatecontrol(NULL, datalen, + cm->cmsg_type, cm->cmsg_level); + if (*controlp == NULL) { + error = ENOBUFS; + goto next; + } + bcopy(data, + CMSG_DATA(mtod(*controlp, struct cmsghdr *)), + datalen); } - } else { - fdp = (int *)(cm + 1) + newfds - 1; - rp = (struct file **)CMSG_DATA(cm) + newfds - 1; - for (i = 0; i < newfds; i++) { - if (fdalloc(p, 0, &f)) - panic("unp_externalize"); - fp = *rp--; - p->p_fd->fd_ofiles[f] = fp; - fp->f_msgcount--; - unp_rights--; - *fdp-- = f; + + controlp = &(*controlp)->m_next; + +next: + if (CMSG_SPACE(datalen) < clen) { + clen -= CMSG_SPACE(datalen); + cm = (struct cmsghdr *) + ((caddr_t)cm + CMSG_SPACE(datalen)); + } else { + clen = 0; + cm = NULL; } } - /* - * Adjust length, in case sizeof(struct file *) and sizeof(int) - * differs. - */ - cm->cmsg_len = CMSG_LEN(newfds * sizeof(int)); - rights->m_len = cm->cmsg_len; - return (0); + m_freem(control); + + return (error); } void @@ -965,108 +1015,136 @@ #endif static int -unp_internalize(control, p) - struct mbuf *control; +unp_internalize(controlp, p) + struct mbuf **controlp; struct proc *p; { + struct mbuf *control = *controlp; struct filedesc *fdescp = p->p_fd; - register struct cmsghdr *cm = mtod(control, struct cmsghdr *); - register struct file **rp; - register struct file *fp; - register int i, fd, *fdp; - register struct cmsgcred *cmcred; - int oldfds; + struct cmsghdr *cm = mtod(control, struct cmsghdr *); + struct cmsgcred *cmcred; + struct file **rp; + struct file *fp; + struct timeval *tv; + int i, fd, *fdp; + void *data; + socklen_t clen = control->m_len, datalen; + int error, oldfds; u_int newlen; - if ((cm->cmsg_type != SCM_RIGHTS && cm->cmsg_type != SCM_CREDS) || - cm->cmsg_level != SOL_SOCKET || cm->cmsg_len != control->m_len) - return (EINVAL); + error = 0; + *controlp = NULL; - /* - * Fill in credential information. - */ - if (cm->cmsg_type == SCM_CREDS) { - cmcred = (struct cmsgcred *)(cm + 1); - cmcred->cmcred_pid = p->p_pid; - cmcred->cmcred_uid = p->p_ucred->cr_ruid; - cmcred->cmcred_gid = p->p_ucred->cr_rgid; - cmcred->cmcred_euid = p->p_ucred->cr_uid; - cmcred->cmcred_ngroups = MIN(p->p_ucred->cr_ngroups, + while (cm != NULL) { + if (sizeof(*cm) > clen || cm->cmsg_level != SOL_SOCKET + || cm->cmsg_len > clen) { + error = EINVAL; + goto out; + } + + data = CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; + + /* DMXXX */ printf("PID %d Internalising (%d:%d) size %d (%d) in %d\n", p->p_pid, cm->cmsg_level, cm->cmsg_type, datalen, CMSG_SPACE(datalen), clen); + + switch (cm->cmsg_type) { + /* + * Fill in credential information. + */ + case SCM_CREDS: + *controlp = sbcreatecontrol(NULL, sizeof(*cmcred), + SCM_CREDS, SOL_SOCKET); + if (*controlp == NULL) { + error = ENOBUFS; + goto out; + } + + cmcred = (struct cmsgcred *) + CMSG_DATA(mtod(*controlp, struct cmsghdr *)); + cmcred->cmcred_pid = p->p_pid; + cmcred->cmcred_uid = p->p_ucred->cr_ruid; + cmcred->cmcred_gid = p->p_ucred->cr_rgid; + cmcred->cmcred_euid = p->p_ucred->cr_uid; + cmcred->cmcred_ngroups = MIN(p->p_ucred->cr_ngroups, CMGROUP_MAX); - for (i = 0; i < cmcred->cmcred_ngroups; i++) - cmcred->cmcred_groups[i] = p->p_ucred->cr_groups[i]; - return(0); - } + for (i = 0; i < cmcred->cmcred_ngroups; i++) + cmcred->cmcred_groups[i] = + p->p_ucred->cr_groups[i]; + break; - oldfds = (cm->cmsg_len - sizeof (*cm)) / sizeof (int); - /* - * check that all the FDs passed in refer to legal OPEN files - * If not, reject the entire operation. - */ - fdp = (int *)(cm + 1); - for (i = 0; i < oldfds; i++) { - fd = *fdp++; - if ((unsigned)fd >= fdescp->fd_nfiles || - fdescp->fd_ofiles[fd] == NULL) - return (EBADF); - } - /* - * Now replace the integer FDs with pointers to - * the associated global file table entry.. - * Allocate a bigger buffer as necessary. But if an cluster is not - * enough, return E2BIG. - */ - newlen = CMSG_LEN(oldfds * sizeof(struct file *)); - if (newlen > MCLBYTES) - return (E2BIG); - if (newlen - control->m_len > M_TRAILINGSPACE(control)) { - if (control->m_flags & M_EXT) - return (E2BIG); - MCLGET(control, M_TRYWAIT); - if ((control->m_flags & M_EXT) == 0) - return (ENOBUFS); - - /* copy the data to the cluster */ - memcpy(mtod(control, char *), cm, cm->cmsg_len); - cm = mtod(control, struct cmsghdr *); - } + case SCM_RIGHTS: + oldfds = datalen / sizeof (int); + /* + * check that all the FDs passed in refer to legal files + * If not, reject the entire operation. + */ + fdp = data; + for (i = 0; i < oldfds; i++) { + fd = *fdp++; + if ((unsigned)fd >= fdescp->fd_nfiles || + fdescp->fd_ofiles[fd] == NULL) { + error = EBADF; + goto out; + } + } + /* + * Now replace the integer FDs with pointers to + * the associated global file table entry.. + */ + newlen = oldfds * sizeof(struct file *); + *controlp = sbcreatecontrol(NULL, newlen, + SCM_RIGHTS, SOL_SOCKET); + if (*controlp == NULL) { + error = E2BIG; + goto out; + } - /* - * Adjust length, in case sizeof(struct file *) and sizeof(int) - * differs. - */ - control->m_len = cm->cmsg_len = newlen; + fdp = data; + rp = (struct file **) + CMSG_DATA(mtod(*controlp, struct cmsghdr *)); + for (i = 0; i < oldfds; i++) { + fp = fdescp->fd_ofiles[*fdp++]; + *rp++ = fp; + fp->f_count++; + fp->f_msgcount++; + unp_rights++; + } + break; - /* - * Transform the file descriptors into struct file pointers. - * If sizeof (struct file *) is bigger than or equal to sizeof int, - * then do it in reverse order so that the int won't get until - * we're done. - * If sizeof (struct file *) is smaller than sizeof int, then - * do it in forward order. - */ - if (sizeof (struct file *) >= sizeof (int)) { - fdp = (int *)(cm + 1) + oldfds - 1; - rp = (struct file **)CMSG_DATA(cm) + oldfds - 1; - for (i = 0; i < oldfds; i++) { - fp = fdescp->fd_ofiles[*fdp--]; - *rp-- = fp; - fp->f_count++; - fp->f_msgcount++; - unp_rights++; + case SCM_TIMESTAMP: + *controlp = sbcreatecontrol(NULL, sizeof(*tv), + SCM_TIMESTAMP, SOL_SOCKET); + if (*controlp == NULL) { + error = ENOBUFS; + goto out; + } + tv = (struct timeval *) + CMSG_DATA(mtod(*controlp, struct cmsghdr *)); + microtime(tv); + break; + + default: + error = EINVAL; + goto out; } - } else { - fdp = (int *)(cm + 1); - rp = (struct file **)CMSG_DATA(cm); - for (i = 0; i < oldfds; i++) { - fp = fdescp->fd_ofiles[*fdp++]; - *rp++ = fp; - fp->f_count++; - fp->f_msgcount++; - unp_rights++; + + controlp = &(*controlp)->m_next; + + if (CMSG_SPACE(datalen) < clen) { + clen -= CMSG_SPACE(datalen); + cm = (struct cmsghdr *) + ((caddr_t)cm + CMSG_SPACE(datalen)); + printf("Trying another."); + } else { + clen = 0; + cm = NULL; } } - return (0); + +out: + m_freem(control); + + return (error); } static int unp_defer, unp_gcing; @@ -1249,28 +1327,50 @@ register struct mbuf *m0; void (*op) __P((struct file *)); { - register struct mbuf *m; - register struct file **rp; - register struct cmsghdr *cm; - register int i; + struct mbuf *m; + struct file **rp; + struct cmsghdr *cm; + void *data; + int i; + socklen_t clen, datalen; int qfds; while (m0) { - for (m = m0; m; m = m->m_next) - if (m->m_type == MT_CONTROL && - m->m_len >= sizeof(*cm)) { - cm = mtod(m, struct cmsghdr *); - if (cm->cmsg_level != SOL_SOCKET || - cm->cmsg_type != SCM_RIGHTS) - continue; - qfds = (cm->cmsg_len - - (CMSG_DATA(cm) - (u_char *)cm)) - / sizeof (struct file *); - rp = (struct file **)CMSG_DATA(cm); - for (i = 0; i < qfds; i++) - (*op)(*rp++); - break; /* XXX, but saves time */ + for (m = m0; m; m = m->m_next) { + if (m->m_type == MT_CONTROL) + continue; + + cm = mtod(m, struct cmsghdr *); + clen = m->m_len; + + while (cm != NULL) { + if (sizeof(*cm) > clen || cm->cmsg_len > clen) + break; + + data = CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len + - (caddr_t)data; + + /* DMXXX */ printf("Scanning (%d:%d) size %d (%d) in %d\n", cm->cmsg_level, cm->cmsg_type, datalen, CMSG_SPACE(datalen), clen); + + if (cm->cmsg_level == SOL_SOCKET && + cm->cmsg_type == SCM_RIGHTS) { + qfds = datalen / sizeof (struct file *); + rp = data; + for (i = 0; i < qfds; i++) + (*op)(*rp++); + } + + if (CMSG_SPACE(datalen) < clen) { + clen -= CMSG_SPACE(datalen); + cm = (struct cmsghdr *) + ((caddr_t)cm + CMSG_SPACE(datalen)); + } else { + clen = 0; + cm = NULL; + } } + } m0 = m0->m_act; } } Index: sys/netgraph/ng_socket.c =================================================================== RCS file: /cvs/FreeBSD-CVS/src/sys/netgraph/ng_socket.c,v retrieving revision 1.26 diff -u -r1.26 ng_socket.c --- sys/netgraph/ng_socket.c 2001/02/23 16:34:22 1.26 +++ sys/netgraph/ng_socket.c 2001/07/15 14:49:59 @@ -583,7 +583,7 @@ } /* Check there is only one FD. XXX what would more than one signify? */ - oldfds = (cm->cmsg_len - sizeof(*cm)) / sizeof(int); + oldfds = ((caddr_t)cm + cm->cmsg_len - (caddr_t)data) / sizeof (int); if (oldfds != 1) { TRAP_ERROR; return (EINVAL); @@ -591,7 +591,7 @@ /* Check that the FD given is legit. and change it to a pointer to a * struct file. */ - fd = *(int *) (cm + 1); + fd = CMSG_DATA(cm); if ((unsigned) fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL) { return (EBADF); Index: sys/sys/domain.h =================================================================== RCS file: /cvs/FreeBSD-CVS/src/sys/sys/domain.h,v retrieving revision 1.14 diff -u -r1.14 domain.h --- sys/sys/domain.h 1999/12/29 04:24:40 1.14 +++ sys/sys/domain.h 2001/07/10 19:49:41 @@ -52,7 +52,7 @@ void (*dom_init) /* initialize domain data structures */ __P((void)); int (*dom_externalize) /* externalize access rights */ - __P((struct mbuf *)); + __P((struct mbuf *, struct mbuf **)); void (*dom_dispose) /* dispose of internalized rights */ __P((struct mbuf *)); struct protosw *dom_protosw, *dom_protoswNPROTOSW; Index: sys/sys/un.h =================================================================== RCS file: /cvs/FreeBSD-CVS/src/sys/sys/un.h,v retrieving revision 1.17 diff -u -r1.17 un.h --- sys/sys/un.h 1999/12/29 04:24:49 1.17 +++ sys/sys/un.h 2001/07/10 20:06:13 @@ -54,7 +54,7 @@ struct mbuf *nam, struct mbuf *control)); int unp_connect2 __P((struct socket *so, struct socket *so2)); void unp_dispose __P((struct mbuf *m)); -int unp_externalize __P((struct mbuf *rights)); +int unp_externalize __P((struct mbuf *mbuf, struct mbuf **controlp)); void unp_init __P((void)); extern struct pr_usrreqs uipc_usrreqs; #else /* !_KERNEL */ Index: usr.sbin/ppp/bundle.c =================================================================== RCS file: /cvs/FreeBSD-CVS/src/usr.sbin/ppp/bundle.c,v retrieving revision 1.118 diff -u -r1.118 bundle.c --- usr.sbin/ppp/bundle.c 2001/07/03 22:20:15 1.118 +++ usr.sbin/ppp/bundle.c 2001/07/15 15:05:11 @@ -1385,8 +1385,8 @@ return; } - fd = (int *)(cmsg + 1); - nfd = (cmsg->cmsg_len - sizeof *cmsg) / sizeof(int); + fd = (int *)CMSG_DATA(cmsg); + nfd = ((caddr_t)cmsg + cmsg->cmsg_len - (caddr_t)fd) / sizeof(int); if (nfd < 2) { log_Printf(LogERROR, "Recvmsg: %d descriptor%s received (too few) !\n", @@ -1478,7 +1478,7 @@ void bundle_SendDatalink(struct datalink *dl, int s, struct sockaddr_un *sun) { - char cmsgbuf[sizeof(struct cmsghdr) + sizeof(int) * SEND_MAXFD]; + char cmsgbuf[CMSG_SPACE(sizeof(int) * SEND_MAXFD)]; const char *constlock; char *lock; struct cmsghdr *cmsg; @@ -1528,7 +1528,7 @@ msg.msg_iovlen = 1; msg.msg_iov = iov; msg.msg_control = cmsgbuf; - msg.msg_controllen = sizeof *cmsg + sizeof(int) * nfd; + msg.msg_controllen = CMSG_SPACE(sizeof(int) * nfd); msg.msg_flags = 0; cmsg = (struct cmsghdr *)cmsgbuf; @@ -1537,7 +1537,7 @@ cmsg->cmsg_type = SCM_RIGHTS; for (f = 0; f < nfd; f++) - *((int *)(cmsg + 1) + f) = fd[f]; + *((int *)CMSG_DATA(cmsg) + f) = fd[f]; for (f = 1, expect = 0; f < niov; f++) expect += iov[f].iov_len; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 7 10:24:10 2001 Delivered-To: freebsd-audit@freebsd.org Received: from alpo.whistle.com (s206m1.whistle.com [207.76.206.1]) by hub.freebsd.org (Postfix) with ESMTP id 388B037B405 for ; Tue, 7 Aug 2001 10:24:06 -0700 (PDT) (envelope-from mark@whistle.com) Received: from [207.76.207.129] (PBG4.whistle.com [207.76.207.129]) by alpo.whistle.com (8.9.1a/8.9.1) with ESMTP id KAA38143; Tue, 7 Aug 2001 10:22:31 -0700 (PDT) Mime-Version: 1.0 X-Sender: mark-ml@207.76.206.1 Message-Id: In-Reply-To: <20010806055759.E586@ringworld.oblivion.bg> References: <20010806055759.E586@ringworld.oblivion.bg> Date: Tue, 7 Aug 2001 10:23:01 -0700 To: Peter Pentchev From: Mark Peek Subject: Re: [PATCH] fix a file(1) minor POLA stretching Cc: audit@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" 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 At 5:57 AM +0300 8/6/01, Peter Pentchev wrote: >It seems that the new file(1), recently imported into -current and >-stable, has a slightly changed behavior, which results in a minor >POLA stretching (maybe not really a violation). > >This new version of file(1) can "compile" magic files into a new, >binary database-like format. Whenever the file(1) utility is invoked >to examine a file, it first tries to open this new binary magic db, >and not finding it, falls back to the old, regular magic file. >This results in a warning message sent to stderr for each and every >invocation of file(1) :) > >The fix is simple: build and install the new magic database along >with the old file. Patch attached. Peter, Is this "binary" format portable? At first glance I think your patch would break cross compilation. Here's a patch that should fix this by building the database at install time instead of during the compilation phase. Mark http://people.freebsd.org/~mp/file.patch Index: Makefile =================================================================== RCS file: /cvs/freebsd/src/usr.bin/file/Makefile,v retrieving revision 1.18 diff -u -r1.18 Makefile --- Makefile 2001/07/30 03:50:04 1.18 +++ Makefile 2001/08/07 17:11:47 @@ -25,6 +25,7 @@ # Hacked and dismembered for bmake (Geoff Rehmet). MAGICFILE= /usr/share/misc/magic +MAGICDB= ${MAGICFILE}.mgc MAGICMODE= 444 SRCDIR= ${.CURDIR}/../../contrib/file @@ -51,12 +52,17 @@ magic: $(MAGFILES) cat $(MAGFILES) > $(.TARGET) +magic.mgc: file magic + ./file -C -m magic + CLEANFILES+= print-hacked.c print-hacked.c: print.c sed -e 's|daylight|0/*daylight*/|g' ${.ALLSRC} > ${.TARGET} -beforeinstall: +beforeinstall: magic.mgc $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ magic $(DESTDIR)$(MAGICFILE) + $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ + magic.mgc $(DESTDIR)$(MAGICDB) .include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 7 10:43:41 2001 Delivered-To: freebsd-audit@freebsd.org Received: from axl.seasidesoftware.co.za (axl.seasidesoftware.co.za [196.31.7.201]) by hub.freebsd.org (Postfix) with ESMTP id 9177837B40B for ; Tue, 7 Aug 2001 10:43:35 -0700 (PDT) (envelope-from sheldonh@starjuice.net) Received: from sheldonh (helo=axl.seasidesoftware.co.za) by axl.seasidesoftware.co.za with local-esmtp (Exim 3.31 #1) id 15UAto-000D4T-00; Tue, 07 Aug 2001 19:44:12 +0200 From: Sheldon Hearn To: Mark Peek Cc: Peter Pentchev , audit@FreeBSD.ORG Subject: Re: [PATCH] fix a file(1) minor POLA stretching In-reply-to: Your message of "Tue, 07 Aug 2001 10:23:01 MST." Date: Tue, 07 Aug 2001 19:44:12 +0200 Message-ID: <50248.997206252@axl.seasidesoftware.co.za> 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 Tue, 07 Aug 2001 10:23:01 MST, Mark Peek wrote: > Is this "binary" format portable? At first glance I think your > patch would break cross compilation. Here's a patch that should fix > this by building the database at install time instead of during the > compilation phase. I'm surprised Christos hasn't gone for the "first use" approach on this one. Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 7 11: 3:16 2001 Delivered-To: freebsd-audit@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id D32F337B40E; Tue, 7 Aug 2001 11:03:03 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.11.3+3.4W/8.11.3/tasogare) with ESMTP/inet id f77I30I56619; Wed, 8 Aug 2001 03:03:00 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: arch@freebsd.org Cc: audit@freebsd.org Subject: CFR: Some bug fixes in i386/i386/machdep.c X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010808030258E.iwasaki@jp.FreeBSD.org> Date: Wed, 08 Aug 2001 03:02:58 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 135 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 Hi, I've noticed that there are some bugs in i386/i386/machdep.c. With following patches on printing, I got strange result from dmesg. Index: machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.465 diff -u -r1.465 machdep.c --- machdep.c 2001/07/26 23:06:44 1.465 +++ machdep.c 2001/08/07 17:00:43 #endif @@ -1969,6 +1974,22 @@ pmap_kenter((vm_offset_t)msgbufp + off, avail_end + off); msgbufinit(msgbufp, MSGBUF_SIZE); + + for (x = 0; x < NGDT; x++) { + printf("gdt_segs[%02d](sel %02x): base = %08x(%08x), limit = %08x(%08x)\n", + x, x * 8, gdt_segs[x].ssd_base, + gdt[x].sd.sd_hibase<<24|gdt[x].sd.sd_lobase, + gdt_segs[x].ssd_limit, + (gdt[x].sd.sd_hilimit<<16|gdt[x].sd.sd_lolimit)); + } + + for (x = 0; x < sizeof ldt_segs / sizeof ldt_segs[0]; x++) { + printf("ldt_segs[%02d](sel %02x): base = %08x(%08x), limit = %08x(%08x)\n", + x, x * 8, ldt_segs[x].ssd_base, + ldt[x].sd.sd_hibase<<24|ldt[x].sd.sd_lobase, + ldt_segs[x].ssd_limit, + (ldt[x].sd.sd_hilimit<<16|ldt[x].sd.sd_lolimit)); + } /* make a call gate to reenter kernel with */ gdp = &ldt[LSYS5CALLS_SEL].gd; gdt_segs[00](sel 00): base = 00000000(00000000), limit = 00000000(00000000) gdt_segs[01](sel 08): base = 00000000(00000000), limit = ffffffff(000fffff) gdt_segs[02](sel 10): base = 00000000(00000000), limit = ffffffff(000fffff) gdt_segs[03](sel 18): base = c0429540(c0429540), limit = ffffffff(000fffff) gdt_segs[04](sel 20): base = c042955c(c042955c), limit = 00000067(00000067) gdt_segs[05](sel 28): base = c0433da0(c0433da0), limit = 00000087(00000087) gdt_segs[06](sel 30): base = c0433da0(c0433da0), limit = 00000fff(00000fff) gdt_segs[07](sel 38): base = 00000000(00000000), limit = 00000000(00000000) gdt_segs[08](sel 40): base = 00000400(00000400), limit = 000fffff(000fffff) gdt_segs[09](sel 48): base = c0429a20(c0429a20), limit = 00000067(00000067) gdt_segs[10](sel 50): base = 00000000(00000000), limit = 000fffff(000fffff) gdt_segs[11](sel 58): base = 00000000(00000000), limit = 000fffff(000fffff) gdt_segs[12](sel 60): base = 00000000(00000000), limit = 000fffff(000fffff) gdt_segs[13](sel 68): base = 00000000(00000000), limit = 000fffff(000fffff) gdt_segs[14](sel 70): base = 00000000(00000000), limit = 000fffff(000fffff) ldt_segs[00](sel 00): base = 00000000(00000000), limit = 00000000(00000000) ldt_segs[01](sel 08): base = 00000000(00000000), limit = 00000000(00000000) ldt_segs[02](sel 10): base = 00000000(00000000), limit = 00000000(00000000) ldt_segs[03](sel 18): base = 00000000(00000000), limit = 000bfc01(000bfc01) ldt_segs[04](sel 20): base = 00000000(00000000), limit = 00000000(00000000) ldt_segs[05](sel 28): base = 00000000(00000000), limit = 000bfbff(000bfbff) ACPI debug layer 0x0 debug level 0x0 Copyright (c) 1992-2001 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.0-CURRENT #153: Wed Aug 8 00:35:09 JST 2001 The segment limit values in gdt_segs for GCODE_SEL, GDATA_SEL, GPRIV_SEL (1, 2, 3 respectively) seems wrong for me, also GPRIV_SEL limit is too big. Of course ssdtosd() correct them luckily except for GPRIV_SEL. Also I've found too early warning printing before calling cninit(). This would never warn to users. Following is bug fixes for above problems. Please review it. I'll commit this weekend if no objections. Thanks Index: machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.465 diff -u -r1.465 machdep.c --- machdep.c 2001/07/26 23:06:44 1.465 +++ machdep.c 2001/08/07 17:41:22 @@ -1782,6 +1782,7 @@ struct region_descriptor r_gdt, r_idt; #endif int off; + int metadata_missing = 0; proc0.p_addr = proc0paddr; @@ -1791,7 +1792,7 @@ preload_metadata = (caddr_t)bootinfo.bi_modulep + KERNBASE; preload_bootstrap_relocate(KERNBASE); } else { - printf("WARNING: loader(8) metadata is missing!\n"); + metadata_missing = 1; } if (bootinfo.bi_envp) kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE; @@ -1808,18 +1809,18 @@ * XXX text protection is temporarily (?) disabled. The limit was * i386_btop(round_page(etext)) - 1. */ - gdt_segs[GCODE_SEL].ssd_limit = i386_btop(0) - 1; - gdt_segs[GDATA_SEL].ssd_limit = i386_btop(0) - 1; + gdt_segs[GCODE_SEL].ssd_limit = i386_btop(0 - 1); + gdt_segs[GDATA_SEL].ssd_limit = i386_btop(0 - 1); #ifdef SMP gdt_segs[GPRIV_SEL].ssd_limit = - i386_btop(sizeof(struct privatespace)) - 1; + i386_btop(sizeof(struct privatespace) + PAGE_SIZE - 1); gdt_segs[GPRIV_SEL].ssd_base = (int) &SMP_prvspace[0]; gdt_segs[GPROC0_SEL].ssd_base = (int) &SMP_prvspace[0].globaldata.gd_common_tss; SMP_prvspace[0].globaldata.gd_prvspace = &SMP_prvspace[0].globaldata; #else gdt_segs[GPRIV_SEL].ssd_limit = - i386_btop(sizeof(struct globaldata)) - 1; + i386_btop(sizeof(struct globaldata) + PAGE_SIZE - 1); gdt_segs[GPRIV_SEL].ssd_base = (int) &__globaldata; gdt_segs[GPROC0_SEL].ssd_base = (int) &__globaldata.gd_common_tss; @@ -1920,6 +1921,10 @@ */ cninit(); + if (metadata_missing) { + printf("WARNING: loader(8) metadata is missing!\n"); + } + #ifdef DEV_ISA isa_defaultirq(); #endif To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 7 11: 9: 8 2001 Delivered-To: freebsd-audit@freebsd.org Received: from alpo.whistle.com (s206m1.whistle.com [207.76.206.1]) by hub.freebsd.org (Postfix) with ESMTP id 079FC37B406 for ; Tue, 7 Aug 2001 11:09:07 -0700 (PDT) (envelope-from mark@whistle.com) Received: from [207.76.207.129] (PBG4.whistle.com [207.76.207.129]) by alpo.whistle.com (8.9.1a/8.9.1) with ESMTP id LAA39169; Tue, 7 Aug 2001 11:08:58 -0700 (PDT) Mime-Version: 1.0 X-Sender: mark-ml@207.76.206.1 Message-Id: In-Reply-To: <50248.997206252@axl.seasidesoftware.co.za> References: <50248.997206252@axl.seasidesoftware.co.za> Date: Tue, 7 Aug 2001 11:08:44 -0700 To: Sheldon Hearn From: Mark Peek Subject: Re: [PATCH] fix a file(1) minor POLA stretching Cc: Peter Pentchev , audit@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" 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 At 7:44 PM +0200 8/7/01, Sheldon Hearn wrote: >On Tue, 07 Aug 2001 10:23:01 MST, Mark Peek wrote: > >> Is this "binary" format portable? At first glance I think your >> patch would break cross compilation. Here's a patch that should fix >> this by building the database at install time instead of during the >> compilation phase. > >I'm surprised Christos hasn't gone for the "first use" approach on this >one. Hmmm, I could think of a couple problems with that...it would need to be the first use by root (or a uid with permission to write to that directory) and you'd have to ensure a writeable filesystem. It's probably best to do it once at installation time and get it over with. Mark To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 7 11:17: 1 2001 Delivered-To: freebsd-audit@freebsd.org Received: from axl.seasidesoftware.co.za (axl.seasidesoftware.co.za [196.31.7.201]) by hub.freebsd.org (Postfix) with ESMTP id 297DC37B40A for ; Tue, 7 Aug 2001 11:16:56 -0700 (PDT) (envelope-from sheldonh@starjuice.net) Received: from sheldonh (helo=axl.seasidesoftware.co.za) by axl.seasidesoftware.co.za with local-esmtp (Exim 3.31 #1) id 15UBQ5-000DGw-00; Tue, 07 Aug 2001 20:17:33 +0200 From: Sheldon Hearn To: Mark Peek Cc: Peter Pentchev , audit@FreeBSD.ORG Subject: Re: [PATCH] fix a file(1) minor POLA stretching In-reply-to: Your message of "Tue, 07 Aug 2001 11:08:44 MST." Date: Tue, 07 Aug 2001 20:17:33 +0200 Message-ID: <51021.997208253@axl.seasidesoftware.co.za> 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 Tue, 07 Aug 2001 11:08:44 MST, Mark Peek wrote: > Hmmm, I could think of a couple problems with that...it would need to > be the first use by root (or a uid with permission to write to that > directory) and you'd have to ensure a writeable filesystem. It's > probably best to do it once at installation time and get it over with. Um, yes. My comment was actually stupid in _so_ many different ways. :-) Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 7 15:25:34 2001 Delivered-To: freebsd-audit@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 4C4EB37B403; Tue, 7 Aug 2001 15:25:27 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id AAA08234; Wed, 8 Aug 2001 00:25:26 +0200 (CEST) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Kris Kennaway Cc: audit@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/string strlcat.c References: <200107241134.f6OBYMr33205@freefall.freebsd.org> From: Dag-Erling Smorgrav Date: 08 Aug 2001 00:25:24 +0200 In-Reply-To: Message-ID: Lines: 11 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 Dag-Erling Smorgrav writes: > Umm, this commit prompted me to have a look at the code, and it > looks a bit stupid. Blah. Firstly, I meant to move this to -audit. Secondly, I'd like to make it clear (since some people have already jumped to the wrong conclusions) that I did not mean this as criticism of Kris' work. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 0:25:41 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 07AB637B401 for ; Wed, 8 Aug 2001 00:25:37 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id RAA23578; Wed, 8 Aug 2001 17:24:02 +1000 Date: Wed, 8 Aug 2001 17:21:33 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mark Murray Cc: Subject: Re: [patch] su(1) WARNS=2 cleanup In-Reply-To: <200108071058.f77Aw6Z43835@grimreaper.grondar.za> Message-ID: <20010808165645.W5697-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Tue, 7 Aug 2001, Mark Murray wrote: > Please review. > > The PAM_SET_ITEM() thing is a separate commit. > Index: Makefile > =================================================================== > RCS file: /home/ncvs/src/usr.bin/su/Makefile,v > retrieving revision 1.32 > diff -u -d -r1.32 Makefile > --- Makefile 2001/05/26 09:52:36 1.32 > +++ Makefile 2001/08/06 14:04:14 > @@ -5,6 +5,7 @@ > > DPADD+= ${LIBUTIL} ${LIBPAM} > LDADD+= -lutil ${MINUSLPAM} > +WARNS?= 2 Style bug (disorder: WARNS added to linker flags "section"). > Index: su.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/su/su.c,v > retrieving revision 1.39 > diff -u -d -r1.39 su.c > --- su.c 2001/05/26 09:52:36 1.39 > +++ su.c 2001/08/06 14:07:11 > ... > @@ -213,6 +214,8 @@ > errx(1, "pam_start: %s", pam_strerror(pamh, retcode)); > } > > + PAM_SET_ITEM(PAM_RUSER, (const void *)getlogin()); > + Style bugs: - bogus cast. pam_set_item(undoc)'s second parameter has type "const void *". Conversion of getlogin()'s type ("char *") to "const void *" is automatic in C. - excessive vertical whitespace. > @@ -378,18 +381,19 @@ > > if (iscsh == YES) { > if (fastlogin) > - *np-- = "-f"; > + (const char *)(*np--) = "-f"; Bugs: - casts are not lvalues in C. - the cast is to hide the bug that np has the wrong type, but -Wcast-qual should warn about it anyway (it doesn't). The string (pointer) has type "const char *", but after assigning it to *np-- it can be accessed via *(np + 1) which has type "char *". > if (asme) > - *np-- = "-m"; > + (const char *)(*np--) = "-m"; Bugs, as above. > } > /* csh strips the first character... */ > - *np = asthem ? "-su" : iscsh == YES ? "_su" : "su"; > + (const char *)(*np) > + = asthem ? "-su" : iscsh == YES ? "_su" : "su"; Bugs, as above. > > if (ruid != 0) > syslog(LOG_NOTICE, "%s to %s%s", username, user, > ontty()); > > - execv(shell, np); > + execv(shell, (char * const *)np); Style bug: bogus cast. execve(2)'s second parameter has type "char * const *". Conversion of np's type "(char **)" is automatic in C. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 1:48:28 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id D5B3937B403 for ; Wed, 8 Aug 2001 01:48:24 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA32140; Wed, 8 Aug 2001 18:48:13 +1000 Date: Wed, 8 Aug 2001 18:45:44 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mark Peek Cc: Peter Pentchev , Subject: Re: [PATCH] fix a file(1) minor POLA stretching In-Reply-To: Message-ID: <20010808183309.M6269-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Tue, 7 Aug 2001, Mark Peek wrote: > >The fix is simple: build and install the new magic database along > >with the old file. Patch attached. Building at install time breaks installing from readonly object trees (if the sources somehow become out of date). > Index: Makefile > =================================================================== > RCS file: /cvs/freebsd/src/usr.bin/file/Makefile,v > retrieving revision 1.18 > diff -u -r1.18 Makefile > --- Makefile 2001/07/30 03:50:04 1.18 > +++ Makefile 2001/08/07 17:11:47 > @@ -25,6 +25,7 @@ > # Hacked and dismembered for bmake (Geoff Rehmet). > > MAGICFILE= /usr/share/misc/magic > +MAGICDB= ${MAGICFILE}.mgc > MAGICMODE= 444 > > SRCDIR= ${.CURDIR}/../../contrib/file > @@ -51,12 +52,17 @@ > magic: $(MAGFILES) > cat $(MAGFILES) > $(.TARGET) > > +magic.mgc: file magic > + ./file -C -m magic > + > CLEANFILES+= print-hacked.c > print-hacked.c: print.c > sed -e 's|daylight|0/*daylight*/|g' ${.ALLSRC} > ${.TARGET} > > -beforeinstall: > +beforeinstall: magic.mgc > $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ > magic $(DESTDIR)$(MAGICFILE) > + $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ > + magic.mgc $(DESTDIR)$(MAGICDB) > > .include It is always a bug for beforeinstall to depend on a file. This bug is currently only in the following Makefiles: ./kerberos5/Makefile.inc:beforeinstall: ${INCLUDES} ./kerberosIV/Makefile.inc:beforeinstall: ${INCLUDES} ./lib/libncurses/Makefile:beforeinstall: ${HEADERS} ./secure/lib/libcrypto/Makefile:beforeinstall: openssl/opensslconf.h openssl/evp.h ./secure/lib/libssl/Makefile:beforeinstall: openssl/opensslconf.h openssl/evp.h Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 2:32:59 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (discworld.nanolink.com [217.75.135.248]) by hub.freebsd.org (Postfix) with SMTP id B0AC337B401 for ; Wed, 8 Aug 2001 02:32:52 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 10961 invoked by uid 1000); 8 Aug 2001 09:31:39 -0000 Date: Wed, 8 Aug 2001 12:31:39 +0300 From: Peter Pentchev To: Bruce Evans Cc: Mark Peek , audit@FreeBSD.ORG Subject: Re: [PATCH] fix a file(1) minor POLA stretching Message-ID: <20010808123139.G534@ringworld.oblivion.bg> Mail-Followup-To: Bruce Evans , Mark Peek , audit@FreeBSD.ORG References: <20010808183309.M6269-100000@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010808183309.M6269-100000@besplex.bde.org>; from bde@zeta.org.au on Wed, Aug 08, 2001 at 06:45:44PM +1000 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 Wed, Aug 08, 2001 at 06:45:44PM +1000, Bruce Evans wrote: > On Tue, 7 Aug 2001, Mark Peek wrote: > > > >The fix is simple: build and install the new magic database along > > >with the old file. Patch attached. > > Building at install time breaks installing from readonly object trees > (if the sources somehow become out of date). True. Then how about just generating the magic DB at install time, right into the destination directory? Patch attached. G'luck, Peter -- Hey, out there - is it *you* reading me, or is it someone else? Index: src/usr.bin/file/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/file/Makefile,v retrieving revision 1.18 diff -u -r1.18 Makefile --- src/usr.bin/file/Makefile 2001/07/30 03:50:04 1.18 +++ src/usr.bin/file/Makefile 2001/08/08 09:13:22 @@ -58,5 +58,7 @@ beforeinstall: $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ magic $(DESTDIR)$(MAGICFILE) + cd ${DESTDIR}${MAGICFILE:H} && \ + ${.OBJDIR}/file -C -m ${DESTDIR}${MAGICFILE} .include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 2:34:54 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mass.dis.org (mass.dis.org [216.240.45.41]) by hub.freebsd.org (Postfix) with ESMTP id F3C2537B409; Wed, 8 Aug 2001 02:34:49 -0700 (PDT) (envelope-from msmith@mass.dis.org) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.4/8.11.3) with ESMTP id f789bhZ01682; Wed, 8 Aug 2001 02:37:44 -0700 (PDT) (envelope-from msmith@mass.dis.org) Message-Id: <200108080937.f789bhZ01682@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Mitsuru IWASAKI Cc: arch@freebsd.org, audit@freebsd.org Subject: Re: CFR: Some bug fixes in i386/i386/machdep.c In-reply-to: Your message of "Wed, 08 Aug 2001 03:02:58 +0900." <20010808030258E.iwasaki@jp.FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 08 Aug 2001 02:37:43 -0700 From: Mike Smith 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 > Hi, I've noticed that there are some bugs in i386/i386/machdep.c. ... > Following is bug fixes for above problems. Please review it. > I'll commit this weekend if no objections. Looks good to me at first glance. Since the only material change is GPRIV_SEL, I think this is OK to commit. Regards, Mike -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 4:22:10 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 6847B37B403 for ; Wed, 8 Aug 2001 04:22:05 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id VAA10884; Wed, 8 Aug 2001 21:21:46 +1000 Date: Wed, 8 Aug 2001 21:19:17 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mark Murray Cc: Subject: Re: [patch] su(1) WARNS=2 cleanup In-Reply-To: <20010808165645.W5697-100000@besplex.bde.org> Message-ID: <20010808204101.O6896-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Wed, 8 Aug 2001, I wrote: > On Tue, 7 Aug 2001, Mark Murray wrote: > > > Please review. > > Index: su.c > > =================================================================== > > RCS file: /home/ncvs/src/usr.bin/su/su.c,v > > retrieving revision 1.39 > > diff -u -d -r1.39 su.c > > --- su.c 2001/05/26 09:52:36 1.39 > > +++ su.c 2001/08/06 14:07:11 > > ... > > @@ -378,18 +381,19 @@ > > > > if (iscsh == YES) { > > if (fastlogin) > > - *np-- = "-f"; > > + (const char *)(*np--) = "-f"; > > Bugs: > - casts are not lvalues in C. > - the cast is to hide the bug that np has the wrong type, but -Wcast-qual > should warn about it anyway (it doesn't). The string (pointer) has type > "const char *", but after assigning it to *np-- it can be accessed via > *(np + 1) which has type "char *". > > > if (asme) > > - *np-- = "-m"; > > + (const char *)(*np--) = "-m"; > >... > > - execv(shell, np); > > + execv(shell, (char * const *)np); > > Style bug: bogus cast. execve(2)'s second parameter has type > "char * const *". Conversion of np's type "(char **)" is automatic in C. Removing all the casts and "fixing" the types of nargv and np gives the following patch. Now there is a fundamental fatal type mismatch between np and execv(2)'s second parameter. np needs to have type char const * * so that it can be initialized without warnings, but it needs to have type char * const * so that it can be passed to execv(). These requirements are incompatible. np must be cast to hide the apparent bug that it is incompatible with execve()'s second arg, but -Wcast-qual shows that the cast is a bug. Index: su.c =================================================================== RCS file: /home/ncvs/src/usr.bin/su/su.c,v retrieving revision 1.39 diff -u -2 -r1.39 su.c --- su.c 2001/05/26 09:52:36 1.39 +++ su.c 2001/08/08 07:35:23 @@ -121,7 +121,7 @@ int asme, ch, asthem, fastlogin, prio, i, setwhat, retcode, statusp, child_pid, child_pgrp, ret_pid; - char *p, *user, *shell, *username, *cleanenv, **nargv, **np, - *class, *mytty, shellbuf[MAXPATHLEN], + char *username, *cleanenv, *class, shellbuf[MAXPATHLEN], myhost[MAXHOSTNAMELEN + 1]; + const char *p, *user, *shell, **nargv, **np, *mytty; shell = class = cleanenv = NULL; Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 7:33:14 2001 Delivered-To: freebsd-audit@freebsd.org Received: from alpo.whistle.com (s206m1.whistle.com [207.76.206.1]) by hub.freebsd.org (Postfix) with ESMTP id CB3D937B403 for ; Wed, 8 Aug 2001 07:33:11 -0700 (PDT) (envelope-from mark@whistle.com) Received: from [207.76.207.129] (PBG4.whistle.com [207.76.207.129]) by alpo.whistle.com (8.9.1a/8.9.1) with ESMTP id HAA62365; Wed, 8 Aug 2001 07:31:05 -0700 (PDT) Mime-Version: 1.0 X-Sender: mark-ml@207.76.206.1 Message-Id: In-Reply-To: <20010808123139.G534@ringworld.oblivion.bg> References: <20010808183309.M6269-100000@besplex.bde.org> <20010808123139.G534@ringworld.oblivion.bg> Date: Wed, 8 Aug 2001 07:30:55 -0700 To: Peter Pentchev , Bruce Evans From: Mark Peek Subject: Re: [PATCH] fix a file(1) minor POLA stretching Cc: audit@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" 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 At 12:31 PM +0300 8/8/01, Peter Pentchev wrote: >On Wed, Aug 08, 2001 at 06:45:44PM +1000, Bruce Evans wrote: > > Building at install time breaks installing from readonly object trees > > (if the sources somehow become out of date). Bruce, thanks for catching my mistake. You're right, my patch would break readonly object trees. >True. Then how about just generating the magic DB at install time, >right into the destination directory? >Patch attached. Given the constraints of cross platform builds and readonly object trees (phase of the moon anyone? :-) ), I believe your updated patch is on the right track. > beforeinstall: > $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ > magic $(DESTDIR)$(MAGICFILE) >+ cd ${DESTDIR}${MAGICFILE:H} && \ >+ ${.OBJDIR}/file -C -m ${DESTDIR}${MAGICFILE} > I don't believe the "cd" is necessary and you could get away with: ./file -C -m ${DESTDIR}${MAGICFILE} Mark To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 7:44:51 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (dialmess.nanolink.com [217.75.135.246]) by hub.freebsd.org (Postfix) with SMTP id 6FA2137B401 for ; Wed, 8 Aug 2001 07:44:46 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 19537 invoked by uid 1000); 8 Aug 2001 14:43:34 -0000 Date: Wed, 8 Aug 2001 17:43:34 +0300 From: Peter Pentchev To: Mark Peek Cc: Bruce Evans , audit@FreeBSD.ORG Subject: Re: [PATCH] fix a file(1) minor POLA stretching Message-ID: <20010808174334.K534@ringworld.oblivion.bg> Mail-Followup-To: Mark Peek , Bruce Evans , audit@FreeBSD.ORG References: <20010808183309.M6269-100000@besplex.bde.org> <20010808123139.G534@ringworld.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mark@whistle.com on Wed, Aug 08, 2001 at 07:30:55AM -0700 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 Wed, Aug 08, 2001 at 07:30:55AM -0700, Mark Peek wrote: > At 12:31 PM +0300 8/8/01, Peter Pentchev wrote: [snip] > > beforeinstall: > > $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ > > magic $(DESTDIR)$(MAGICFILE) > >+ cd ${DESTDIR}${MAGICFILE:H} && \ > >+ ${.OBJDIR}/file -C -m ${DESTDIR}${MAGICFILE} > > > > I don't believe the "cd" is necessary and you could get away with: > > ./file -C -m ${DESTDIR}${MAGICFILE} Oh. Of course you're right :) Trivial patch attached :) G'luck, Peter -- .siht ekil ti gnidaer eb d'uoy ,werbeH ni erew ecnetnes siht fI Index: src/usr.bin/file/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/file/Makefile,v retrieving revision 1.18 diff -u -r1.18 Makefile --- src/usr.bin/file/Makefile 2001/07/30 03:50:04 1.18 +++ src/usr.bin/file/Makefile 2001/08/08 14:43:22 @@ -58,5 +58,6 @@ beforeinstall: $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ magic $(DESTDIR)$(MAGICFILE) + ./file -C -m $(DESTDIR)$(MAGICFILE) .include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 7:47:19 2001 Delivered-To: freebsd-audit@freebsd.org Received: from freebsd.org.ru (sweet.etrust.ru [194.84.67.5]) by hub.freebsd.org (Postfix) with ESMTP id C1C2B37B40A for ; Wed, 8 Aug 2001 07:47:13 -0700 (PDT) (envelope-from osa@freebsd.org.ru) Received: by freebsd.org.ru (Postfix, from userid 1000) id 26BD674; Wed, 8 Aug 2001 18:47:11 +0400 (MSD) Date: Wed, 8 Aug 2001 18:47:11 +0400 From: "Sergey A. Osokin" To: audit@FreeBSD.org Subject: [PATCH] libdevstat have two compute statistics functions Message-ID: <20010808184710.A87195@freebsd.org.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.20i 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=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello. After last commit into libdevstat, devstat.c containes 2 compute statistics functions: old compute_stats() and new devstat_compute_statistics(). I believe that compute_stats() is not necessary any more and we should remove it. devstat_compute_statistics() is a superset for compute_stats(). Thanks. -- Rgdz, /"\ Sergey Osokin aka oZZ, \ / ASCII RIBBON CAMPAIGN osa@freebsd.org.ru X AGAINST HTML MAIL http://freebsd.org.ru/~osa/ / \ --envbJBWh7q8WU6mo Content-Type: text/plain; charset=koi8-r Content-Disposition: attachment; filename="patch-devstat.c" Content-Transfer-Encoding: 8bit --- devstat.c.orig Wed Aug 8 14:44:11 2001 +++ devstat.c Wed Aug 8 14:55:21 2001 @@ -1129,89 +1129,16 @@ long double *mb_per_second, long double *blocks_per_second, long double *ms_per_transaction) { - u_int64_t totalbytes, totaltransfers, totalblocks; - char *func_name = "compute_stats"; - - /* - * current is the only mandatory field. - */ - if (current == NULL) { - snprintf(devstat_errbuf, sizeof(devstat_errbuf), - "%s: current stats structure was NULL", - func_name); - return(-1); - } - - totalbytes = (current->bytes_written + current->bytes_read) - - ((previous) ? (previous->bytes_written + - previous->bytes_read) : 0); - - if (total_bytes) - *total_bytes = totalbytes; - - totaltransfers = (current->num_reads + - current->num_writes + - current->num_other) - - ((previous) ? - (previous->num_reads + - previous->num_writes + - previous->num_other) : 0); - if (total_transfers) - *total_transfers = totaltransfers; - - if (transfers_per_second) { - if (etime > 0.0) { - *transfers_per_second = totaltransfers; - *transfers_per_second /= etime; - } else - *transfers_per_second = 0.0; - } - - if (kb_per_transfer) { - *kb_per_transfer = totalbytes; - *kb_per_transfer /= 1024; - if (totaltransfers > 0) - *kb_per_transfer /= totaltransfers; - else - *kb_per_transfer = 0.0; - } - - if (mb_per_second) { - *mb_per_second = totalbytes; - *mb_per_second /= 1024 * 1024; - if (etime > 0.0) - *mb_per_second /= etime; - else - *mb_per_second = 0.0; - } - - totalblocks = totalbytes; - if (current->block_size > 0) - totalblocks /= current->block_size; - else - totalblocks /= 512; - - if (total_blocks) - *total_blocks = totalblocks; - - if (blocks_per_second) { - *blocks_per_second = totalblocks; - if (etime > 0.0) - *blocks_per_second /= etime; - else - *blocks_per_second = 0.0; - } - - if (ms_per_transaction) { - if (totaltransfers > 0) { - *ms_per_transaction = etime; - *ms_per_transaction /= totaltransfers; - *ms_per_transaction *= 1000; - } else - *ms_per_transaction = 0.0; - } - - return(0); + return(devstat_compute_statistics(current, previous, etime, + DSM_TOTAL_BYTES, total_bytes, + DSM_TOTAL_TRANSFERS, total_transfers, + DSM_TOTAL_BLOCKS, total_blocks, + DSM_KB_PER_TRANSFER, kb_per_transfer, + DSM_TRANSFERS_PER_SECOND, transfers_per_second, + DSM_MB_PER_SECOND, mb_per_second, + DSM_BLOCKS_PER_SECOND, blocks_per_second, + DSM_MS_PER_TRANSACTION, ms_per_transaction, + DSM_NONE)); } long double --envbJBWh7q8WU6mo-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 7:55:48 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id D520C37B40A for ; Wed, 8 Aug 2001 07:55:44 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id AAA24328; Thu, 9 Aug 2001 00:55:35 +1000 Date: Thu, 9 Aug 2001 00:53:06 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mark Peek Cc: Peter Pentchev , Subject: Re: [PATCH] fix a file(1) minor POLA stretching In-Reply-To: Message-ID: <20010809004909.L8250-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Wed, 8 Aug 2001, Mark Peek wrote: > At 12:31 PM +0300 8/8/01, Peter Pentchev wrote: > >On Wed, Aug 08, 2001 at 06:45:44PM +1000, Bruce Evans wrote: > > > Building at install time breaks installing from readonly object trees > > > (if the sources somehow become out of date). > > Bruce, thanks for catching my mistake. You're right, my patch would > break readonly object trees. > > >True. Then how about just generating the magic DB at install time, > >right into the destination directory? > >Patch attached. > > Given the constraints of cross platform builds and readonly object > trees (phase of the moon anyone? :-) ), I believe your updated patch > is on the right track. I agree. It's too much work to do this "right" (by implementing a cross-tool version of file(1)). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 8:42: 0 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id D2F1637B40A; Wed, 8 Aug 2001 08:41:48 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id BAA26360; Thu, 9 Aug 2001 01:41:35 +1000 Date: Thu, 9 Aug 2001 01:39:06 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mitsuru IWASAKI Cc: , Subject: Re: CFR: Some bug fixes in i386/i386/machdep.c In-Reply-To: <20010808030258E.iwasaki@jp.FreeBSD.org> Message-ID: <20010809005326.Y8258-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Wed, 8 Aug 2001, Mitsuru IWASAKI wrote: > Hi, I've noticed that there are some bugs in i386/i386/machdep.c. > With following patches on printing, I got strange result from dmesg. It sure is dusty in there. In FreeBSD_1.x, the segment limit computations were all written as `i386_btop(addr) - 1'. This worked in all cases because `addr' was always a multiple of PAGE_SIZE. Cloning this code for small segments gave the bugs that you observed. I think `atop(addr - 1)' is correct. Reasons: - the segment limit is a maximum page number, not a number of pages, so rounding down is correct. - we mostly have addresses, not byte counts, so using i386_btop() (bytes to pages) is bogus and using atop() (address to pages) is correct. Using atop() to convert byte counts to pages is bogus, but I suspect that it is often used. Anyway, we have too many functions to convert between bytes and pages. > Also I've found too early warning printing before calling cninit(). > This would never warn to users. Does it get put into the message buffer that early? > Following is bug fixes for above problems. Please review it. > I'll commit this weekend if no objections. > Index: machdep.c > =================================================================== > RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v > retrieving revision 1.465 > diff -u -r1.465 machdep.c > --- machdep.c 2001/07/26 23:06:44 1.465 > +++ machdep.c 2001/08/07 17:41:22 > @@ -1782,6 +1782,7 @@ > struct region_descriptor r_gdt, r_idt; > #endif > int off; > + int metadata_missing = 0; Some style bugs here. The declarations of ints should be: int gsel_tss, metadata_missing, off, x; (except some of these variables shouldn't be ints), and the initializer should be elsewhere. > @@ -1808,18 +1809,18 @@ > * XXX text protection is temporarily (?) disabled. The limit was > * i386_btop(round_page(etext)) - 1. > */ > - gdt_segs[GCODE_SEL].ssd_limit = i386_btop(0) - 1; > - gdt_segs[GDATA_SEL].ssd_limit = i386_btop(0) - 1; > + gdt_segs[GCODE_SEL].ssd_limit = i386_btop(0 - 1); > + gdt_segs[GDATA_SEL].ssd_limit = i386_btop(0 - 1); OK. > #ifdef SMP > gdt_segs[GPRIV_SEL].ssd_limit = > - i386_btop(sizeof(struct privatespace)) - 1; > + i386_btop(sizeof(struct privatespace) + PAGE_SIZE - 1); I think the " + PAGE_SIZE" term gives an off by one error. Moving the " - 1" term into the macro arg is sufficient. > .... > - i386_btop(sizeof(struct globaldata)) - 1; > + i386_btop(sizeof(struct globaldata) + PAGE_SIZE - 1); Similarly. > @@ -1920,6 +1921,10 @@ > */ > cninit(); > > + if (metadata_missing) { > + printf("WARNING: loader(8) metadata is missing!\n"); > + } > + Style bug: too many braces. Grepping for i386_btop in machdep.c shows some related bugs: /* * The code segment limit has to cover the user area until we move * the signal trampoline out of the user area. This is safe because * the code segment cannot be written to directly. */ #define VM_END_USER_R_ADDRESS (VM_END_USER_RW_ADDRESS + UPAGES * PAGE_SIZE) ldt_segs[LUCODE_SEL].ssd_limit = i386_btop(VM_END_USER_R_ADDRESS) - 1; ldt_segs[LUDATA_SEL].ssd_limit = i386_btop(VM_END_USER_RW_ADDRESS) - 1; The " - 1" term should be moved into the macro arg here too. The comment and the UPAGES term rotted long ago. Peter Wemm seems to be collecting UPAGES garbage now (he just committed removal of signal trampoline garbage iin libkern/mcount.c). Perhaps he has already fixed this. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 11:21:39 2001 Delivered-To: freebsd-audit@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id 3885837B411; Wed, 8 Aug 2001 11:21:15 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.11.3+3.4W/8.11.3/tasogare) with ESMTP/inet id f78IL0I71108; Thu, 9 Aug 2001 03:21:00 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: bde@zeta.org.au Cc: iwasaki@jp.FreeBSD.org, arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: CFR: Some bug fixes in i386/i386/machdep.c In-Reply-To: <20010809005326.Y8258-100000@besplex.bde.org> References: <20010808030258E.iwasaki@jp.FreeBSD.org> <20010809005326.Y8258-100000@besplex.bde.org> X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010809032100T.iwasaki@jp.FreeBSD.org> Date: Thu, 09 Aug 2001 03:21:00 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 147 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 Hi, Thanks Mike and Bruce for your comments. > I think `atop(addr - 1)' is correct. Reasons: > - the segment limit is a maximum page number, not a number of pages, so > rounding down is correct. Yes, this is what I wanted to confirm. The segment limit for GPRIV_SEL should be 0 because sizeof(struct privatespace) (or sizeof(struct globaldata)) is less than PAGE_SIZE. And I'll change all i386_btop() to atop() within my patch. > > Also I've found too early warning printing before calling cninit(). > > This would never warn to users. > > Does it get put into the message buffer that early? I couldn't find any messages printed before cninit() from dmesg. > Some style bugs here. The declarations of ints should be: > > int gsel_tss, metadata_missing, off, x; > > (except some of these variables shouldn't be ints), and the initializer > should be elsewhere. OK. > > #ifdef SMP > > gdt_segs[GPRIV_SEL].ssd_limit = > > - i386_btop(sizeof(struct privatespace)) - 1; > > + i386_btop(sizeof(struct privatespace) + PAGE_SIZE - 1); > > I think the " + PAGE_SIZE" term gives an off by one error. Moving the > " - 1" term into the macro arg is sufficient. Understood. > > + if (metadata_missing) { > > + printf("WARNING: loader(8) metadata is missing!\n"); > > + } > > + > > Style bug: too many braces. OK. > Grepping for i386_btop in machdep.c shows some related bugs: > > /* > * The code segment limit has to cover the user area until we move > * the signal trampoline out of the user area. This is safe because > * the code segment cannot be written to directly. > */ > #define VM_END_USER_R_ADDRESS (VM_END_USER_RW_ADDRESS + UPAGES * PAGE_SIZE) > ldt_segs[LUCODE_SEL].ssd_limit = i386_btop(VM_END_USER_R_ADDRESS) - 1; > ldt_segs[LUDATA_SEL].ssd_limit = i386_btop(VM_END_USER_RW_ADDRESS) - 1; > > The " - 1" term should be moved into the macro arg here too. The comment > and the UPAGES term rotted long ago. Peter Wemm seems to be collecting > UPAGES garbage now (he just committed removal of signal trampoline garbage > iin libkern/mcount.c). Perhaps he has already fixed this. OK, I'll change this as well, except for the comments ;) Thanks again, here is my revised diffs. Index: machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.465 diff -u -r1.465 machdep.c --- machdep.c 2001/07/26 23:06:44 1.465 +++ machdep.c 2001/08/08 17:36:31 @@ -1774,24 +1774,23 @@ init386(first) int first; { - int x; struct gate_descriptor *gdp; - int gsel_tss; + int gsel_tss, metadata_missing, off, x; #ifndef SMP /* table descriptors - used to load tables by microp */ struct region_descriptor r_gdt, r_idt; #endif - int off; proc0.p_addr = proc0paddr; atdevbase = ISA_HOLE_START + KERNBASE; + metadata_missing = 0; if (bootinfo.bi_modulep) { preload_metadata = (caddr_t)bootinfo.bi_modulep + KERNBASE; preload_bootstrap_relocate(KERNBASE); } else { - printf("WARNING: loader(8) metadata is missing!\n"); + metadata_missing = 1; } if (bootinfo.bi_envp) kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE; @@ -1808,18 +1807,18 @@ * XXX text protection is temporarily (?) disabled. The limit was * i386_btop(round_page(etext)) - 1. */ - gdt_segs[GCODE_SEL].ssd_limit = i386_btop(0) - 1; - gdt_segs[GDATA_SEL].ssd_limit = i386_btop(0) - 1; + gdt_segs[GCODE_SEL].ssd_limit = atop(0 - 1); + gdt_segs[GDATA_SEL].ssd_limit = atop(0 - 1); #ifdef SMP gdt_segs[GPRIV_SEL].ssd_limit = - i386_btop(sizeof(struct privatespace)) - 1; + atop(sizeof(struct privatespace) - 1); gdt_segs[GPRIV_SEL].ssd_base = (int) &SMP_prvspace[0]; gdt_segs[GPROC0_SEL].ssd_base = (int) &SMP_prvspace[0].globaldata.gd_common_tss; SMP_prvspace[0].globaldata.gd_prvspace = &SMP_prvspace[0].globaldata; #else gdt_segs[GPRIV_SEL].ssd_limit = - i386_btop(sizeof(struct globaldata)) - 1; + atop(sizeof(struct globaldata) - 1); gdt_segs[GPRIV_SEL].ssd_base = (int) &__globaldata; gdt_segs[GPROC0_SEL].ssd_base = (int) &__globaldata.gd_common_tss; @@ -1876,8 +1875,8 @@ * the code segment cannot be written to directly. */ #define VM_END_USER_R_ADDRESS (VM_END_USER_RW_ADDRESS + UPAGES * PAGE_SIZE) - ldt_segs[LUCODE_SEL].ssd_limit = i386_btop(VM_END_USER_R_ADDRESS) - 1; - ldt_segs[LUDATA_SEL].ssd_limit = i386_btop(VM_END_USER_RW_ADDRESS) - 1; + ldt_segs[LUCODE_SEL].ssd_limit = atop(VM_END_USER_R_ADDRESS - 1); + ldt_segs[LUDATA_SEL].ssd_limit = atop(VM_END_USER_RW_ADDRESS - 1); for (x = 0; x < sizeof ldt_segs / sizeof ldt_segs[0]; x++) ssdtosd(&ldt_segs[x], &ldt[x].sd); @@ -1920,6 +1919,9 @@ */ cninit(); + if (metadata_missing) + printf("WARNING: loader(8) metadata is missing!\n"); + #ifdef DEV_ISA isa_defaultirq(); #endif To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 11:58:17 2001 Delivered-To: freebsd-audit@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id 70B7C37B409; Wed, 8 Aug 2001 11:58:05 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.11.3+3.4W/8.11.3/tasogare) with ESMTP/inet id f78Iw2I76154; Thu, 9 Aug 2001 03:58:02 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: arch@FreeBSD.ORG Cc: audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: CFR: Timing to enable CR4.PGE bit X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010809035801V.iwasaki@jp.FreeBSD.org> Date: Thu, 09 Aug 2001 03:58:01 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 106 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 Hi, I've found a report in Japanese mailing list that CR4.PGE seems to be enabled before CR0.PG in locore.s. This was originally reported by Kumabuchi-san (Thanks!). According to developer's manual from Intel site, ftp://download.intel.com/design/PentiumII/manuals/24319202.pdf ---- 2.5. CONTROL REGISTERS [snip] PGE (2-17) Page Global Enable (bit 7 of CR4). (Introduced in the P6 family processors.) Enables the global page feature when set; disables the global page feature when clear. [snip] In addition, the bit must not ^^^^^^^^^^^^^^^^ be enabled before paging is enabled via CR0.PG. Program correctness ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ may be affected by reversing this sequence, and processor performance will be impacted. ---- Currently, we enable CR4.PGE bit in create_pagetables, then enable CR0.PG in locore.s. This seems to violate Intel's note. I've made patches for this, moving CR4.PGE enabling code to just before calling init386(). Index: locore.s =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/locore.s,v retrieving revision 1.144 diff -u -r1.144 locore.s --- locore.s 2001/07/12 06:32:50 1.144 +++ locore.s 2001/08/08 17:49:28 @@ -374,6 +374,12 @@ movl IdlePTD,%esi movl %esi,PCB_CR3(%eax) + testl $CPUID_PGE, R(cpu_feature) + jz 1f + movl %cr4, %eax + orl $CR4_PGE, %eax + movl %eax, %cr4 +1: pushl physfree /* value of first for init386(first) */ call init386 /* wire 386 chip for unix operation */ @@ -718,13 +724,6 @@ */ create_pagetables: - - testl $CPUID_PGE, R(cpu_feature) - jz 1f - movl %cr4, %eax - orl $CR4_PGE, %eax - movl %eax, %cr4 -1: /* Find end of kernel image (rounded up to a page boundary). */ movl $R(_end),%esi Also I have another thing to be confirmed. Should we utilize TLB by enabling PGE bit at very later stage? I think it would be more efficient to cache page entries with G flag in multi-user environment, not in kernel bootstrap. If we enable PGE bit in locore.s, TLB could be occupied by entries which is referenced by initialization code (yes, most of them are executed only once). # but I could be wrong... Anyway, patch for this is attached here. Thanks. Index: initcpu.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/initcpu.c,v retrieving revision 1.29 diff -u -r1.29 initcpu.c --- initcpu.c 2001/07/13 11:23:06 1.29 +++ initcpu.c 2001/08/08 15:35:51 @@ -847,3 +847,23 @@ printf("CR0=%x\n", cr0); } #endif /* DDB */ + +/* + * Enable CR4.PGE after kernel bootstrap. + */ + +static void +enable_i686_pge(void *unused) +{ + + if ((cpu_feature & CPUID_PGE) && + (cpu_id & 0xf00) == 0x600) { + load_cr4(rcr4() | CR4_PGE); + if (bootverbose) { + printf("P6 family processor PGE on\n"); + } + } +} + +SYSINIT(initcpu, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, enable_i686_pge, NULL) + To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 12:51:46 2001 Delivered-To: freebsd-audit@freebsd.org Received: from arb.arb.za.net (www.tarmactroopers.co.za [196.7.148.4]) by hub.freebsd.org (Postfix) with ESMTP id 633FB37B433 for ; Wed, 8 Aug 2001 12:51:33 -0700 (PDT) (envelope-from mark@grondar.za) Received: (from uucp@localhost) by arb.arb.za.net (8.11.3/8.11.3) with UUCP id f78JpGQ59083; Wed, 8 Aug 2001 21:51:16 +0200 (SAST) (envelope-from mark@grondar.za) Received: from grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.za (8.11.5/8.11.4) with ESMTP id f78CeNf03323; Wed, 8 Aug 2001 13:40:23 +0100 (BST) (envelope-from mark@grondar.za) Message-Id: <200108081240.f78CeNf03323@grimreaper.grondar.za> To: Bruce Evans Cc: audit@FreeBSD.ORG Subject: Re: [patch] su(1) WARNS=2 cleanup References: <20010808165645.W5697-100000@besplex.bde.org> In-Reply-To: <20010808165645.W5697-100000@besplex.bde.org> ; from Bruce Evans "Wed, 08 Aug 2001 17:21:33 +1000." Date: Wed, 08 Aug 2001 13:40:23 +0100 From: Mark Murray 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 > > - execv(shell, np); > > + execv(shell, (char * const *)np); > > Style bug: bogus cast. execve(2)'s second parameter has type > "char * const *". Conversion of np's type "(char **)" is automatic in C. I'm having a problem unravelling this. With np declared as "const char **", the other (bogus) casts can be removed, but gcc whines about execv(2): cc -O -pipe -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -c /usr/src/usr.bin/su/su.c cc1: warnings being treated as errors /usr/src/usr.bin/su/su.c: In function `main': /usr/src/usr.bin/su/su.c:395: warning: passing arg 2 of `execv' from incompatible pointer type *** Error code 1 If I try to cast arg 2 like: execv(shell, (const char * const *)np); I get from gcc: cc -O -pipe -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -c /usr/src/usr.bin/su/su.c cc1: warnings being treated as errors /usr/src/usr.bin/su/su.c: In function `main': /usr/src/usr.bin/su/su.c:395: warning: passing arg 2 of `execv' from incompatible pointer type *** Error code 1 Playing with "const" in various parts of the const ony ever gets one of the above warning/errors. Hints? GCC bug? M -- Mark Murray Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 21:43:45 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id 2BA2337B401 for ; Wed, 8 Aug 2001 21:43:38 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f7953wH18648 for audit@FreeBSD.org; Thu, 9 Aug 2001 01:03:58 -0400 (EDT) (envelope-from mike) Date: Thu, 9 Aug 2001 01:03:58 -0400 From: Mike Barcroft To: audit@FreeBSD.org Subject: login(1) changes Message-ID: <20010809010358.A18538@coffee.q9media.com> 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 List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I've appreciate reviews of the following change to login(1). Best regards, Mike Barcroft ---------------------------------------------------------------------- login.20010808-rev2.patch o Replace occurrences of strncpy(3) with strlcpy(3); most of the uses of it were wrong anyway. o Always check for NULL returns on strdup(3). o Fix a possible buffer overflow in strcpy(3). o Fix a format string vulnerability. o t->ty_type in stypeof() could be NULL and eventually cause a segmentation fault in setenv(3), so check for that. Index: login/login.c =================================================================== RCS file: /home/ncvs/src/usr.bin/login/login.c,v retrieving revision 1.65 diff -u -r1.65 login.c --- login/login.c 2001/07/28 19:53:10 1.65 +++ login/login.c 2001/08/09 04:34:49 @@ -210,7 +210,10 @@ if (uid) errx(1, "-h option: %s", strerror(EPERM)); hflag = 1; - strncpy(full_hostname, optarg, sizeof(full_hostname)-1); + if (strlcpy(full_hostname, optarg, + sizeof(full_hostname)) >= sizeof(full_hostname)) + errx(1, "-h option: %s: exceeds maximum " + "hostname size", optarg); trimdomain(optarg, UT_HOSTSIZE); @@ -232,6 +235,11 @@ NI_NUMERICHOST| NI_WITHSCOPEID); optarg = strdup(hostbuf); + if (optarg == NULL) { + syslog(LOG_NOTICE, + "strdup(): %m"); + sleepexit(1); + } } else optarg = "invalid hostname"; if (res != NULL) @@ -304,8 +312,7 @@ if (failures > (pwd ? 0 : 1)) badlogin(tbuf); } - (void)strncpy(tbuf, username, sizeof tbuf-1); - tbuf[sizeof tbuf-1] = '\0'; + (void)strlcpy(tbuf, username, sizeof(tbuf)); pwd = getpwnam(username); @@ -466,7 +473,10 @@ getnameinfo(res->ai_addr, res->ai_addrlen, hostbuf, sizeof(hostbuf), NULL, 0, NI_NUMERICHOST|NI_WITHSCOPEID); - optarg = strdup(hostbuf); + if ((optarg = strdup(hostbuf)) == NULL) { + syslog(LOG_NOTICE, "strdup(): %m"); + sleepexit(1); + } } else optarg = NULL; if (res != NULL) @@ -487,7 +497,7 @@ if (*shell == '\0') /* Not overridden */ shell = pwd->pw_shell; if ((shell = strdup(shell)) == NULL) { - syslog(LOG_NOTICE, "memory allocation error"); + syslog(LOG_NOTICE, "strdup(): %m"); sleepexit(1); } @@ -499,10 +509,10 @@ /* Nothing else left to fail -- really log in. */ memset((void *)&utmp, 0, sizeof(utmp)); (void)time(&utmp.ut_time); - (void)strncpy(utmp.ut_name, username, sizeof(utmp.ut_name)); + (void)strlcpy(utmp.ut_name, username, sizeof(utmp.ut_name)); if (hostname) - (void)strncpy(utmp.ut_host, hostname, sizeof(utmp.ut_host)); - (void)strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line)); + (void)strlcpy(utmp.ut_host, hostname, sizeof(utmp.ut_host)); + (void)strlcpy(utmp.ut_line, tty, sizeof(utmp.ut_line)); login(&utmp); dolastlog(quietlog); @@ -530,8 +540,13 @@ /* * Preserve TERM if it happens to be already set. */ - if ((term = getenv("TERM")) != NULL) - term = strdup(term); + if ((term = getenv("TERM")) != NULL) { + if ((term = strdup(term)) == NULL) { + syslog(LOG_NOTICE, + "strdup(): %m"); + sleepexit(1); + } + } /* * Exclude cons/vt/ptys only, assume dialup otherwise @@ -673,10 +688,9 @@ motd(cw); cw = getenv("MAIL"); /* $MAIL may have been set by class */ - if (cw != NULL) { - strncpy(tbuf, cw, sizeof(tbuf)); - tbuf[sizeof(tbuf)-1] = '\0'; - } else + if (cw != NULL) + strlcpy(tbuf, cw, sizeof(tbuf)); + else snprintf(tbuf, sizeof(tbuf), "%s/%s", _PATH_MAILDIR, pwd->pw_name); if (stat(tbuf, &st) == 0 && st.st_size != 0) @@ -699,9 +713,13 @@ /* * Login shells have a leading '-' in front of argv[0] */ - tbuf[0] = '-'; - (void)strcpy(tbuf + 1, - (p = strrchr(pwd->pw_shell, '/')) ? p + 1 : pwd->pw_shell); + if (snprintf(tbuf, sizeof(tbuf), "-%s", + (p = strrchr(pwd->pw_shell, '/')) ? p + 1 : pwd->pw_shell) >= + sizeof(tbuf)) { + syslog(LOG_ERR, "user: %s: shell exceeds maximum pathname size", + username); + errx(1, "shell exceeds maximum pathname size"); + } execlp(shell, tbuf, (char *)0); err(1, "%s", shell); @@ -898,7 +916,7 @@ static char nbuf[NBUFSIZ]; for (;;) { - (void)printf(prompt); + (void)printf("%s", prompt); for (p = nbuf; (ch = getchar()) != '\n'; ) { if (ch == EOF) { badlogin(username); @@ -931,10 +949,9 @@ volatile int motdinterrupt; -/* ARGSUSED */ void sigint(signo) - int signo; + int signo __unused; { motdinterrupt = 1; } @@ -994,11 +1011,13 @@ } memset((void *)&ll, 0, sizeof(ll)); (void)time(&ll.ll_time); - (void)strncpy(ll.ll_line, tty, sizeof(ll.ll_line)); + (void)strlcpy(ll.ll_line, tty, sizeof(ll.ll_line)); if (hostname) - (void)strncpy(ll.ll_host, hostname, sizeof(ll.ll_host)); + (void)strlcpy(ll.ll_host, hostname, sizeof(ll.ll_host)); (void)write(fd, (char *)&ll, sizeof(ll)); (void)close(fd); + } else { + syslog(LOG_ERR, "cannot open %s: %m", _PATH_LASTLOG); } } @@ -1034,7 +1053,12 @@ { struct ttyent *t; - return (ttyid && (t = getttynam(ttyid)) ? t->ty_type : UNKNOWN); + if (ttyid != NULL && *ttyid != '\0') { + t = getttynam(ttyid); + if (t != NULL && t->ty_type != NULL) + return (t->ty_type); + } + return ("UNKNOWN"); } void To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 8 23:50:28 2001 Delivered-To: freebsd-audit@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id 1C27437B401; Wed, 8 Aug 2001 23:50:27 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: by bazooka.unixfreak.org (Postfix, from userid 1000) id 02C423E2F; Wed, 8 Aug 2001 23:50:22 -0700 (PDT) Received: from bazooka.unixfreak.org (localhost [127.0.0.1]) by bazooka.unixfreak.org (Postfix) with ESMTP id EB0263C12D; Wed, 8 Aug 2001 23:50:22 -0700 (PDT) To: audit@freebsd.org, dwmalone@freebsd.org Subject: Re: Peer credentials on a Unix domain socket Date: Wed, 08 Aug 2001 23:50:17 -0700 From: Dima Dorfman Message-Id: <20010809065022.02C423E2F@bazooka.unixfreak.org> 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 -------- Dima Dorfman writes: > As discussed on -arch... > > Attached are two things: one is a patch that implements the socket > option and documents it in unix(4). The second is a sharball of the > getpeereid() implementation and man page. Here's an excerpt from > unix(4) that pretty much sums up what's there: Is anybody going to review this, or should I go ahead with it? I'm willing to wait if somebody is, but I don't want to wait indefinitely. There isn't anything terribly new or complicated here, but I'd appreciate it if someone could look it over. Thanks. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Aug 9 2:16:33 2001 Delivered-To: freebsd-audit@freebsd.org Received: from arb.arb.za.net (www.tarmactroopers.co.za [196.7.148.4]) by hub.freebsd.org (Postfix) with ESMTP id 2710737B401 for ; Thu, 9 Aug 2001 02:16:28 -0700 (PDT) (envelope-from mark@grondar.za) Received: (from uucp@localhost) by arb.arb.za.net (8.11.3/8.11.3) with UUCP id f799GGX27082; Thu, 9 Aug 2001 11:16:16 +0200 (SAST) (envelope-from mark@grondar.za) Received: from grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.za (8.11.5/8.11.4) with ESMTP id f78LaNf12227; Wed, 8 Aug 2001 22:36:23 +0100 (BST) (envelope-from mark@grondar.za) Message-Id: <200108082136.f78LaNf12227@grimreaper.grondar.za> To: Bruce Evans Cc: audit@FreeBSD.ORG Subject: Re: [patch] su(1) WARNS=2 cleanup References: <20010808204101.O6896-100000@besplex.bde.org> In-Reply-To: <20010808204101.O6896-100000@besplex.bde.org> ; from Bruce Evans "Wed, 08 Aug 2001 21:19:17 +1000." Date: Wed, 08 Aug 2001 22:36:23 +0100 From: Mark Murray 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 > Removing all the casts and "fixing" the types of nargv and np gives the > following patch. Now there is a fundamental fatal type mismatch between > np and execv(2)'s second parameter. np needs to have type > > char const * * > > so that it can be initialized without warnings, but it needs to have type > > char * const * > > so that it can be passed to execv(). These requirements are incompatible. > np must be cast to hide the apparent bug that it is incompatible with > execve()'s second arg, but -Wcast-qual shows that the cast is a bug. So this means that unless something "heavyweight" got done, this is unfixable? OK to commit the rest, minus the execv() arg 2 (non-)fix? (And obviously not the WARNS=2) M -- Mark Murray Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Aug 9 5:29:19 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 10E7637B401 for ; Thu, 9 Aug 2001 05:29:16 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id WAA10857; Thu, 9 Aug 2001 22:27:39 +1000 Date: Thu, 9 Aug 2001 22:25:09 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mark Murray Cc: Subject: Re: [patch] su(1) WARNS=2 cleanup In-Reply-To: <200108082136.f78LaNf12227@grimreaper.grondar.za> Message-ID: <20010809220814.J15145-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Wed, 8 Aug 2001, Mark Murray wrote: > > Removing all the casts and "fixing" the types of nargv and np gives the > > following patch. Now there is a fundamental fatal type mismatch between > > np and execv(2)'s second parameter. np needs to have type > > > > char const * * > > > > so that it can be initialized without warnings, but it needs to have type > > > > char * const * > > > > so that it can be passed to execv(). These requirements are incompatible. > > np must be cast to hide the apparent bug that it is incompatible with > > execve()'s second arg, but -Wcast-qual shows that the cast is a bug. > > So this means that unless something "heavyweight" got done, this is > unfixable? Yes. Heavyweight means fixing the C standard. Other alternatives for the type of execv()'s second parameter, including the correct one (with 2 "const"s) cause even more problems. POSIX.1-200x is a good reference for this. > OK to commit the rest, minus the execv() arg 2 (non-)fix? > (And obviously not the WARNS=2) Just the type changes and the PAM_END changes. Is that the rest? Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Aug 9 9:22: 9 2001 Delivered-To: freebsd-audit@freebsd.org Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by hub.freebsd.org (Postfix) with ESMTP id 6444837B403 for ; Thu, 9 Aug 2001 09:22:05 -0700 (PDT) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.9.3/8.9.1) id KAA62685; Thu, 9 Aug 2001 10:21:40 -0600 (MDT) (envelope-from ken) Date: Thu, 9 Aug 2001 10:21:40 -0600 From: "Kenneth D. Merry" To: "Sergey A. Osokin" Cc: audit@FreeBSD.ORG Subject: Re: [PATCH] libdevstat have two compute statistics functions Message-ID: <20010809102140.A62588@panzer.kdm.org> References: <20010808184710.A87195@freebsd.org.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20010808184710.A87195@freebsd.org.ru>; from osa@freebsd.org.ru on Wed, Aug 08, 2001 at 06:47:11PM +0400 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 Wed, Aug 08, 2001 at 18:47:11 +0400, Sergey A. Osokin wrote: > Hello. > After last commit into libdevstat, devstat.c containes > 2 compute statistics functions: old compute_stats() and > new devstat_compute_statistics(). > > I believe that compute_stats() is not necessary any more > and we should remove it. devstat_compute_statistics() is > a superset for compute_stats(). This patch won't work. The reason is that the arguments to compute_stats() can be NULL, which will cause it not to calculate that particular statistic. Your patch passes in all of the arguments to devstat_compute_statistics(). If one of the initial arguments is NULL, it will bail out and not compute the rest of the statistics. IMO this is the correct behavior -- the user has specified a statistic to calculate, and if he has not also given a valid variable to put the result in, that is an error. That is why I left the original compute_stats() in. The alternative would be to call devstat_compute_statistics() once for each argument, which would be inefficient. I think partially duplicated code is better than having to call devstat_compute_statistics() once for each variable. If there were a way to incrementally compose arguments to a function, that would be a reasonable way to handle things. > - return(0); > + return(devstat_compute_statistics(current, previous, etime, > + DSM_TOTAL_BYTES, total_bytes, > + DSM_TOTAL_TRANSFERS, total_transfers, > + DSM_TOTAL_BLOCKS, total_blocks, > + DSM_KB_PER_TRANSFER, kb_per_transfer, > + DSM_TRANSFERS_PER_SECOND, transfers_per_second, > + DSM_MB_PER_SECOND, mb_per_second, > + DSM_BLOCKS_PER_SECOND, blocks_per_second, > + DSM_MS_PER_TRANSACTION, ms_per_transaction, > + DSM_NONE)); > } > > long double Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Aug 9 11:44: 6 2001 Delivered-To: freebsd-audit@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id 79B5A37B401; Thu, 9 Aug 2001 11:44:03 -0700 (PDT) (envelope-from mjacob@feral.com) Received: from wonky.feral.com (wonky.feral.com [192.67.166.7]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f79Ii2I18552; Thu, 9 Aug 2001 11:44:02 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Thu, 9 Aug 2001 11:43:58 -0700 (PDT) From: Matthew Jacob Reply-To: To: Cc: Bill Paul Subject: Need reviewers for busdma changes to ethernet driver (fwd) Message-ID: <20010809114348.F69994-100000@wonky.feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 ---------- Forwarded message ---------- Date: Thu, 9 Aug 2001 11:41:52 -0700 (PDT) From: Bill Paul To: hackers@FreeBSD.ORG, current@FreeBSD.ORG Subject: Need reviewers for busdma changes to ethernet driver Hi folks: Well, after threatening to do it for a long time, I finally sat down and converted one of my ethernet drivers to use the bus_dma API so that I no longer have to do things like call contigmalloc() and/or vtophys() directly. The changes I made are to the driver in -current, and the new code is at: http://www.freebsd.org/~wpaul/SiS/busdma I have tested this driver on FreeBSD/x86 using a NatSemi DP83815 card (the Netgear FA312TX) and it seems to work fine for me. However, I'm not 100% certain I used the busdma API properly in all cases. If anyone with a busdma clue would care to look over the code and see everything looks more or less legal, I would appreciate it. My main concern is that I'm using bus_dma_load() and bus_dma_unload() correctly (i.e. such that I'm not leaking any resources). Unless anyone raises serious objections, I would like to commit this code ASAP (the last test I really need to do is make sure it works correctly on an alpha). -Bill ============================================================================= -Bill Paul (510) 749-2329 | Senior Engineer, Master of Unix-Fu wpaul@windriver.com | Wind River Systems ============================================================================= "I like zees guys. Zey are fonny guys. Just keel one of zem." -- The 3 Amigos ============================================================================= To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 5:16:59 2001 Delivered-To: freebsd-audit@freebsd.org Received: from freebsd.org.ru (sweet.etrust.ru [194.84.67.5]) by hub.freebsd.org (Postfix) with ESMTP id D7CDF37B401 for ; Fri, 10 Aug 2001 05:16:41 -0700 (PDT) (envelope-from osa@freebsd.org.ru) Received: by freebsd.org.ru (Postfix, from userid 1000) id 3BBBA204; Fri, 10 Aug 2001 16:16:32 +0400 (MSD) Date: Fri, 10 Aug 2001 16:16:32 +0400 From: "Sergey A. Osokin" To: "Kenneth D. Merry" Cc: audit@FreeBSD.ORG Subject: Re: [PATCH] libdevstat have two compute statistics functions Message-ID: <20010810161632.A7827@freebsd.org.ru> References: <20010808184710.A87195@freebsd.org.ru> <20010809102140.A62588@panzer.kdm.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20010809102140.A62588@panzer.kdm.org> User-Agent: Mutt/1.3.20i 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 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Aug 09, 2001 at 10:21:40AM -0600, Kenneth D. Merry wrote: > On Wed, Aug 08, 2001 at 18:47:11 +0400, Sergey A. Osokin wrote: > > Hello. > > After last commit into libdevstat, devstat.c containes > > 2 compute statistics functions: old compute_stats() and > > new devstat_compute_statistics(). > > > > I believe that compute_stats() is not necessary any more > > and we should remove it. devstat_compute_statistics() is > > a superset for compute_stats(). > > This patch won't work. The reason is that the arguments to compute_stats() > can be NULL, which will cause it not to calculate that particular > statistic. OK. I mistake about goto's in switch(devstat_arg_list[metric].argtype). Look at attached patch. I make a little hack for devstat_compute_statistics(). After this patch function try to resolve all pairs of parameters. -- Rgdz, /"\ Sergey Osokin aka oZZ, \ / ASCII RIBBON CAMPAIGN osa@freebsd.org.ru X AGAINST HTML MAIL http://freebsd.org.ru/~osa/ / \ --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=koi8-r Content-Disposition: attachment; filename="patch-devstat.c" Content-Transfer-Encoding: 8bit --- src/lib/libdevstat/devstat.c.orig Fri Aug 10 11:53:40 2001 +++ src/lib/libdevstat/devstat.c Fri Aug 10 12:03:32 2001 @@ -1129,89 +1129,16 @@ long double *mb_per_second, long double *blocks_per_second, long double *ms_per_transaction) { - u_int64_t totalbytes, totaltransfers, totalblocks; - char *func_name = "compute_stats"; - - /* - * current is the only mandatory field. - */ - if (current == NULL) { - snprintf(devstat_errbuf, sizeof(devstat_errbuf), - "%s: current stats structure was NULL", - func_name); - return(-1); - } - - totalbytes = (current->bytes_written + current->bytes_read) - - ((previous) ? (previous->bytes_written + - previous->bytes_read) : 0); - - if (total_bytes) - *total_bytes = totalbytes; - - totaltransfers = (current->num_reads + - current->num_writes + - current->num_other) - - ((previous) ? - (previous->num_reads + - previous->num_writes + - previous->num_other) : 0); - if (total_transfers) - *total_transfers = totaltransfers; - - if (transfers_per_second) { - if (etime > 0.0) { - *transfers_per_second = totaltransfers; - *transfers_per_second /= etime; - } else - *transfers_per_second = 0.0; - } - - if (kb_per_transfer) { - *kb_per_transfer = totalbytes; - *kb_per_transfer /= 1024; - if (totaltransfers > 0) - *kb_per_transfer /= totaltransfers; - else - *kb_per_transfer = 0.0; - } - - if (mb_per_second) { - *mb_per_second = totalbytes; - *mb_per_second /= 1024 * 1024; - if (etime > 0.0) - *mb_per_second /= etime; - else - *mb_per_second = 0.0; - } - - totalblocks = totalbytes; - if (current->block_size > 0) - totalblocks /= current->block_size; - else - totalblocks /= 512; - - if (total_blocks) - *total_blocks = totalblocks; - - if (blocks_per_second) { - *blocks_per_second = totalblocks; - if (etime > 0.0) - *blocks_per_second /= etime; - else - *blocks_per_second = 0.0; - } - - if (ms_per_transaction) { - if (totaltransfers > 0) { - *ms_per_transaction = etime; - *ms_per_transaction /= totaltransfers; - *ms_per_transaction *= 1000; - } else - *ms_per_transaction = 0.0; - } - - return(0); + return(devstat_compute_statistics(current, previous, etime, + DSM_TOTAL_BYTES, total_bytes, + DSM_TOTAL_TRANSFERS, total_transfers, + DSM_TOTAL_BLOCKS, total_blocks, + DSM_KB_PER_TRANSFER, kb_per_transfer, + DSM_TRANSFERS_PER_SECOND, transfers_per_second, + DSM_MB_PER_SECOND, mb_per_second, + DSM_BLOCKS_PER_SECOND, blocks_per_second, + DSM_MS_PER_TRANSACTION, ms_per_transaction, + DSM_NONE)); } long double @@ -1294,6 +1221,8 @@ va_start(ap, etime); while ((metric = (devstat_metric)va_arg(ap, devstat_metric)) != 0) { + destu64 = NULL; + destld = NULL; if (metric == DSM_NONE) break; @@ -1309,34 +1238,22 @@ switch (devstat_arg_list[metric].argtype) { case DEVSTAT_ARG_UINT64: destu64 = (u_int64_t *)va_arg(ap, u_int64_t *); - if (destu64 == NULL) { - snprintf(devstat_errbuf, sizeof(devstat_errbuf), - "%s: argument type not u_int64_t * or " - "argument type missing", func_name); - retval = -1; - goto bailout; - break; /* NOTREACHED */ - } break; case DEVSTAT_ARG_LD: destld = (long double *)va_arg(ap, long double *); - if (destld == NULL) { - snprintf(devstat_errbuf, sizeof(devstat_errbuf), - "%s: argument type not long double * " - "or argument type missing", func_name); - retval = -1; - goto bailout; - break; /* NOTREACHED */ - } break; default: - snprintf(devstat_errbuf, sizeof(devstat_errbuf), - "%s: unknown argument type %d", func_name, - devstat_arg_list[metric].argtype); retval = -1; goto bailout; break; /* NOTREACHED */ } + + /* + * At this place we have already known about destination variables: + * it may be destu64 and NULL or NULL and destld, not both NULL + */ + if ((destu64 == NULL) && (destld == NULL)) + continue; /* get next arguments in while() */ switch (metric) { case DSM_TOTAL_BYTES: --M9NhX3UHpAaciwkO-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 5:35:41 2001 Delivered-To: freebsd-audit@freebsd.org Received: from arb.arb.za.net (www.tarmactroopers.co.za [196.7.148.4]) by hub.freebsd.org (Postfix) with ESMTP id C39A637B401; Fri, 10 Aug 2001 05:35:30 -0700 (PDT) (envelope-from mark@grondar.za) Received: (from uucp@localhost) by arb.arb.za.net (8.11.3/8.11.3) with UUCP id f7ACZS565100; Fri, 10 Aug 2001 14:35:28 +0200 (SAST) (envelope-from mark@grondar.za) Received: from grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.za (8.11.5/8.11.4) with ESMTP id f79A9dW00872; Thu, 9 Aug 2001 11:09:39 +0100 (BST) (envelope-from mark@grondar.za) Message-Id: <200108091009.f79A9dW00872@grimreaper.grondar.za> To: Mike Barcroft Cc: audit@FreeBSD.ORG Subject: Re: login(1) changes References: <20010809010358.A18538@coffee.q9media.com> In-Reply-To: <20010809010358.A18538@coffee.q9media.com> ; from Mike Barcroft "Thu, 09 Aug 2001 01:03:58 EDT." Date: Thu, 09 Aug 2001 11:09:39 +0100 From: Mark Murray 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 > ---------------------------------------------------------------------- > > login.20010808-rev2.patch > > o Replace occurrences of strncpy(3) with strlcpy(3); most of > the uses of it were wrong anyway. > o Always check for NULL returns on strdup(3). > o Fix a possible buffer overflow in strcpy(3). > o Fix a format string vulnerability. > o t->ty_type in stypeof() could be NULL and eventually cause > a segmentation fault in setenv(3), so check for that. > > Index: login/login.c I have not run this, but looking over it, it all looks pretty sane. Personally, I'd also push for a s/(void)foo()/foo()/, s/foo __P((X))/foo(X)/ and ansification, but this is OK. M -- Mark Murray Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 7:10:16 2001 Delivered-To: freebsd-audit@freebsd.org Received: from arb.arb.za.net (www.tarmactroopers.co.za [196.7.148.4]) by hub.freebsd.org (Postfix) with ESMTP id EF08537B405 for ; Fri, 10 Aug 2001 07:10:08 -0700 (PDT) (envelope-from mark@grondar.za) Received: (from uucp@localhost) by arb.arb.za.net (8.11.3/8.11.3) with UUCP id f7AE9vM72896; Fri, 10 Aug 2001 16:09:57 +0200 (SAST) (envelope-from mark@grondar.za) Received: from grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.za (8.11.5/8.11.4) with ESMTP id f7ACsNW09600; Fri, 10 Aug 2001 13:54:23 +0100 (BST) (envelope-from mark@grondar.za) Message-Id: <200108101254.f7ACsNW09600@grimreaper.grondar.za> To: Bruce Evans Cc: audit@FreeBSD.ORG Subject: Re: [patch] su(1) WARNS=2 cleanup References: <20010809220814.J15145-100000@besplex.bde.org> In-Reply-To: <20010809220814.J15145-100000@besplex.bde.org> ; from Bruce Evans "Thu, 09 Aug 2001 22:25:09 +1000." Date: Fri, 10 Aug 2001 13:54:22 +0100 From: Mark Murray 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 > > OK to commit the rest, minus the execv() arg 2 (non-)fix? > > (And obviously not the WARNS=2) > > Just the type changes and the PAM_END changes. Is that the rest? One other PAM_SET_ITEM thing, but that is pretty much it. M -- Mark Murray Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 7:44:38 2001 Delivered-To: freebsd-audit@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 8944137B403; Fri, 10 Aug 2001 07:44:30 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f7AEeoU64702; Fri, 10 Aug 2001 17:40:50 +0300 (EEST) (envelope-from ru) Date: Fri, 10 Aug 2001 17:40:50 +0300 From: Ruslan Ermilov To: Mark Murray Cc: Mike Barcroft , audit@FreeBSD.ORG Subject: Re: login(1) changes Message-ID: <20010810174050.C60193@sunbay.com> References: <20010809010358.A18538@coffee.q9media.com> <200108091009.f79A9dW00872@grimreaper.grondar.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200108091009.f79A9dW00872@grimreaper.grondar.za>; from mark@grondar.za on Thu, Aug 09, 2001 at 11:09:39AM +0100 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 Thu, Aug 09, 2001 at 11:09:39AM +0100, Mark Murray wrote: > > ---------------------------------------------------------------------- > > > > login.20010808-rev2.patch > > > > o Replace occurrences of strncpy(3) with strlcpy(3); most of > > the uses of it were wrong anyway. > > o Always check for NULL returns on strdup(3). > > o Fix a possible buffer overflow in strcpy(3). > > o Fix a format string vulnerability. > > o t->ty_type in stypeof() could be NULL and eventually cause > > a segmentation fault in setenv(3), so check for that. > > > > Index: login/login.c > > I have not run this, but looking over it, it all looks pretty sane. > > Personally, I'd also push for a s/(void)foo()/foo()/, > s/foo __P((X))/foo(X)/ and ansification, but this is OK. > Please don't mix functional and style changes. These last two are style changes only, while all of the above are functional changes. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 15:44:44 2001 Delivered-To: freebsd-audit@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id E6C7A37B403; Fri, 10 Aug 2001 15:44:40 -0700 (PDT) (envelope-from mjacob@feral.com) Received: from wonky.feral.com (wonky.feral.com [192.67.166.7]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f7AMieI35125; Fri, 10 Aug 2001 15:44:40 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Fri, 10 Aug 2001 15:44:33 -0700 (PDT) From: Matthew Jacob Reply-To: To: Bill Paul Cc: Subject: Re: Need reviewers for busdma changes to ethernet driver In-Reply-To: <20010809184152.8A95F37B401@hub.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Seems mostly good. 1. Nit: /* * Obtain the physical addresses of the RX and TX * rings which we'll need later in the init routine. */ More formally, it's not a 'physical address'- it's a "Bus Address", or "Address appropriate for a device on this bus to use to access the memory so mapped". Under sparc64, for example, it would be an iommu mapping address. 2. All callback functions for dma- you should be checking error. 3. You might want to recycle rather than create/destroy mbuf tags. You should note that FreeBSD's bus_dma is hardly as strict or as formal as NetBSD's, so there's room for a lot of slop here. The key thing to test it on is an alpha that has both direct-mapped and sgmap hardware to see that it works. -matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 16:40: 8 2001 Delivered-To: freebsd-audit@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 618) id CCEA637B405; Fri, 10 Aug 2001 16:40:02 -0700 (PDT) Subject: Re: Need reviewers for busdma changes to ethernet driver In-Reply-To: from Matthew Jacob at "Aug 10, 2001 03:44:33 pm" To: mjacob@feral.com Date: Fri, 10 Aug 2001 16:40:02 -0700 (PDT) Cc: audit@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20010810234002.CCEA637B405@hub.freebsd.org> From: wpaul@FreeBSD.ORG (Bill Paul) 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 > > Seems mostly good. > > > 1. Nit: > > /* > * Obtain the physical addresses of the RX and TX > * rings which we'll need later in the init routine. > */ > > > More formally, it's not a 'physical address'- it's a "Bus Address", or > "Address appropriate for a device on this bus to use to access the > memory so mapped". Under sparc64, for example, it would be an iommu > mapping address. > > 2. All callback functions for dma- you should be checking error. Ok... > 3. You might want to recycle rather than create/destroy mbuf tags. I'm not creating/destroying tags, I'm creating/destroying dma maps (bus_dmamap_t). My understanding is that I need a dmamap for every buffer that I need to send to the NIC, and in the transmit case, I might have several buffers per packet (i.e. an mbuf list with all the packet fragments). But I can't know ahead of time how many fragments will be in the chain, so I can't really say "allocate this many dma maps for packet transmit." > You should note that FreeBSD's bus_dma is hardly as strict or as formal as > NetBSD's, so there's room for a lot of slop here. The key thing to test it on > is an alpha that has both direct-mapped and sgmap hardware to see that it > works. Hopefully I will be able to do this on Monday. In the meantime, I have also converted the RealTek driver: http://www.freebsd.org/~wpaul/RealTek/busdma This was somewhat easier because there's just one giant DMA buffer for receive and no descriptor structures. -Bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 16:43:46 2001 Delivered-To: freebsd-audit@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id A2ED837B403; Fri, 10 Aug 2001 16:43:43 -0700 (PDT) (envelope-from mjacob@feral.com) Received: from wonky.feral.com (wonky.feral.com [192.67.166.7]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f7ANhhI35993; Fri, 10 Aug 2001 16:43:43 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Fri, 10 Aug 2001 16:43:35 -0700 (PDT) From: Matthew Jacob Reply-To: To: Bill Paul Cc: Subject: Re: Need reviewers for busdma changes to ethernet driver In-Reply-To: <20010810234002.CCEA637B405@hub.freebsd.org> Message-ID: <20010810164213.O64952-100000@wonky.feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 > > > 3. You might want to recycle rather than create/destroy mbuf tags. > > I'm not creating/destroying tags, I'm creating/destroying dma maps > (bus_dmamap_t). > > My understanding is that I need a dmamap for every buffer that I > need to send to the NIC, and in the transmit case, I might have several > buffers per packet (i.e. an mbuf list with all the packet fragments). > But I can't know ahead of time how many fragments will be in the chain, > so I can't really say "allocate this many dma maps for packet transmit." Oh, right. Sorry- I should have looked a little closer. BTW- this is the exact case that finally got Jason, after some years, to implement bus_dmaload_mbuf. If I ever resume working on wx, I'll be dma-busifying it also. -matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 18:22: 5 2001 Delivered-To: freebsd-audit@freebsd.org Received: from obsecurity.dyndns.org (adsl-63-207-60-82.dsl.lsan03.pacbell.net [63.207.60.82]) by hub.freebsd.org (Postfix) with ESMTP id E642737B407 for ; Fri, 10 Aug 2001 18:21:27 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id D59C966C4D; Fri, 10 Aug 2001 18:21:26 -0700 (PDT) Date: Fri, 10 Aug 2001 18:21:26 -0700 From: Kris Kennaway To: audit@FreeBSD.org Subject: WFORMAT=1 errors Message-ID: <20010810182125.A47936@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline User-Agent: Mutt/1.2.5i 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 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I'm going to start locking down the bits of the tree which compile with WFORMAT=1. In the meantime, does anyone feel like fixing some of the following from usr.bin/ (this is a warning list from alpha: most of these are probably easy to fix, although some are impossible)? Kris ===> at Warning: Object directory not changed from original /j/kris/src/usr.bin/at cc -O -pipe -mcpu=ev5 -DATJOB_DIR=\"/var/at/jobs/\" -DLFILE=\"/var/at/jobs/.lockfile\" -DLOADAVG_MX=1.5 -DATSPOOL_DIR=\"/var/at/spool\" -DVERSION=\"2.9\" -DDAEMON_UID=1 -DDAEMON_GID=1 -DDEFAULT_BATCH_QUEUE=\'E\' -DDEFAULT_AT_QUEUE=\'c\' -DPERM_PATH=\"/var/at/\" -Wall -Wnon-const-format -Wno-format-extra-args -Werror -c at.c cc1: warnings being treated as errors at.c: In function `list_jobs': at.c:494: warning: `%x' yields only last 2 digits of year in some locales on non-BSD systems *** Error code 1 `all' not remade because of errors. ===> chat Warning: Object directory not changed from original /j/kris/src/usr.bin/chat cc -O -pipe -mcpu=ev5 -Wall -Wnon-const-format -Wno-format-extra-args -Werror -c chat.c cc1: warnings being treated as errors chat.c: In function `main': chat.c:269: warning: value computed is not used *** Error code 1 `all' not remade because of errors. ===> cmp Warning: Object directory not changed from original /j/kris/src/usr.bin/cmp cc -O -pipe -mcpu=ev5 -Wall -Wnon-const-format -Wno-format-extra-args -Werror -c misc.c cc -O -pipe -mcpu=ev5 -Wall -Wnon-const-format -Wno-format-extra-args -Werror -c regular.c cc -O -pipe -mcpu=ev5 -Wall -Wnon-const-format -Wno-format-extra-args -Werror -c special.c cc1: warnings being treated as errors misc.c: In function `diffmsg': misc.c:62: warning: long long int format, off_t arg (arg 4) misc.c:62: warning: long long int format, off_t arg (arg 5) cc1: warnings being treated as errors special.c: In function `c_special': special.c:79: warning: long long int format, off_t arg (arg 2) *** Error code 1 *** Error code 1 cc1: warnings being treated as errors regular.c: In function `c_regular': regular.c:104: warning: long long unsigned int format, long unsigned int arg (arg 2) regular.c:107: warning: long long int format, off_t arg (arg 2) *** Error code 1 `all' not remade because of errors. ===> colldef Warning: Object directory not changed from original /j/kris/src/usr.bin/colldef cc -O -pipe -mcpu=ev5 -Wall -I. -I/j/kris/src/usr.bin/colldef/../../lib/libc/locale -DCOLLATE_DEBUG -Wnon-const-format -Wno-format-extra-args -Werror -c scan.c cc1: warnings being treated as errors scan.l:638: warning: `yyunput' defined but not used *** Error code 1 `all' not remade because of errors. ===> compile_et Warning: Object directory not changed from original /j/kris/src/usr.bin/compile_et cc -O -pipe -mcpu=ev5 -I. -I/j/kris/src/usr.bin/compile_et/../../contrib/com_err -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/compile_et/../../contrib/com_err/getarg.c cc -O -pipe -mcpu=ev5 -I. -I/j/kris/src/usr.bin/compile_et/../../contrib/com_err -Wnon-const-format -Wno-format-extra-args -Werror -c lex.c cc1: warnings being treated as errors /j/kris/src/usr.bin/compile_et/../../contrib/com_err/getarg.c: In function `print_arg': /j/kris/src/usr.bin/compile_et/../../contrib/com_err/getarg.c:80: warning: type mismatch in implicit declaration for built-in function `strlen' /j/kris/src/usr.bin/compile_et/../../contrib/com_err/getarg.c: In function `add_string': /j/kris/src/usr.bin/compile_et/../../contrib/com_err/getarg.c:178: warning: assignment makes pointer from integer without a cast /j/kris/src/usr.bin/compile_et/../../contrib/com_err/getarg.c: In function `arg_match_long': /j/kris/src/usr.bin/compile_et/../../contrib/com_err/getarg.c:197: warning: assignment makes pointer from integer without a cast *** Error code 1 cc1: warnings being treated as errors /j/kris/src/usr.bin/compile_et/../../contrib/com_err/lex.l: In function `error_message': /j/kris/src/usr.bin/compile_et/../../contrib/com_err/lex.l:126: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> du Warning: Object directory not changed from original /j/kris/src/usr.bin/du cc -O -pipe -mcpu=ev5 -Wall -Wnon-const-format -Wno-format-extra-args -Werror -c du.c cc1: warnings being treated as errors du.c: In function `main': du.c:286: warning: long long int format, long int arg (arg 2) *** Error code 1 `all' not remade because of errors. ===> ee Warning: Object directory not changed from original /j/kris/src/usr.bin/ee cc -O -pipe -mcpu=ev5 -DCAP -DHAS_NCURSES -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB -DHAS_CTYPE -DHAS_SYS_IOCTL -DHAS_SYS_WAIT -DSLCT_HDR -Wall -Wnon-const-format -Wno-format-extra-args -Werror -c ee.c cc1: warnings being treated as errors ee.c: In function `get_options': ee.c:2086: warning: non-constant format parameter ee.c:2087: warning: non-constant format parameter ee.c:2088: warning: non-constant format parameter ee.c:2089: warning: non-constant format parameter ee.c:2090: warning: non-constant format parameter ee.c: In function `sh_command': ee.c:3152: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> file Warning: Object directory not changed from original /j/kris/src/usr.bin/file cc -O -pipe -mcpu=ev5 -DMAGIC='"/usr/share/misc/magic"' -DBUILTIN_ELF -DELFCORE -DHAVE_CONFIG_H -I/j/kris/src/usr.bin/file -I/j/kris/src/usr.bin/file/../../contrib/file -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/file/../../contrib/file/softmagic.c cc -O -pipe -mcpu=ev5 -DMAGIC='"/usr/share/misc/magic"' -DBUILTIN_ELF -DELFCORE -DHAVE_CONFIG_H -I/j/kris/src/usr.bin/file -I/j/kris/src/usr.bin/file/../../contrib/file -Wnon-const-format -Wno-format-extra-args -Werror -c print-hacked.c cc1: warnings being treated as errors /j/kris/src/usr.bin/file/../../contrib/file/softmagic.c: In function `mprint': /j/kris/src/usr.bin/file/../../contrib/file/softmagic.c:227: warning: non-constant format parameter /j/kris/src/usr.bin/file/../../contrib/file/softmagic.c:235: warning: non-constant format parameter /j/kris/src/usr.bin/file/../../contrib/file/softmagic.c:243: warning: non-constant format parameter /j/kris/src/usr.bin/file/../../contrib/file/softmagic.c:250: warning: non-constant format parameter /j/kris/src/usr.bin/file/../../contrib/file/softmagic.c:259: warning: non-constant format parameter /j/kris/src/usr.bin/file/../../contrib/file/softmagic.c:267: warning: non-constant format parameter /j/kris/src/usr.bin/file/../../contrib/file/softmagic.c:274: warning: non-constant format parameter cc1: warnings being treated as errors print-hacked.c: In function `mdump': print-hacked.c:62: warning: non-constant format parameter print-hacked.c: In function `ckfprintf': print-hacked.c:165: warning: non-constant format parameter print-hacked.c: In function `error': print-hacked.c:196: warning: non-constant format parameter print-hacked.c: In function `magwarn': print-hacked.c:224: warning: non-constant format parameter *** Error code 1 *** Error code 1 `all' not remade because of errors. ===> find Warning: Object directory not changed from original /j/kris/src/usr.bin/find cc -O -pipe -mcpu=ev5 -Wall -I/j/kris/src/usr.bin/find/../../gnu/usr.bin/cvs/lib -DHAVE_CONFIG_H -Wnon-const-format -Wno-format-extra-args -Werror -c ls.c cc1: warnings being treated as errors ls.c: In function `printlong': ls.c:68: warning: long long int format, int64_t arg (arg 3) ls.c:78: warning: long long int format, off_t arg (arg 2) *** Error code 1 `all' not remade because of errors. ===> finger Warning: Object directory not changed from original /j/kris/src/usr.bin/finger cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c lprint.c cc1: warnings being treated as errors lprint.c: In function `lprint': lprint.c:190: warning: precision is not type int (arg 2) *** Error code 1 `all' not remade because of errors. ===> fmt Warning: Object directory not changed from original /j/kris/src/usr.bin/fmt cc -O -pipe -mcpu=ev5 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wnon-const-format -Wno-format-extra-args -Werror -c fmt.c cc1: warnings being treated as errors fmt.c: In function `get_positive': fmt.c:201: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> ftp Warning: Object directory not changed from original /j/kris/src/usr.bin/ftp cc -O -pipe -mcpu=ev5 -DINET6 -Wnon-const-format -Wno-format-extra-args -Werror -c ftp.c cc -O -pipe -mcpu=ev5 -DINET6 -Wnon-const-format -Wno-format-extra-args -Werror -c util.c cc1: warnings being treated as errors ftp.c: In function `command': ftp.c:299: warning: non-constant format parameter ftp.c:316: warning: non-constant format parameter cc1: warnings being treated as errors util.c: In function `remotemodtime': util.c:537: warning: non-constant format parameter *** Error code 1 *** Error code 1 `all' not remade because of errors. ===> gprof Warning: Object directory not changed from original /j/kris/src/usr.bin/gprof cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c gprof.c cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c arcs.c cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c printgprof.c cc1: warnings being treated as errors gprof.c: In function `main': gprof.c:158: warning: type mismatch in implicit declaration for built-in function `strlen' gprof.c:159: warning: type mismatch in implicit declaration for built-in function `strcpy' cc1: warnings being treated as errors printgprof.c: In function `flatprofheader': printgprof.c:103: warning: int format, different type arg (arg 2) printgprof.c: In function `flatprofline': printgprof.c:141: warning: int format, different type arg (arg 2) printgprof.c:145: warning: int format, different type arg (arg 2) printgprof.c:149: warning: int format, different type arg (arg 2) gprof.c: In function `openpfile': gprof.c:298: warning: int format, different type arg (arg 6) printgprof.c: In function `gprofheader': printgprof.c:164: warning: int format, different type arg (arg 2) printgprof.c: In function `gprofline': printgprof.c:197: warning: int format, different type arg (arg 2) printgprof.c:199: warning: int format, different type arg (arg 2) cc1: warnings being treated as errors arcs.c: In function `cyclelink': arcs.c:383: warning: int format, different type arg (arg 2) gprof.c: In function `readsamples': gprof.c:426: warning: int format, different type arg (arg 2) printgprof.c: In function `printparents': printgprof.c:319: warning: int format, different type arg (arg 6) arcs.c: In function `cycleanalyze': printgprof.c:329: warning: int format, different type arg (arg 6) arcs.c:487: warning: int format, different type arg (arg 2) printgprof.c:329: warning: int format, different type arg (arg 7) printgprof.c: In function `printchildren': printgprof.c:352: warning: int format, different type arg (arg 6) printgprof.c:362: warning: int format, different type arg (arg 6) printgprof.c:362: warning: int format, different type arg (arg 7) *** Error code 1 printgprof.c: In function `printcycle': printgprof.c:490: warning: int format, different type arg (arg 6) printgprof.c:492: warning: int format, different type arg (arg 2) printgprof.c: In function `printmembers': printgprof.c:512: warning: int format, different type arg (arg 6) printgprof.c:514: warning: int format, different type arg (arg 2) arcs.c: In function `addcycle': arcs.c:604: warning: int format, different type arg (arg 2) *** Error code 1 arcs.c: In function `compresslist': arcs.c:725: warning: int format, different type arg (arg 4) *** Error code 1 `all' not remade because of errors. ===> hexdump Warning: Object directory not changed from original /j/kris/src/usr.bin/hexdump cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c conv.c cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c display.c cc1: warnings being treated as errors conv.c: In function `conv_c': conv.c:87: warning: non-constant format parameter conv.c:91: warning: non-constant format parameter conv.c: In function `conv_u': conv.c:112: warning: non-constant format parameter conv.c:114: warning: non-constant format parameter conv.c:117: warning: non-constant format parameter conv.c:120: warning: non-constant format parameter conv.c:123: warning: non-constant format parameter conv.c:126: warning: non-constant format parameter cc1: warnings being treated as errors display.c: In function `display': display.c:106: warning: non-constant format parameter *** Error code 1 display.c: In function `print': display.c:131: warning: non-constant format parameter display.c:134: warning: non-constant format parameter display.c:140: warning: non-constant format parameter display.c:146: warning: non-constant format parameter display.c:150: warning: non-constant format parameter display.c:157: warning: non-constant format parameter display.c:161: warning: non-constant format parameter display.c:165: warning: non-constant format parameter display.c:169: warning: non-constant format parameter display.c:174: warning: non-constant format parameter display.c:177: warning: non-constant format parameter display.c:188: warning: non-constant format parameter display.c:192: warning: non-constant format parameter display.c:196: warning: non-constant format parameter display.c:200: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> id Warning: Object directory not changed from original /j/kris/src/usr.bin/id cc -O -pipe -mcpu=ev5 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wnon-const-format -Wno-format-extra-args -Werror -c id.c cc1: warnings being treated as errors id.c: In function `current': id.c:235: warning: non-constant format parameter id.c: In function `user': id.c:262: warning: non-constant format parameter id.c: In function `group': id.c:294: warning: non-constant format parameter id.c:300: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> indent Warning: Object directory not changed from original /j/kris/src/usr.bin/indent cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c io.c cc1: warnings being treated as errors io.c: In function `dump_line': io.c:127: warning: field width is not type int (arg 3) io.c:129: warning: field width is not type int (arg 3) io.c: In function `diag': io.c:544: warning: non-constant format parameter io.c:549: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> ipcrm Warning: Object directory not changed from original /j/kris/src/usr.bin/ipcrm cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c ipcrm.c cc1: warnings being treated as errors ipcrm.c: In function `main': ipcrm.c:156: warning: unknown conversion type character `k' in format ipcrm.c:156: warning: long int format, pointer arg (arg 2) *** Error code 1 `all' not remade because of errors. ===> ipcs Warning: Object directory not changed from original /j/kris/src/usr.bin/ipcs cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c ipcs.c cc1: warnings being treated as errors ipcs.c: In function `main': ipcs.c:331: warning: int format, different type arg (arg 3) ipcs.c:341: warning: int format, different type arg (arg 2) ipcs.c:341: warning: int format, different type arg (arg 3) ipcs.c:345: warning: int format, different type arg (arg 2) ipcs.c:420: warning: int format, different type arg (arg 3) ipcs.c:512: warning: int format, different type arg (arg 3) ipcs.c: In function `sysctlgatherstruct': ipcs.c:563: warning: int format, different type arg (arg 4) ipcs.c:563: warning: int format, different type arg (arg 5) ipcs.c: In function `kget': ipcs.c:645: warning: int format, different type arg (arg 4) ipcs.c:645: warning: int format, different type arg (arg 5) *** Error code 1 `all' not remade because of errors. ===> jot Warning: Object directory not changed from original /j/kris/src/usr.bin/jot cc -O -pipe -mcpu=ev5 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wnon-const-format -Wno-format-extra-args -Werror -c jot.c cc1: warnings being treated as errors jot.c: In function `putdata': jot.c:303: warning: non-constant format parameter jot.c:308: warning: non-constant format parameter jot.c:313: warning: non-constant format parameter jot.c:318: warning: non-constant format parameter jot.c:323: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> kdump Warning: Object directory not changed from original /j/kris/src/usr.bin/kdump cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/kdump/../ktrace -I/j/kris/src/usr.bin/kdump/../.. -Wnon-const-format -Wno-format-extra-args -Werror -c kdump.c cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/kdump/../ktrace -I/j/kris/src/usr.bin/kdump/../.. -Wnon-const-format -Wno-format-extra-args -Werror -c ioctl.c In file included from ioctl.c:81: /usr/include/sys/memrange.h:18: warning: `MDF_ACTIVE' redefined /usr/include/pccard/cardinfo.h:81: warning: this is the location of the previous definition cc1: warnings being treated as errors kdump.c: In function `ktrsysret': kdump.c:336: warning: int format, different type arg (arg 2) kdump.c: In function `ktrpsig': kdump.c:443: warning: unsigned int format, sigset_t arg (arg 3) *** Error code 1 *** Error code 1 `all' not remade because of errors. ===> kenv Warning: Object directory not changed from original /j/kris/src/usr.bin/kenv cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c kenv.c cc1: warnings being treated as errors kenv.c: In function `main': kenv.c:87: warning: passing arg 4 of `sysctl' from incompatible pointer type *** Error code 1 `all' not remade because of errors. ===> killall Warning: Object directory not changed from original /j/kris/src/usr.bin/killall cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c killall.c cc1: warnings being treated as errors killall.c: In function `main': killall.c:281: warning: int format, different type arg (arg 3) killall.c:281: warning: int format, different type arg (arg 4) *** Error code 1 `all' not remade because of errors. ===> lam Warning: Object directory not changed from original /j/kris/src/usr.bin/lam cc -O -pipe -mcpu=ev5 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wnon-const-format -Wno-format-extra-args -Werror -c lam.c cc1: warnings being treated as errors lam.c: In function `pad': lam.c:187: warning: non-constant format parameter lam.c: In function `gatherline': lam.c:217: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> less Warning: Object directory not changed from original /j/kris/src/usr.bin/less cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/less/../less -I/j/kris/src/usr.bin/less/../../contrib/less -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/less/../../contrib/less/charset.c cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/less/../less -I/j/kris/src/usr.bin/less/../../contrib/less -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/less/../../contrib/less/filename.c cc1: warnings being treated as errors /j/kris/src/usr.bin/less/../../contrib/less/charset.c: In function `prchar': /j/kris/src/usr.bin/less/../../contrib/less/charset.c:292: warning: non-constant format parameter *** Error code 1 cc1: warnings being treated as errors /j/kris/src/usr.bin/less/../../contrib/less/filename.c: In function `open_altfile': /j/kris/src/usr.bin/less/../../contrib/less/filename.c:814: warning: non-constant format parameter /j/kris/src/usr.bin/less/../../contrib/less/filename.c: In function `close_altfile': /j/kris/src/usr.bin/less/../../contrib/less/filename.c:897: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> lex Warning: Object directory not changed from original /j/kris/src/usr.bin/lex cc -O -pipe -mcpu=ev5 -I. -I/j/kris/src/usr.bin/lex -Wnon-const-format -Wno-format-extra-args -Werror -c main.c cc -O -pipe -mcpu=ev5 -I. -I/j/kris/src/usr.bin/lex -Wnon-const-format -Wno-format-extra-args -Werror -c misc.c cc -O -pipe -mcpu=ev5 -I. -I/j/kris/src/usr.bin/lex -Wnon-const-format -Wno-format-extra-args -Werror -c parse.c cc1: warnings being treated as errors main.c: In function `check_options': main.c:289: warning: non-constant format parameter cc1: warnings being treated as errors parse.y: In function `format_synerr': parse.y:823: warning: non-constant format parameter parse.y: In function `format_warn': parse.y:845: warning: non-constant format parameter parse.y: In function `format_pinpoint_message': parse.y:867: warning: non-constant format parameter cc1: warnings being treated as errors misc.c: In function `lerrif': misc.c:366: warning: non-constant format parameter misc.c: In function `lerrsf': misc.c:378: warning: non-constant format parameter misc.c: In function `line_directive_out': misc.c:416: warning: non-constant format parameter misc.c:423: warning: non-constant format parameter misc.c: In function `out_dec': misc.c:634: warning: non-constant format parameter misc.c: In function `out_dec2': misc.c:642: warning: non-constant format parameter misc.c: In function `out_hex': misc.c:650: warning: non-constant format parameter misc.c: In function `out_str': misc.c:667: warning: non-constant format parameter misc.c: In function `out_str3': misc.c:675: warning: non-constant format parameter misc.c: In function `out_str_dec': misc.c:686: warning: non-constant format parameter main.c: In function `usage': main.c:1138: warning: non-constant format parameter *** Error code 1 *** Error code 1 *** Error code 1 `all' not remade because of errors. ===> limits Warning: Object directory not changed from original /j/kris/src/usr.bin/limits cc -O -pipe -mcpu=ev5 -Wall -Wnon-const-format -Wno-format-extra-args -Werror -c limits.c cc1: warnings being treated as errors limits.c: In function `main': limits.c:414: warning: non-constant format parameter limits.c: In function `print_limit': limits.c:471: warning: long long int format, long int arg (arg 3) limits.c:472: warning: non-constant format parameter limits.c:473: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> login Warning: Object directory not changed from original /j/kris/src/usr.bin/login cc -O -pipe -mcpu=ev5 -Wall -DLOGIN_ACCESS -DLOGALL -DUSE_PAM -Wnon-const-format -Wno-format-extra-args -Werror -c login.c cc1: warnings being treated as errors login.c: In function `main': login.c:152: warning: argument `argv' might be clobbered by `longjmp' or `vfork' login.c: In function `getloginname': login.c:901: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> mail Warning: Object directory not changed from original /j/kris/src/usr.bin/mail cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c main.c cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c cmd1.c cc1: warnings being treated as errors main.c: In function `main': main.c:196: warning: precision is not type int (arg 4) cc1: warnings being treated as errors cmd1.c: In function `pdot': cmd1.c:221: warning: int format, different type arg (arg 2) *** Error code 1 *** Error code 1 `all' not remade because of errors. ===> make Warning: Object directory not changed from original /j/kris/src/usr.bin/make cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/make -DDEFSHELL=1 -Wnon-const-format -Wno-format-extra-args -Werror -c arch.c cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/make -DDEFSHELL=1 -Wnon-const-format -Wno-format-extra-args -Werror -c job.c cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/make -DDEFSHELL=1 -Wnon-const-format -Wno-format-extra-args -Werror -c main.c cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/make -DDEFSHELL=1 -Wnon-const-format -Wno-format-extra-args -Werror -c parse.c cc1: warnings being treated as errors parse.c: In function `Parse_Error': parse.c:337: warning: non-constant format parameter cc1: warnings being treated as errors job.c: In function `JobPrintCommand': job.c:627: warning: non-constant format parameter job.c:627: warning: non-constant format parameter job.c:645: warning: non-constant format parameter job.c:645: warning: non-constant format parameter job.c: In function `JobFinish': job.c:831: warning: non-constant format parameter job.c:843: warning: non-constant format parameter job.c:854: warning: non-constant format parameter job.c:877: warning: non-constant format parameter cc1: warnings being treated as errors arch.c: In function `ArchSVR4Entry': job.c:922: warning: non-constant format parameter arch.c:735: warning: int format, different type arg (arg 2) arch.c:753: warning: int format, different type arg (arg 3) *** Error code 1 cc1: warnings being treated as errors main.c: In function `Error': main.c:1119: warning: non-constant format parameter main.c: In function `Fatal': main.c:1157: warning: non-constant format parameter main.c: In function `Punt': main.c:1198: warning: non-constant format parameter *** Error code 1 job.c: In function `JobExec': job.c:1216: warning: non-constant format parameter job.c: In function `JobStart': job.c:1809: warning: non-constant format parameter job.c: In function `JobOutput': job.c:1976: warning: non-constant format parameter job.c: In function `JobDoOutput': job.c:2138: warning: non-constant format parameter *** Error code 1 *** Error code 1 `all' not remade because of errors. ===> mt Warning: Object directory not changed from original /j/kris/src/usr.bin/mt cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c mt.c cc1: warnings being treated as errors mt.c: In function `st_status': mt.c:717: warning: long int format, different type arg (arg 2) mt.c:717: warning: long int format, different type arg (arg 3) *** Error code 1 `all' not remade because of errors. ===> ncal Warning: Object directory not changed from original /j/kris/src/usr.bin/ncal cc -O -pipe -mcpu=ev5 -Wall -Wmissing-prototypes -fstrict-prototypes -ansi -pedantic -Wnon-const-format -Wno-format-extra-args -Werror -c ncal.c cc1: warnings being treated as errors ncal.c: In function `mkmonth': ncal.c:590: warning: flag `O' used with type `B' ncal.c: In function `mkmonthb': ncal.c:682: warning: flag `O' used with type `B' *** Error code 1 `all' not remade because of errors. ===> netstat Warning: Object directory not changed from original /j/kris/src/usr.bin/netstat cc -O -pipe -mcpu=ev5 -Wall -DIPSEC -DINET6 -Wnon-const-format -Wno-format-extra-args -Werror -c if.c cc -O -pipe -mcpu=ev5 -Wall -DIPSEC -DINET6 -Wnon-const-format -Wno-format-extra-args -Werror -c mbuf.c cc -O -pipe -mcpu=ev5 -Wall -DIPSEC -DINET6 -Wnon-const-format -Wno-format-extra-args -Werror -c route.c In file included from if.c:52: /usr/include/net/bridge.h:101: warning: #warning ... must complete these for the alpha etc. mbuf.c: In function `mbpr': mbuf.c:255: structure has no member named `mb_active' mbuf.c:279: structure has no member named `mb_active' cc1: warnings being treated as errors if.c: In function `show_stat': if.c:143: warning: non-constant format parameter if.c:146: warning: non-constant format parameter *** Error code 1 cc1: warnings being treated as errors route.c: In function `p_flags': route.c:572: warning: non-constant format parameter *** Error code 1 *** Error code 1 `all' not remade because of errors. ===> nl Warning: Object directory not changed from original /j/kris/src/usr.bin/nl cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c nl.c cc1: warnings being treated as errors nl.c: In function `filter': nl.c:363: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> printf Warning: Object directory not changed from original /j/kris/src/usr.bin/printf cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c printf.c cc1: warnings being treated as errors printf.c: In function `main': printf.c:216: warning: non-constant format parameter printf.c:216: warning: non-constant format parameter printf.c:216: warning: non-constant format parameter printf.c:216: warning: non-constant format parameter printf.c:223: warning: non-constant format parameter printf.c:223: warning: non-constant format parameter printf.c:223: warning: non-constant format parameter printf.c:223: warning: non-constant format parameter printf.c:234: warning: non-constant format parameter printf.c:234: warning: non-constant format parameter printf.c:234: warning: non-constant format parameter printf.c:234: warning: non-constant format parameter printf.c:241: warning: non-constant format parameter printf.c:241: warning: non-constant format parameter printf.c:241: warning: non-constant format parameter printf.c:241: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> quota Warning: Object directory not changed from original /j/kris/src/usr.bin/quota cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c quota.c cc1: warnings being treated as errors quota.c: In function `showquotas': quota.c:386: warning: long unsigned int format, different type arg (arg 2) quota.c:386: warning: long unsigned int format, different type arg (arg 4) quota.c:386: warning: long unsigned int format, different type arg (arg 5) quota.c: In function `timeprt': quota.c:437: warning: long int format, different type arg (arg 3) quota.c:441: warning: long int format, different type arg (arg 3) quota.c:441: warning: long int format, different type arg (arg 4) quota.c:444: warning: long int format, different type arg (arg 3) *** Error code 1 `all' not remade because of errors. ===> rpcgen Warning: Object directory not changed from original /j/kris/src/usr.bin/rpcgen cc -O -pipe -mcpu=ev5 -Dinline=rpcgen_inline -Wnon-const-format -Wno-format-extra-args -Werror -c rpc_main.c cc -O -pipe -mcpu=ev5 -Dinline=rpcgen_inline -Wnon-const-format -Wno-format-extra-args -Werror -c rpc_cout.c cc -O -pipe -mcpu=ev5 -Dinline=rpcgen_inline -Wnon-const-format -Wno-format-extra-args -Werror -c rpc_hout.c cc -O -pipe -mcpu=ev5 -Dinline=rpcgen_inline -Wnon-const-format -Wno-format-extra-args -Werror -c rpc_svcout.c cc -O -pipe -mcpu=ev5 -Dinline=rpcgen_inline -Wnon-const-format -Wno-format-extra-args -Werror -c rpc_tblout.c cc1: warnings being treated as errors rpc_tblout.c: In function `write_table': rpc_tblout.c:101: warning: non-constant format parameter rpc_tblout.c:107: warning: non-constant format parameter rpc_tblout.c:145: warning: non-constant format parameter rpc_tblout.c:146: warning: non-constant format parameter cc1: warnings being treated as errors rpc_cout.c: In function `emit_union': rpc_cout.c:364: warning: non-constant format parameter rpc_cout.c:367: warning: non-constant format parameter rpc_cout.c:383: warning: non-constant format parameter rpc_cout.c:386: warning: non-constant format parameter *** Error code 1 cc1: warnings being treated as errors rpc_svcout.c: In function `write_real_program': rpc_svcout.c:351: warning: non-constant format parameter cc1: warnings being treated as errors cc1: warnings being treated as errors rpc_hout.c: In function `pdeclaration': rpc_main.c: In function `h_output': rpc_hout.c:577: warning: non-constant format parameter rpc_main.c:623: warning: non-constant format parameter *** Error code 1 *** Error code 1 *** Error code 1 *** Error code 1 `all' not remade because of errors. ===> rup Warning: Object directory not changed from original /j/kris/src/usr.bin/rup cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c rup.c cc1: warnings being treated as errors rup.c: In function `allhosts': rup.c:197: warning: passing arg 8 of `clnt_broadcast' from incompatible pointer type *** Error code 1 `all' not remade because of errors. ===> rusers Warning: Object directory not changed from original /j/kris/src/usr.bin/rusers cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c rusers.c cc1: warnings being treated as errors rusers.c: In function `allhosts': rusers.c:206: warning: passing arg 8 of `clnt_broadcast' from incompatible pointer type *** Error code 1 `all' not remade because of errors. ===> rwho Warning: Object directory not changed from original /j/kris/src/usr.bin/rwho cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c rwho.c cc1: warnings being treated as errors rwho.c: In function `main': rwho.c:170: warning: field width is not type int (arg 4) rwho.c:176: warning: field width is not type int (arg 3) *** Error code 1 `all' not remade because of errors. ===> systat Warning: Object directory not changed from original /j/kris/src/usr.bin/systat cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c fetch.c cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c mbufs.c cc1: warnings being treated as errors fetch.c: In function `kvm_ckread': fetch.c:58: warning: unsigned int format, pointer arg (arg 2) *** Error code 1 mbufs.c: In function `showmbufs': mbufs.c:154: structure has no member named `mb_active' *** Error code 1 `all' not remade because of errors. ===> tail Warning: Object directory not changed from original /j/kris/src/usr.bin/tail cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c reverse.c cc1: warnings being treated as errors reverse.c: In function `r_buf': reverse.c:251: warning: long long int format, off_t arg (arg 2) *** Error code 1 `all' not remade because of errors. ===> tcopy Warning: Object directory not changed from original /j/kris/src/usr.bin/tcopy cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c tcopy.c cc1: warnings being treated as errors tcopy.c: In function `main': tcopy.c:159: warning: long long unsigned int format, u_int64_t arg (arg 4) tcopy.c:163: warning: long long unsigned int format, u_int64_t arg (arg 3) tcopy.c:166: warning: long long unsigned int format, u_int64_t arg (arg 3) tcopy.c:166: warning: long long unsigned int format, u_int64_t arg (arg 4) tcopy.c:168: warning: long long unsigned int format, u_int64_t arg (arg 3) tcopy.c:186: warning: long long unsigned int format, u_int64_t arg (arg 3) tcopy.c:188: warning: long long unsigned int format, u_int64_t arg (arg 3) tcopy.c:203: warning: long long unsigned int format, u_int64_t arg (arg 4) tcopy.c:203: warning: long long unsigned int format, u_int64_t arg (arg 5) tcopy.c:212: warning: long long unsigned int format, u_int64_t arg (arg 3) tcopy.c: In function `intr': tcopy.c:286: warning: long long unsigned int format, u_int64_t arg (arg 3) tcopy.c:286: warning: long long unsigned int format, u_int64_t arg (arg 4) tcopy.c:288: warning: long long unsigned int format, u_int64_t arg (arg 3) tcopy.c:290: warning: long long unsigned int format, u_int64_t arg (arg 4) *** Error code 1 `all' not remade because of errors. ===> tftp Warning: Object directory not changed from original /j/kris/src/usr.bin/tftp cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c tftp.c cc1: warnings being treated as errors tftp.c: In function `printstats': tftp.c:442: warning: int format, different type arg (arg 3) *** Error code 1 `all' not remade because of errors. ===> top Warning: Object directory not changed from original /j/kris/src/usr.bin/top cc -O -pipe -mcpu=ev5 -DHAVE_GETOPT -I/j/kris/src/usr.bin/top -I/j/kris/src/usr.bin/top/../../contrib/top -I. -DORDER -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/top/../../contrib/top/display.c cc -O -pipe -mcpu=ev5 -DHAVE_GETOPT -I/j/kris/src/usr.bin/top -I/j/kris/src/usr.bin/top/../../contrib/top -I. -DORDER -Wnon-const-format -Wno-format-extra-args -Werror -c machine.c cc1: warnings being treated as errors machine.c: In function `format_header': machine.c:272: warning: non-constant format parameter cc1: warnings being treated as errors /j/kris/src/usr.bin/top/../../contrib/top/display.c: In function `new_message': /j/kris/src/usr.bin/top/../../contrib/top/display.c:834: warning: non-constant format parameter *** Error code 1 *** Error code 1 `all' not remade because of errors. ===> tput Warning: Object directory not changed from original /j/kris/src/usr.bin/tput cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c tput.c cc1: warnings being treated as errors tput.c: In function `process': tput.c:171: warning: non-constant format parameter tput.c:183: warning: non-constant format parameter tput.c:190: warning: non-constant format parameter tput.c:194: warning: non-constant format parameter tput.c:201: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> truss Warning: Object directory not changed from original /j/kris/src/usr.bin/truss cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/truss -I. -Wnon-const-format -Wno-format-extra-args -Werror -c ioctl.c In file included from ioctl.c:81: /usr/include/sys/memrange.h:18: warning: `MDF_ACTIVE' redefined /usr/include/pccard/cardinfo.h:81: warning: this is the location of the previous definition *** Error code 1 `all' not remade because of errors. ===> vacation Warning: Object directory not changed from original /j/kris/src/usr.bin/vacation cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/vacation/../../contrib/sendmail/src -I/j/kris/src/usr.bin/vacation/../../contrib/sendmail/include -DNEWDB -DNOT_SENDMAIL -D_FFR_LISTDB -D_FFR_DEBUG -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/vacation/../../contrib/sendmail/vacation/vacation.c cc1: warnings being treated as errors /j/kris/src/usr.bin/vacation/../../contrib/sendmail/vacation/vacation.c: In function `debuglog': /j/kris/src/usr.bin/vacation/../../contrib/sendmail/vacation/vacation.c:1149: warning: non-constant format parameter /j/kris/src/usr.bin/vacation/../../contrib/sendmail/vacation/vacation.c: In function `message': /j/kris/src/usr.bin/vacation/../../contrib/sendmail/vacation/vacation.c:1173: warning: non-constant format parameter /j/kris/src/usr.bin/vacation/../../contrib/sendmail/vacation/vacation.c: In function `syserr': /j/kris/src/usr.bin/vacation/../../contrib/sendmail/vacation/vacation.c:1197: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> vi Warning: Object directory not changed from original /j/kris/src/usr.bin/vi cc -O -pipe -mcpu=ev5 -DGTAGS -DSYSV_CURSES -I/j/kris/src/usr.bin/vi -I/j/kris/src/usr.bin/vi/../../contrib/nvi -I/j/kris/src/usr.bin/vi/../../contrib/nvi/include -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/vi/../../contrib/nvi/common/exf.c cc -O -pipe -mcpu=ev5 -DGTAGS -DSYSV_CURSES -I/j/kris/src/usr.bin/vi -I/j/kris/src/usr.bin/vi/../../contrib/nvi -I/j/kris/src/usr.bin/vi/../../contrib/nvi/include -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/vi/../../contrib/nvi/common/msg.c cc -O -pipe -mcpu=ev5 -DGTAGS -DSYSV_CURSES -I/j/kris/src/usr.bin/vi -I/j/kris/src/usr.bin/vi/../../contrib/nvi -I/j/kris/src/usr.bin/vi/../../contrib/nvi/include -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/vi/../../contrib/nvi/ex/ex_cscope.c cc -O -pipe -mcpu=ev5 -DGTAGS -DSYSV_CURSES -I/j/kris/src/usr.bin/vi -I/j/kris/src/usr.bin/vi/../../contrib/nvi -I/j/kris/src/usr.bin/vi/../../contrib/nvi/include -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/vi/../../contrib/nvi/ex/ex_print.c cc -O -pipe -mcpu=ev5 -DGTAGS -DSYSV_CURSES -I/j/kris/src/usr.bin/vi -I/j/kris/src/usr.bin/vi/../../contrib/nvi -I/j/kris/src/usr.bin/vi/../../contrib/nvi/include -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/vi/../../contrib/nvi/ex/ex_subst.c cc -O -pipe -mcpu=ev5 -DGTAGS -DSYSV_CURSES -I/j/kris/src/usr.bin/vi -I/j/kris/src/usr.bin/vi/../../contrib/nvi -I/j/kris/src/usr.bin/vi/../../contrib/nvi/include -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/getc.c cc -O -pipe -mcpu=ev5 -DGTAGS -DSYSV_CURSES -I/j/kris/src/usr.bin/vi -I/j/kris/src/usr.bin/vi/../../contrib/nvi -I/j/kris/src/usr.bin/vi/../../contrib/nvi/include -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_increment.c cc -O -pipe -mcpu=ev5 -DGTAGS -DSYSV_CURSES -I/j/kris/src/usr.bin/vi -I/j/kris/src/usr.bin/vi/../../contrib/nvi -I/j/kris/src/usr.bin/vi/../../contrib/nvi/include -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_txt.c cc1: warnings being treated as errors /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/getc.c: In function `cs_init': /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/getc.c:52: warning: passing arg 3 of `db_eget' from incompatible pointer type cc1: warnings being treated as errors /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_increment.c: In function `v_increment': /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_increment.c:206: warning: non-constant format parameter /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/getc.c: In function `cs_prev': /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_increment.c:228: warning: non-constant format parameter /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/getc.c:182: warning: passing arg 4 of `db_get' from incompatible pointer type *** Error code 1 cc -O -pipe -mcpu=ev5 -DGTAGS -DSYSV_CURSES -I/j/kris/src/usr.bin/vi -I/j/kris/src/usr.bin/vi/../../contrib/nvi -I/j/kris/src/usr.bin/vi/../../contrib/nvi/include -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_ulcase.c cc1: warnings being treated as errors /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_ulcase.c: In function `v_mulcase': /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_ulcase.c:119: warning: passing arg 4 of `db_get' from incompatible pointer type *** Error code 1 *** Error code 1 cc1: warnings being treated as errors /j/kris/src/usr.bin/vi/../../contrib/nvi/ex/ex_print.c: In function `ex_printf': /j/kris/src/usr.bin/vi/../../contrib/nvi/ex/ex_print.c:296: warning: non-constant format parameter *** Error code 1 cc1: warnings being treated as errors /j/kris/src/usr.bin/vi/../../contrib/nvi/common/exf.c: In function `file_write': /j/kris/src/usr.bin/vi/../../contrib/nvi/common/exf.c:976: warning: non-constant format parameter /j/kris/src/usr.bin/vi/../../contrib/nvi/common/exf.c:982: warning: non-constant format parameter cc1: warnings being treated as errors /j/kris/src/usr.bin/vi/../../contrib/nvi/common/msg.c: In function `msgq': /j/kris/src/usr.bin/vi/../../contrib/nvi/common/msg.c:281: warning: non-constant format parameter /j/kris/src/usr.bin/vi/../../contrib/nvi/common/msg.c: In function `msgq_status': /j/kris/src/usr.bin/vi/../../contrib/nvi/common/msg.c:547: warning: non-constant format parameter /j/kris/src/usr.bin/vi/../../contrib/nvi/common/msg.c:622: warning: non-constant format parameter /j/kris/src/usr.bin/vi/../../contrib/nvi/common/msg.c:627: warning: non-constant format parameter cc1: warnings being treated as errors /j/kris/src/usr.bin/vi/../../contrib/nvi/ex/ex_cscope.c: In function `cscope_find': /j/kris/src/usr.bin/vi/../../contrib/nvi/ex/ex_cscope.c:499: warning: int format, different type arg (arg 3) cc1: warnings being treated as errors /j/kris/src/usr.bin/vi/../../contrib/nvi/ex/ex_subst.c: In function `s': /j/kris/src/usr.bin/vi/../../contrib/nvi/ex/ex_subst.c:423: warning: comparison is always false due to limited range of data type /j/kris/src/usr.bin/vi/../../contrib/nvi/common/exf.c: In function `file_backup': /j/kris/src/usr.bin/vi/../../contrib/nvi/common/exf.c:1126: warning: non-constant format parameter *** Error code 1 *** Error code 1 *** Error code 1 *** Error code 1 cc1: warnings being treated as errors /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_txt.c: In function `txt_fc_col': /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_txt.c:2226: warning: comparison of distinct pointer types lacks a cast /j/kris/src/usr.bin/vi/../../contrib/nvi/vi/v_txt.c:2244: warning: comparison of distinct pointer types lacks a cast *** Error code 1 `all' not remade because of errors. ===> vmstat Warning: Object directory not changed from original /j/kris/src/usr.bin/vmstat cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c vmstat.c cc1: warnings being treated as errors vmstat.c: In function `dointr': vmstat.c:749: warning: long long unsigned int format, u_int64_t arg (arg 2) vmstat.c:749: warning: long long unsigned int format, long unsigned int arg (arg 3) vmstat.c: In function `domem': vmstat.c:797: warning: long long int format, int64_t arg (arg 4) vmstat.c:845: warning: long long int format, int64_t arg (arg 7) *** Error code 1 `all' not remade because of errors. ===> wc Warning: Object directory not changed from original /j/kris/src/usr.bin/wc cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c wc.c cc1: warnings being treated as errors wc.c: In function `main': wc.c:116: warning: long long unsigned int format, u_quad_t arg (arg 2) wc.c:118: warning: long long unsigned int format, u_quad_t arg (arg 2) wc.c:120: warning: long long unsigned int format, u_quad_t arg (arg 2) wc.c: In function `cnt': wc.c:166: warning: long long unsigned int format, u_quad_t arg (arg 2) wc.c:169: warning: long long unsigned int format, u_quad_t arg (arg 2) wc.c:220: warning: long long unsigned int format, u_quad_t arg (arg 2) wc.c:224: warning: long long unsigned int format, u_quad_t arg (arg 2) wc.c:228: warning: long long unsigned int format, u_quad_t arg (arg 2) *** Error code 1 `all' not remade because of errors. ===> whois Warning: Object directory not changed from original /j/kris/src/usr.bin/whois cc -O -pipe -mcpu=ev5 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wnon-const-format -Wno-format-extra-args -Werror -c whois.c cc1: warnings being treated as errors whois.c: In function `s_asprintf': whois.c:242: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. ===> window Warning: Object directory not changed from original /j/kris/src/usr.bin/window cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c lcmd2.c cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c main.c cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c startup.c cc -O -pipe -mcpu=ev5 -Wnon-const-format -Wno-format-extra-args -Werror -c wwprintf.c cc1: warnings being treated as errors wwprintf.c: In function `wwprintf': wwprintf.c:57: warning: non-constant format parameter *** Error code 1 cc1: warnings being treated as errors startup.c: In function `doconfig': cc1: warnings being treated as errors main.c: In function `main': main.c:89: warning: cast to pointer from integer of different size main.c:92: warning: cast to pointer from integer of different size startup.c:59: warning: field width is not type int (arg 3) *** Error code 1 cc1: warnings being treated as errors lcmd2.c: In function `strtime': lcmd2.c:179: warning: int format, different type arg (arg 4) *** Error code 1 *** Error code 1 `all' not remade because of errors. ===> dig Warning: Object directory not changed from original /j/kris/src/usr.bin/dig cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/dig/../../contrib/bind/port/freebsd/include -I/j/kris/src/usr.bin/dig/../../contrib/bind/bin/named -DNOADDITIONAL -I/j/kris/src/usr.bin/dig/../../contrib/bind/include -I. -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/dig/../../contrib/bind/bin/nslookup/debug.c cc1: warnings being treated as errors /j/kris/src/usr.bin/dig/../../contrib/bind/bin/nslookup/debug.c: In function `Print_rr': /j/kris/src/usr.bin/dig/../../contrib/bind/bin/nslookup/debug.c:653: warning: int format, different type arg (arg 3) *** Error code 1 `all' not remade because of errors. ===> dnskeygen Warning: Object directory not changed from original /j/kris/src/usr.bin/dnskeygen cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/dnskeygen/../../contrib/bind/port/freebsd/include -I/j/kris/src/usr.bin/dnskeygen/../../contrib/bind/bin/named -DNOADDITIONAL -I/j/kris/src/usr.bin/dnskeygen/../../contrib/bind/include -I. -Wnon-const-format -Wno-format-extra-args -Werror -o dnskeygen dnskeygen.o /j/kris/src/usr.bin/dnskeygen/../../lib/libbind/libbind.a ===> dnsquery Warning: Object directory not changed from original /j/kris/src/usr.bin/dnsquery cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/dnsquery/../../contrib/bind/port/freebsd/include -I/j/kris/src/usr.bin/dnsquery/../../contrib/bind/bin/named -DNOADDITIONAL -I/j/kris/src/usr.bin/dnsquery/../../contrib/bind/include -I. -Wnon-const-format -Wno-format-extra-args -Werror -o dnsquery dnsquery.o /j/kris/src/usr.bin/dnsquery/../../lib/libbind/libbind.a ===> host Warning: Object directory not changed from original /j/kris/src/usr.bin/host cc -O -pipe -mcpu=ev5 -I/j/kris/src/usr.bin/host/../../contrib/bind/port/freebsd/include -I/j/kris/src/usr.bin/host/../../contrib/bind/bin/named -DNOADDITIONAL -I/j/kris/src/usr.bin/host/../../contrib/bind/include -I. -Wnon-const-format -Wno-format-extra-args -Werror -c /j/kris/src/usr.bin/host/../../contrib/bind/bin/host/host.c cc1: warnings being treated as errors /j/kris/src/usr.bin/host/../../contrib/bind/bin/host/host.c: In function `main': /j/kris/src/usr.bin/host/../../contrib/bind/bin/host/host.c:335: warning: cast to pointer from integer of different size /j/kris/src/usr.bin/host/../../contrib/bind/bin/host/host.c: In function `print_hex_field': /j/kris/src/usr.bin/host/../../contrib/bind/bin/host/host.c:758: warning: non-constant format parameter /j/kris/src/usr.bin/host/../../contrib/bind/bin/host/host.c:763: warning: non-constant format parameter *** Error code 1 `all' not remade because of errors. --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7dIiVWry0BWjoQKURAoG8AKDpEwiDmxsktUImPMETJc1VatVp6wCggmtS xDFC12xiGFxOLMY0sxOXyDU= =TY4R -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 19:42:47 2001 Delivered-To: freebsd-audit@freebsd.org Received: from meow.lab.nuxi.com (meow.lab.nuxi.com [66.123.5.2]) by hub.freebsd.org (Postfix) with ESMTP id 53DD437B406 for ; Fri, 10 Aug 2001 19:42:45 -0700 (PDT) (envelope-from sethk@meow.lab.nuxi.com) Received: (from sethk@localhost) by meow.lab.nuxi.com (8.11.4/8.11.2) id f7B2fp772351; Fri, 10 Aug 2001 19:41:51 -0700 (PDT) (envelope-from sethk) Date: Fri, 10 Aug 2001 19:41:50 -0700 From: Seth Kingsley To: Kris Kennaway Cc: audit@FreeBSD.ORG Subject: Re: WFORMAT=1 errors Message-ID: <20010810194150.A71696@meow.lab.nuxi.com> References: <20010810182125.A47936@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="FL5UXtIhxfXey3p5" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010810182125.A47936@xor.obsecurity.org>; from kris@obsecurity.org on Fri, Aug 10, 2001 at 06:21:26PM -0700 Organization: Wind River Systems X-Operating-System: FreeBSD 4.3-STABLE i386 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 --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 10, 2001 at 06:21:26PM -0700, Kris Kennaway wrote: > In the meantime, does anyone feel like fixing some of > the following from usr.bin/ I'll take usr.bin/make, I've been working on some other modernizations of it recently. --=20 || Seth Kingsley || Platforms Lab Opps || seth.kingsley@windriver.com || --FL5UXtIhxfXey3p5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7dJtuD1AymFxBOwgRAsycAJ9p7ScQVi64Vcv4jpyyOdSMl1nLkwCfbiw6 uP9HzKB/osZ9N2XX0wM65qE= =OtYu -----END PGP SIGNATURE----- --FL5UXtIhxfXey3p5-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 20:20:15 2001 Delivered-To: freebsd-audit@freebsd.org Received: from obsecurity.dyndns.org (adsl-63-207-60-82.dsl.lsan03.pacbell.net [63.207.60.82]) by hub.freebsd.org (Postfix) with ESMTP id 25D6437B405 for ; Fri, 10 Aug 2001 20:20:05 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 0E94C66C4D; Fri, 10 Aug 2001 20:20:02 -0700 (PDT) Date: Fri, 10 Aug 2001 20:20:02 -0700 From: Kris Kennaway To: Seth Kingsley Cc: Kris Kennaway , audit@FreeBSD.ORG Subject: Re: WFORMAT=1 errors Message-ID: <20010810202002.A49763@xor.obsecurity.org> References: <20010810182125.A47936@xor.obsecurity.org> <20010810194150.A71696@meow.lab.nuxi.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010810194150.A71696@meow.lab.nuxi.com>; from seth.kingsley@windriver.com on Fri, Aug 10, 2001 at 07:41:50PM -0700 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 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 10, 2001 at 07:41:50PM -0700, Seth Kingsley wrote: > On Fri, Aug 10, 2001 at 06:21:26PM -0700, Kris Kennaway wrote: > > In the meantime, does anyone feel like fixing some of > > the following from usr.bin/ >=20 > I'll take usr.bin/make, I've been working on some other modernizations > of it recently. Excellent, thanks! Kris --opJtzjQTFsWo+cga Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7dKRhWry0BWjoQKURAnqTAJ41mOfB4EakyOHuw7RAVXnViTGcugCgqN2y 7/JSsoZ0gPpNyMQSZC9bcN4= =lW82 -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 10 21:50: 9 2001 Delivered-To: freebsd-audit@freebsd.org Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by hub.freebsd.org (Postfix) with ESMTP id 7472137B405 for ; Fri, 10 Aug 2001 21:50:06 -0700 (PDT) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.9.3/8.9.1) id WAA75695; Fri, 10 Aug 2001 22:50:03 -0600 (MDT) (envelope-from ken) Date: Fri, 10 Aug 2001 22:50:03 -0600 From: "Kenneth D. Merry" To: "Sergey A. Osokin" Cc: audit@FreeBSD.ORG Subject: Re: [PATCH] libdevstat have two compute statistics functions Message-ID: <20010810225003.B75606@panzer.kdm.org> References: <20010808184710.A87195@freebsd.org.ru> <20010809102140.A62588@panzer.kdm.org> <20010810161632.A7827@freebsd.org.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20010810161632.A7827@freebsd.org.ru>; from osa@freebsd.org.ru on Fri, Aug 10, 2001 at 04:16:32PM +0400 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 Fri, Aug 10, 2001 at 16:16:32 +0400, Sergey A. Osokin wrote: > On Thu, Aug 09, 2001 at 10:21:40AM -0600, Kenneth D. Merry wrote: > > On Wed, Aug 08, 2001 at 18:47:11 +0400, Sergey A. Osokin wrote: > > > Hello. > > > After last commit into libdevstat, devstat.c containes > > > 2 compute statistics functions: old compute_stats() and > > > new devstat_compute_statistics(). > > > > > > I believe that compute_stats() is not necessary any more > > > and we should remove it. devstat_compute_statistics() is > > > a superset for compute_stats(). > > > > This patch won't work. The reason is that the arguments to compute_stats() > > can be NULL, which will cause it not to calculate that particular > > statistic. > > OK. I mistake about goto's in switch(devstat_arg_list[metric].argtype). > Look at attached patch. I make a little hack for > devstat_compute_statistics(). After this patch function try to > resolve all pairs of parameters. You cut out the part of my message where I discussed, indirectly, this approach: > > Your patch passes in all of the arguments to devstat_compute_statistics(). > > If one of the initial arguments is NULL, it will bail out and not compute > > the rest of the statistics. IMO this is the correct behavior -- the user > > has specified a statistic to calculate, and if he has not also given a > > valid variable to put the result in, that is an error. The problem with this patch is that you can now supply bogus arguments. I don't think that's the right approach. My preference is to leave things as-is. Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Aug 11 10: 3:10 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.chem.msu.ru (mail.chem.msu.ru [195.208.208.19]) by hub.freebsd.org (Postfix) with ESMTP id D165237B406 for ; Sat, 11 Aug 2001 10:02:52 -0700 (PDT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su ([158.250.32.97]) by mail.chem.msu.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id NHPRWWT0; Sat, 11 Aug 2001 20:54:24 +0400 Received: (from yar@localhost) by comp.chem.msu.su (8.11.1/8.11.1) id f7BH2kA02623 for audit@FreeBSD.ORG; Sat, 11 Aug 2001 21:02:46 +0400 (MSD) (envelope-from yar) Date: Sat, 11 Aug 2001 21:02:45 +0400 From: Yar Tikhiy To: audit@FreeBSD.ORG Subject: finger(1) & fingerd(8): take 2 Message-ID: <20010811210245.H80842@comp.chem.msu.su> References: <20010728155159.A35483@snark.rinet.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010728155159.A35483@snark.rinet.ru>; from yar@FreeBSD.ORG on Sat, Jul 28, 2001 at 03:51:59PM +0400 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 Hi everybody, Here's the second version of the patches for finger(1) and fingerd(8), which implement the option of hiding users whose home directories are protected from "other". Please review them. Thank you. -- Yar Index: finger/finger.1 =================================================================== RCS file: /home/ncvs/src/usr.bin/finger/finger.1,v retrieving revision 1.22 diff -u -r1.22 finger.1 --- finger/finger.1 2001/07/10 14:15:57 1.22 +++ finger/finger.1 2001/08/11 16:51:00 @@ -40,7 +40,7 @@ .Nd user information lookup program .Sh SYNOPSIS .Nm -.Op Fl lmpshoT +.Op Fl lmpshoHT .Op Ar user ...\& .Op Ar user@host ...\& .Sh DESCRIPTION @@ -149,6 +149,12 @@ .Nm is case insensitive. .Pp +.It Fl H +If the user's home directory exists, but is unaccessible, +behave as though there is the +.Dq Pa .nofinger +file in it, i.e. pretend the user is nonexistent. +.Pp .It Fl T Disable the piggybacking of data on the initial connection request. This option is needed to finger hosts with a broken TCP implementation. @@ -191,6 +197,9 @@ exists in the user's home directory, .Nm behaves as if the user in question does not exist. +See also the +.Fl H +option. .Pp The optional .Xr finger.conf 5 Index: finger/finger.c =================================================================== RCS file: /home/ncvs/src/usr.bin/finger/finger.c,v retrieving revision 1.24 diff -u -r1.24 finger.c --- finger/finger.c 2001/03/21 18:43:49 1.24 +++ finger/finger.c 2001/08/11 16:51:00 @@ -88,7 +88,7 @@ DB *db; time_t now; -int entries, lflag, mflag, pplan, sflag, oflag, Tflag; +int entries, lflag, mflag, pplan, sflag, oflag, Hflag, Tflag; int d_first = -1; char tbuf[1024]; @@ -105,7 +105,7 @@ optind = 1; /* reset getopt */ - while ((ch = getopt(argc, argv, "lmpshoT")) != -1) + while ((ch = getopt(argc, argv, "lmpshoHT")) != -1) switch(ch) { case 'l': lflag = 1; /* long format */ @@ -125,6 +125,9 @@ case 'o': oflag = 1; /* office info */ break; + case 'H': + Hflag = 1; /* hide if protected homedir */ + break; case 'T': Tflag = 1; /* disable T/TCP */ break; @@ -139,7 +142,7 @@ static void usage() { - (void)fprintf(stderr, "usage: finger [-lmpshoT] [login ...]\n"); + (void)fprintf(stderr, "usage: finger [-lmpshoHT] [login ...]\n"); exit(1); } Index: finger/util.c =================================================================== RCS file: /home/ncvs/src/usr.bin/finger/util.c,v retrieving revision 1.15 diff -u -r1.15 util.c --- finger/util.c 2001/08/08 21:22:48 1.15 +++ finger/util.c 2001/08/11 16:51:00 @@ -412,6 +412,7 @@ hide(pw) struct passwd *pw; { + extern int Hflag; struct stat st; char buf[MAXPATHLEN]; @@ -421,6 +422,8 @@ snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, _PATH_NOFINGER); if (stat(buf, &st) == 0) + return 1; + if (Hflag && errno != ENOENT) return 1; return 0; Index: fingerd/fingerd.8 =================================================================== RCS file: /home/ncvs/src/libexec/fingerd/fingerd.8,v retrieving revision 1.8 diff -u -r1.8 fingerd.8 --- fingerd/fingerd.8 2001/08/10 13:45:21 1.8 +++ fingerd/fingerd.8 2001/08/11 16:51:00 @@ -42,6 +42,7 @@ .Nm .Op Fl s .Op Fl l +.Op Fl H .Op Fl p Ar filename .Sh DESCRIPTION .Nm Fingerd @@ -117,6 +118,10 @@ this option allows a system manager to have more control over what information is provided to remote sites. +.It Fl H +Hide users whose home directories exist, but are unaccessible. +The option is just passed to +.Xr finger 1 . .El .Sh SEE ALSO .Xr finger 1 , Index: fingerd/fingerd.c =================================================================== RCS file: /home/ncvs/src/libexec/fingerd/fingerd.c,v retrieving revision 1.17 diff -u -r1.17 fingerd.c --- fingerd/fingerd.c 2001/01/20 00:29:31 1.17 +++ fingerd/fingerd.c 2001/08/11 16:51:00 @@ -73,16 +73,16 @@ register int ch; register char *lp; struct sockaddr_storage ss; - int p[2], logging, secure, sval; + int p[2], hideprotected, logging, secure, sval; #define ENTRIES 50 - char **ap, *av[ENTRIES + 1], **comp, line[1024], *prog; + char **ap, *av[ENTRIES + 1], **avlast, **comp, line[1024], *prog; char rhost[MAXHOSTNAMELEN]; prog = _PATH_FINGER; - logging = secure = 0; + hideprotected = logging = secure = 0; openlog("fingerd", LOG_PID | LOG_CONS, LOG_DAEMON); opterr = 0; - while ((ch = getopt(argc, argv, "slp:")) != -1) + while ((ch = getopt(argc, argv, "slp:H")) != -1) switch (ch) { case 'l': logging = 1; @@ -93,6 +93,9 @@ case 's': secure = 1; break; + case 'H': + hideprotected = 1; + break; case '?': default: logerr("illegal option -- %c", optopt); @@ -140,12 +143,15 @@ syslog(LOG_NOTICE, "query from %s: `%s'", rhost, t); } - comp = &av[1]; - av[2] = "--"; - for (lp = line, ap = &av[3];;) { + avlast = &av[1]; + comp = avlast++; + if (hideprotected) + *avlast++ = "-H"; + *avlast++ = "--"; + for (lp = line, ap = avlast;;) { *ap = strtok(lp, " \t\r\n"); if (!*ap) { - if (secure && ap == &av[3]) { + if (secure && ap == avlast) { puts("must provide username\r\n"); exit(1); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Aug 11 13:36:34 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (discworld.nanolink.com [217.75.135.248]) by hub.freebsd.org (Postfix) with SMTP id 5840537B408 for ; Sat, 11 Aug 2001 13:36:18 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 691 invoked by uid 1000); 11 Aug 2001 20:34:52 -0000 Date: Sat, 11 Aug 2001 23:34:52 +0300 From: Peter Pentchev To: arch@FreeBSD.org Cc: audit@FreeBSD.org Subject: sysctl_register_oid() breakage at unload [PATCH] Message-ID: <20010811233452.A510@ringworld.oblivion.bg> Mail-Followup-To: arch@FreeBSD.org, 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 List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, Well, it seems that I broke things with the panic at attempts to register oid's higher than the first dynamic oid. Specifically, this broke the case of unregistering sysctl's, esp. at module unload. The algorithm described in the sysctl_ctx_free(9) manpage is indeed so very weird (I won't go so far as calling it 'stupid', because I cannot really suggest any way to improve it right now). So, if a sysctl context is freed, most of the time the first pass of freeing will fail, and sysctl_ctx_free() will attempt to reregister the sysctls with the same oid's; this, of course, causes a panic, because sysctl_register_oid() does not like so high a "static" oid :( I just noticed that on my -stable laptop, when I tried to MFC the patch - my sound driver is only available as a module, and the kernel panicked at shutdown after attempting to unload it. For various reasons I cannot run -current on this laptop (not least because this is the machine I'm using for developing an application that is supposed to run under -stable), and my -current box did not really have any need for loadable modules, so that's how this slipped in unnoticed :( So here's a proposed fix: add a "this is actually a re-registering, stay cool" flag to sysctl_register_oid(), and update all the calls to it that I could find under src/sys. This flag needs only be set in sysctl_ctx_free(), all the other callers put a 0. The funniest part is that the original problem that I tried to fix does not really exist under -stable - or at least, it is not all that bad. All dynamic sysctl oid's there are obtained by a search through the parent's subtree for an oid higher than 99, and registering the new one at one bigger. The 99 is still there, so the problem described in PR 29131 still *might* happen, it is just very, very much harder to reproduce. So I do not think that there should be any concern with MFC'ing this before 4.4-RELEASE. G'luck, Peter -- Nostalgia ain't what it used to be. Index: src/sys/kern/kern_linker.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_linker.c,v retrieving revision 1.64 diff -u -r1.64 kern_linker.c --- src/sys/kern/kern_linker.c 2001/07/31 03:51:07 1.64 +++ src/sys/kern/kern_linker.c 2001/08/11 19:29:59 @@ -209,7 +209,7 @@ return; for (oidp = start; oidp < stop; oidp++) - sysctl_register_oid(*oidp); + sysctl_register_oid(*oidp, 0); } static void Index: src/sys/kern/kern_sysctl.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_sysctl.c,v retrieving revision 1.112 diff -u -r1.112 kern_sysctl.c --- src/sys/kern/kern_sysctl.c 2001/07/25 17:21:15 1.112 +++ src/sys/kern/kern_sysctl.c 2001/08/11 19:29:59 @@ -88,7 +88,7 @@ */ void -sysctl_register_oid(struct sysctl_oid *oidp) +sysctl_register_oid(struct sysctl_oid *oidp, int rereg) { struct sysctl_oid_list *parent = oidp->oid_parent; struct sysctl_oid *p; @@ -121,7 +121,7 @@ oidp->oid_number = newoid++; if (newoid == 0x7fffffff) panic("out of oids"); - } else if (oidp->oid_number >= CTL_AUTO_START) { + } else if ((oidp->oid_number >= CTL_AUTO_START) && !rereg) { panic("static sysctl oid too high: %d", oidp->oid_number); } @@ -187,7 +187,7 @@ else e1 = TAILQ_LAST(clist, sysctl_ctx_list); while (e1 != NULL) { - sysctl_register_oid(e1->entry); + sysctl_register_oid(e1->entry, 1); e1 = TAILQ_PREV(e1, sysctl_ctx_list, link); } if (error) @@ -368,7 +368,7 @@ if (clist != NULL) sysctl_ctx_entry_add(clist, oidp); /* Register this oid */ - sysctl_register_oid(oidp); + sysctl_register_oid(oidp, 0); return (oidp); } @@ -383,7 +383,7 @@ struct sysctl_oid **oidp; SET_FOREACH(oidp, sysctl_set) - sysctl_register_oid(*oidp); + sysctl_register_oid(*oidp, 0); } SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_ANY, sysctl_register_all, 0); Index: src/sys/kern/vfs_init.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_init.c,v retrieving revision 1.55 diff -u -r1.55 vfs_init.c --- src/sys/kern/vfs_init.c 2001/04/29 02:44:49 1.55 +++ src/sys/kern/vfs_init.c 2001/08/11 19:29:59 @@ -335,7 +335,7 @@ if (strcmp(oidp->oid_name, vfc->vfc_name) == 0) { sysctl_unregister_oid(oidp); oidp->oid_number = vfc->vfc_typenum; - sysctl_register_oid(oidp); + sysctl_register_oid(oidp, 0); } /* Index: src/sys/sys/sysctl.h =================================================================== RCS file: /home/ncvs/src/sys/sys/sysctl.h,v retrieving revision 1.98 diff -u -r1.98 sysctl.h --- src/sys/sys/sysctl.h 2001/07/25 17:21:18 1.98 +++ src/sys/sys/sysctl.h 2001/08/11 19:29:59 @@ -153,7 +153,7 @@ /* * These functions are used to add/remove an oid from the mib. */ -void sysctl_register_oid(struct sysctl_oid *oidp); +void sysctl_register_oid(struct sysctl_oid *oidp, int); void sysctl_unregister_oid(struct sysctl_oid *oidp); /* Declare a static oid to allow child oids to be added to it. */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Aug 11 23:57:41 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.musha.org (daemon.musha.org [61.122.44.178]) by hub.freebsd.org (Postfix) with ESMTP id 2368537B40B for ; Sat, 11 Aug 2001 23:57:30 -0700 (PDT) (envelope-from knu@iDaemons.org) Received: from archon.local.idaemons.org (archon.local.idaemons.org [192.168.1.32]) by mail.musha.org (Postfix) with ESMTP id 59DD14D801 for ; Sun, 12 Aug 2001 15:57:27 +0900 (JST) Date: Sun, 12 Aug 2001 15:57:27 +0900 Message-ID: <86d761hijs.wl@archon.local.idaemons.org> From: "Akinori MUSHA" To: audit@FreeBSD.org Subject: adding -P option to pkg_delete(1) References: <86elqphctp.wl@archon.local.idaemons.org> User-Agent: Wanderlust/2.7.1 (Too Funky) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII 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 I'm resending this to audit@, since ports@ does not seem to respond.. ;) Please review the attached patch, which adds a new option "-P" to pkg_delete(1) which preserves shared library files. This is useful when one suspects that s/he still have some binaries that depend on the shared library that's being deleted. Probably pkg_version(1) may want to use the option for the -c feature. If possible, I'd like to see this in the 4.4-RELEASE because that would allow users to upgrade packages safely, which can only be done by portupgrade(1) currently. I've already implemented the equivalent in my pkg_deinstall(1) utility bundled in sysutils/portupgrade, but it would be nice if pkg_delete(1) had this feature in the first place. Regards, Index: add/perform.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/add/perform.c,v retrieving revision 1.63 diff -u -r1.63 perform.c --- add/perform.c 2001/08/02 13:13:05 1.63 +++ add/perform.c 2001/08/06 05:50:24 @@ -481,7 +481,7 @@ fail: /* Nuke the whole (installed) show, XXX but don't clean directories */ if (!Fake) - delete_package(FALSE, FALSE, &Plist); + delete_package(FALSE, FALSE, FALSE, &Plist); success: /* delete the packing list contents */ Index: delete/delete.h =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/delete/delete.h,v retrieving revision 1.6 diff -u -r1.6 delete.h --- delete/delete.h 2001/02/27 09:00:18 1.6 +++ delete/delete.h 2001/08/05 17:39:55 @@ -28,6 +28,7 @@ extern Boolean Interactive; extern Boolean NoDeInstall; extern Boolean Force; +extern Boolean PreserveShlib; extern char *Directory; extern char *PkgName; extern match_t MatchType; Index: delete/main.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/delete/main.c,v retrieving revision 1.22 diff -u -r1.22 main.c --- delete/main.c 2001/08/02 13:13:05 1.22 +++ delete/main.c 2001/08/06 06:22:43 @@ -30,12 +30,13 @@ #include "lib.h" #include "delete.h" -static char Options[] = "adDfGhinp:vx"; +static char Options[] = "adDfGhinp:Pvx"; char *Prefix = NULL; Boolean CleanDirs = FALSE; Boolean Interactive = FALSE; Boolean NoDeInstall = FALSE; +Boolean PreserveShlib = FALSE; match_t MatchType = MATCH_GLOB; static void usage __P((void)); @@ -93,6 +94,10 @@ Interactive = TRUE; break; + case 'P': + PreserveShlib = TRUE; + break; + case 'h': case '?': default: @@ -148,7 +153,7 @@ usage() { fprintf(stderr, "%s\n%s\n", - "usage: pkg_delete [-dDfGinvx] [-p prefix] pkg-name ...", + "usage: pkg_delete [-dDfGinPvx] [-p prefix] pkg-name ...", " pkg_delete -a [flags]"); exit(1); } Index: delete/perform.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/delete/perform.c,v retrieving revision 1.32 diff -u -r1.32 perform.c --- delete/perform.c 2001/08/02 13:13:05 1.32 +++ delete/perform.c 2001/08/05 17:40:22 @@ -217,7 +217,7 @@ * Some packages aren't packed right, so we need to just ignore * delete_package()'s status. Ugh! :-( */ - if (delete_package(FALSE, CleanDirs, &Plist) == FAIL) + if (delete_package(FALSE, CleanDirs, PreserveShlib, &Plist) == FAIL) warnx( "couldn't entirely delete package (perhaps the packing list is\n" "incorrectly specified?)"); Index: delete/pkg_delete.1 =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/delete/pkg_delete.1,v retrieving revision 1.26 diff -u -r1.26 pkg_delete.1 --- delete/pkg_delete.1 2001/07/15 08:02:37 1.26 +++ delete/pkg_delete.1 2001/08/06 06:20:53 @@ -25,7 +25,7 @@ .Nd a utility for deleting previously installed software package distributions .Sh SYNOPSIS .Nm -.Op Fl dDfGinvx +.Op Fl dDfGinPvx .Op Fl p Ar prefix .Ar pkg-name ... .Nm @@ -91,6 +91,14 @@ which do not explicitly set theirs. For most packages, the prefix will be set automatically to the installed location by .Xr pkg_add 1 . +.It Fl P +Preserve (possible) shared library files that end with the +.Dq .so , +.Dq .so.X , +or +.Dq .so.X.Y +suffix. This is useful when you suspect that you still have some +binaries that depend on the shared library being deleted. .It Fl d Remove empty directories created by file cleanup. By default, only files/directories explicitly listed in a package's contents (either as Index: lib/lib.h =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/lib/lib.h,v retrieving revision 1.36 diff -u -r1.36 lib.h --- lib/lib.h 2001/08/02 13:13:06 1.36 +++ lib/lib.h 2001/08/05 17:41:50 @@ -174,7 +174,7 @@ void write_plist(Package *, FILE *); void read_plist(Package *, FILE *); int plist_cmd(char *, char **); -int delete_package(Boolean, Boolean, Package *); +int delete_package(Boolean, Boolean, Boolean, Package *); Boolean make_preserve_name(char *, int, char *, char *); /* For all */ Index: lib/plist.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/lib/plist.c,v retrieving revision 1.34 diff -u -r1.34 plist.c --- lib/plist.c 2001/08/02 12:38:29 1.34 +++ lib/plist.c 2001/08/05 17:53:29 @@ -346,13 +346,48 @@ } /* + * Check if the given filename looks like a shared library. + */ +static Boolean +is_shlib(char *filename) +{ + char *p, *q; + + /* basename */ + if (NULL != (p = strrchr(filename, '/'))) + p++; + else + p = filename; + + /* empty filename or dotfile? */ + if (*p == '\0' || *p == '.') + return FALSE; + + /* do "strrstr" for .so */ + if (NULL == (q = strstr(p + 1, ".so"))) + return FALSE; + while (NULL != (p = strstr(q += 3, ".so"))) + q = p; + + /* skip version numbers */ + while (*q) { + if (*q != '.' || !isdigit(*++q)) + return FALSE; + while (isdigit(*++q)) + ; + } + + return TRUE; +} + +/* * Delete the results of a package installation. * * This is here rather than in the pkg_delete code because pkg_add needs to * run it too in cases of failure. */ int -delete_package(Boolean ign_err, Boolean nukedirs, Package *pkg) +delete_package(Boolean ign_err, Boolean nukedirs, Boolean preserve_shlib, Package *pkg) { PackingList p; char *Where = ".", *last_file = ""; @@ -389,7 +424,12 @@ case PLIST_FILE: last_file = p->name; - sprintf(tmp, "%s/%s", Where, p->name); + sprintf(tmp, "%s/%s", Where, last_file); + if (preserve_shlib && is_shlib(last_file)) { + if (Verbose) + printf("Preserve shared library file %s\n", tmp); + continue; + } if (isdir(tmp) && fexists(tmp) && !issymlink(tmp)) { warnx("cannot delete specified file '%s' - it is a directory!\n" "this packing list is incorrect - ignoring delete request", tmp); -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Freeze this moment a little bit longer, make each impression a little bit stronger.. Experience slips away -- Time stand still" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message