From owner-freebsd-audit Sun Jun 24 5:52:50 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 6107F37B405 for ; Sun, 24 Jun 2001 05:52:47 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id OAA82077; Sun, 24 Jun 2001 14:52:43 +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: Mike Barcroft Cc: audit@FreeBSD.org Subject: Re: src/usr.bin warns patch (also Re: src/usr.sbin warns patch) References: <200106240506.f5O56S790146@coffee.q9media.com> From: Dag-Erling Smorgrav Date: 24 Jun 2001 14:52:43 +0200 In-Reply-To: <200106240506.f5O56S790146@coffee.q9media.com> Message-ID: Lines: 9 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 Mike Barcroft writes: > Thanks for spotting that. The patch at the end of this e-mail [...] > addresses this problem. You missed usr.bin/colcrt and usr.bin/uuencode... 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 Sun Jun 24 15:12:55 2001 Delivered-To: freebsd-audit@freebsd.org Received: from iatl0x01.coxmail.com (iatl1x01.coxmail.com [206.157.231.23]) by hub.freebsd.org (Postfix) with ESMTP id 843C237B405 for ; Sun, 24 Jun 2001 15:12:52 -0700 (PDT) (envelope-from mheffner@novacoxmail.com) Received: from enterprise.muriel.penguinpowered.com ([208.138.198.178]) by iatl0x01.coxmail.com (InterMail vK.4.03.02.00 201-232-124 license 85f4f10023be2bd3bce00b3a38363ea2) with ESMTP id <20010624221251.BZKY1034.iatl0x01@enterprise.muriel.penguinpowered.com>; Sun, 24 Jun 2001 18:12:51 -0400 Message-ID: X-Mailer: XFMail 1.4.7 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200106232304.f5NN4Zh89727@coffee.q9media.com> MYHEADER: test Date: Sun, 24 Jun 2001 22:11:24 -0400 (EDT) Reply-To: Mike Heffner From: Mike Heffner To: Mike Barcroft Subject: RE: src/usr.sbin/zic patch Cc: audit@FreeBSD.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 On 23-Jun-2001 Mike Barcroft wrote: | I would appreciate it if someone would commit the patch at the end of | this message. Also available at: | http://testbed.q9media.net/freebsd/zic.20010623.patch ... | | Index: zic/private.h | =================================================================== | RCS file: /home/ncvs/src/usr.sbin/zic/private.h,v | retrieving revision 1.4 | diff -u -r1.4 private.h | --- zic/private.h 2000/11/28 18:18:56 1.4 | +++ zic/private.h 2001/06/23 22:19:53 | @@ -99,7 +99,7 @@ | void * irealloc P((void * pointer, int size)); | void icfree P((char * pointer)); | void ifree P((char * pointer)); | -char * scheck P((const char *string, const char *format)); | +const char * scheck P((const char *string, const char *format)); I believe `__const' should be used to not break K&R. Same goes for the definition. Mike -- Mike Heffner Fredericksburg, VA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 24 15:32:23 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 7500237B406 for ; Sun, 24 Jun 2001 15:32:20 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 7FB2C3E28; Sun, 24 Jun 2001 15:32:19 -0700 (PDT) To: Mike Heffner Cc: Mike Barcroft , audit@FreeBSD.org Subject: Re: src/usr.sbin/zic patch In-Reply-To: ; from mheffner@novacoxmail.com on "Sun, 24 Jun 2001 22:11:24 -0400 (EDT)" Date: Sun, 24 Jun 2001 15:32:19 -0700 From: Dima Dorfman Message-Id: <20010624223219.7FB2C3E28@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 Mike Heffner writes: > > On 23-Jun-2001 Mike Barcroft wrote: > | I would appreciate it if someone would commit the patch at the end of > | this message. Also available at: > | http://testbed.q9media.net/freebsd/zic.20010623.patch > ... > | > | Index: zic/private.h > | =================================================================== > | RCS file: /home/ncvs/src/usr.sbin/zic/private.h,v > | retrieving revision 1.4 > | diff -u -r1.4 private.h > | --- zic/private.h 2000/11/28 18:18:56 1.4 > | +++ zic/private.h 2001/06/23 22:19:53 > | @@ -99,7 +99,7 @@ > | void * irealloc P((void * pointer, int size)); > | void icfree P((char * pointer)); > | void ifree P((char * pointer)); > | -char * scheck P((const char *string, const char *format)); > | +const char * scheck P((const char *string, const char *format)); > > I believe `__const' should be used to not break K&R. Same goes for the > definition. Just `const' is fine since it can be defined away (e.g., cc -Dconst=). See message-id for comments from bde@ on this subject. > > > Mike > > -- > Mike Heffner > Fredericksburg, VA > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-audit" 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 Sun Jun 24 19:46:23 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 CADDC37B406 for ; Sun, 24 Jun 2001 19:46:04 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5P2wsU91530; Sun, 24 Jun 2001 22:58:54 -0400 (EDT) (envelope-from mike) Date: Sun, 24 Jun 2001 22:58:54 -0400 (EDT) Message-Id: <200106250258.f5P2wsU91530@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Cc: Dag-Erling Smorgrav Subject: Re: src/usr.bin warns patch (also Re: src/usr.sbin warns patch) 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 The patch at the end of this message and also available at: http://testbed.q9media.net/freebsd/mega.20010625.patch ...combines the src/usr.bin and src/usr.sbin patches. It also adds WARNS?=2 to src/usr.sbin/jail (which just recently became warning free - thanks Dima). The issue DES brought up has also been resolved, as my includes patch has been committed (thanks again Dima). I believe DES is going to commit this for me; I just wanted to update the list. Best regards, Mike Barcroft ----------------------------------------------------------------------- mega.20010625.patch o Set WARNS?=2 on Makefiles that should have it in src/usr.bin and src/usr.sbin. Index: usr.bin/basename/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/basename/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- usr.bin/basename/Makefile 1998/12/06 22:58:12 1.2 +++ usr.bin/basename/Makefile 2001/06/24 15:45:45 @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= basename -CFLAGS+=-Wall +WARNS?= 2 MLINKS= basename.1 dirname.1 .include Index: usr.bin/biff/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/biff/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- usr.bin/biff/Makefile 1998/12/06 22:58:12 1.2 +++ usr.bin/biff/Makefile 2001/06/24 15:45:46 @@ -1,6 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= biff -CFLAGS+=-Wall +WARNS?= 2 .include Index: usr.bin/cap_mkdb/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/cap_mkdb/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- usr.bin/cap_mkdb/Makefile 1998/12/06 22:58:12 1.2 +++ usr.bin/cap_mkdb/Makefile 2001/06/24 15:45:46 @@ -1,6 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= cap_mkdb -CFLAGS+=-Wall +WARNS?= 2 .include Index: usr.bin/colrm/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/colrm/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- usr.bin/colrm/Makefile 1998/12/06 22:58:18 1.2 +++ usr.bin/colrm/Makefile 2001/06/24 15:45:50 @@ -1,6 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= colrm -CFLAGS+=-Wall +WARNS?= 2 .include Index: usr.bin/dirname/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/dirname/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- usr.bin/dirname/Makefile 1998/12/06 22:58:20 1.2 +++ usr.bin/dirname/Makefile 2001/06/24 15:45:50 @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= dirname -CFLAGS+=-Wall +WARNS?= 2 NOMAN= noman .include Index: usr.bin/env/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/env/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- usr.bin/env/Makefile 1998/12/06 22:58:22 1.2 +++ usr.bin/env/Makefile 2001/06/24 15:45:50 @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= env -CFLAGS+=-Wall +WARNS?= 2 NOMAN= noman .include Index: usr.bin/file2c/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/file2c/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- usr.bin/file2c/Makefile 2001/03/27 10:51:43 1.5 +++ usr.bin/file2c/Makefile 2001/06/24 15:45:52 @@ -1,5 +1,6 @@ # $FreeBSD: src/usr.bin/file2c/Makefile,v 1.5 2001/03/27 10:51:43 ru Exp $ PROG= file2c +WARNS?= 2 .include Index: usr.bin/fold/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/fold/Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile --- usr.bin/fold/Makefile 1994/05/27 12:31:17 1.1.1.1 +++ usr.bin/fold/Makefile 2001/06/24 15:45:52 @@ -1,5 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= fold +WARNS?= 2 .include Index: usr.bin/from/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/from/Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile --- usr.bin/from/Makefile 1994/05/27 12:31:22 1.1.1.1 +++ usr.bin/from/Makefile 2001/06/24 15:45:52 @@ -1,5 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= from +WARNS?= 2 .include Index: usr.bin/fsync/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/fsync/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- usr.bin/fsync/Makefile 2000/07/19 08:44:26 1.2 +++ usr.bin/fsync/Makefile 2001/06/24 15:45:52 @@ -1,5 +1,6 @@ # $FreeBSD: src/usr.bin/fsync/Makefile,v 1.2 2000/07/19 08:44:26 ps Exp $ PROG= fsync +WARNS?= 2 .include Index: usr.bin/gencat/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/gencat/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- usr.bin/gencat/Makefile 1999/08/28 01:01:40 1.5 +++ usr.bin/gencat/Makefile 2001/06/24 15:45:52 @@ -2,6 +2,7 @@ PROG= gencat SRCS= gencat.c genlib.c +WARNS?= 2 CFLAGS+= -I${.CURDIR}/../../lib/libc/nls Index: usr.sbin/jail/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/jail/Makefile,v retrieving revision 1.6 diff -u -r1.6 Makefile --- usr.sbin/jail/Makefile 2001/03/26 14:40:27 1.6 +++ usr.sbin/jail/Makefile 2001/06/24 04:42:13 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/jail/Makefile,v 1.6 2001/03/26 14:40:27 ru Exp $ PROG= jail +WARNS?= 2 MAN= jail.8 .include Index: usr.bin/key/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/key/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- usr.bin/key/Makefile 2001/03/27 10:51:47 1.5 +++ usr.bin/key/Makefile 2001/06/24 15:45:53 @@ -3,6 +3,7 @@ PROG= key SRCS= skey.c +WARNS?= 2 CFLAGS+= -D_SKEY_INTERNAL Index: usr.bin/keyinfo/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/keyinfo/Makefile,v retrieving revision 1.8 diff -u -r1.8 Makefile --- usr.bin/keyinfo/Makefile 2000/11/28 07:24:15 1.8 +++ usr.bin/keyinfo/Makefile 2001/06/24 15:45:53 @@ -2,7 +2,7 @@ # $FreeBSD: src/usr.bin/keyinfo/Makefile,v 1.8 2000/11/28 07:24:15 marcel Exp $ PROG= keyinfo -CFLAGS+=-Wall +WARNS?= 2 DPADD= ${LIBSKEY} ${LIBCRYPT} ${LIBMD} LDADD= -lskey -lcrypt -lmd BINMODE=4555 Index: usr.bin/keyinit/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/keyinit/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- usr.bin/keyinit/Makefile 2001/03/27 10:51:47 1.7 +++ usr.bin/keyinit/Makefile 2001/06/24 15:45:53 @@ -3,6 +3,7 @@ PROG= keyinit SRCS= skeyinit.c +WARNS?= 2 CFLAGS+= -D_SKEY_INTERNAL Index: usr.bin/keylogout/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/keylogout/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- usr.bin/keylogout/Makefile 1999/08/28 01:02:28 1.3 +++ usr.bin/keylogout/Makefile 2001/06/24 15:45:53 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.bin/keylogout/Makefile,v 1.3 1999/08/28 01:02:28 peter Exp $ PROG= keylogout +WARNS?= 2 DPADD= ${LIBRPCSVC} LDADD= -lrpcsvc Index: usr.bin/leave/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/leave/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- usr.bin/leave/Makefile 1999/08/28 01:02:45 1.3 +++ usr.bin/leave/Makefile 2001/06/24 15:45:56 @@ -2,6 +2,6 @@ # $FreeBSD: src/usr.bin/leave/Makefile,v 1.3 1999/08/28 01:02:45 peter Exp $ PROG= leave -CFLAGS+=-Wall +WARNS?= 2 .include Index: usr.bin/mesg/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/mesg/Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile --- usr.bin/mesg/Makefile 1994/05/27 12:30:44 1.1.1.1 +++ usr.bin/mesg/Makefile 2001/06/24 15:46:01 @@ -1,5 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= mesg +WARNS?= 2 .include Index: usr.bin/mkfifo/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/mkfifo/Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile --- usr.bin/mkfifo/Makefile 1994/05/27 12:32:19 1.1.1.1 +++ usr.bin/mkfifo/Makefile 2001/06/24 15:46:01 @@ -1,5 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= mkfifo +WARNS?= 2 .include Index: usr.bin/strip/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/strip/Makefile,v retrieving revision 1.11 diff -u -r1.11 Makefile --- usr.bin/strip/Makefile 2001/03/27 10:52:15 1.11 +++ usr.bin/strip/Makefile 2001/06/24 15:46:06 @@ -2,6 +2,7 @@ # $FreeBSD: src/usr.bin/strip/Makefile,v 1.11 2001/03/27 10:52:15 ru Exp $ PROG= strip +WARNS?= 2 MAN= strip.1aout BINDIR= /usr/libexec/aout CLEANFILES += maybe_stripped Index: usr.bin/truncate/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/truncate/Makefile,v retrieving revision 1.1 diff -u -r1.1 Makefile --- usr.bin/truncate/Makefile 2000/07/18 17:03:58 1.1 +++ usr.bin/truncate/Makefile 2001/06/24 15:46:07 @@ -1,5 +1,6 @@ # $FreeBSD: src/usr.bin/truncate/Makefile,v 1.1 2000/07/18 17:03:58 sheldonh Exp $ PROG= truncate +WARNS?= 2 .include Index: usr.bin/unexpand/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/unexpand/Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile --- usr.bin/unexpand/Makefile 1994/05/27 12:33:15 1.1.1.1 +++ usr.bin/unexpand/Makefile 2001/06/24 15:46:07 @@ -1,6 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= unexpand +WARNS?= 2 NOMAN= noman .include Index: usr.bin/what/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/what/Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile --- usr.bin/what/Makefile 1994/05/27 12:33:28 1.1.1.1 +++ usr.bin/what/Makefile 2001/06/24 15:46:13 @@ -1,5 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= what +WARNS?= 2 .include Index: usr.bin/yes/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/yes/Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile --- usr.bin/yes/Makefile 1994/05/27 12:33:42 1.1.1.1 +++ usr.bin/yes/Makefile 2001/06/24 15:46:14 @@ -1,5 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= yes +WARNS?= 2 .include Index: usr.sbin/accton/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/accton/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- usr.sbin/accton/Makefile 2001/03/26 14:39:16 1.4 +++ usr.sbin/accton/Makefile 2001/06/24 15:46:15 @@ -2,6 +2,7 @@ # $FreeBSD: src/usr.sbin/accton/Makefile,v 1.4 2001/03/26 14:39:16 ru Exp $ PROG= accton +WARNS?= 2 MAN= accton.8 .include Index: usr.sbin/dev_mkdb/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/dev_mkdb/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- usr.sbin/dev_mkdb/Makefile 2001/03/26 14:39:50 1.4 +++ usr.sbin/dev_mkdb/Makefile 2001/06/24 15:46:23 @@ -2,6 +2,7 @@ # $FreeBSD: src/usr.sbin/dev_mkdb/Makefile,v 1.4 2001/03/26 14:39:50 ru Exp $ PROG= dev_mkdb +WARNS?= 2 MAN= dev_mkdb.8 .include Index: usr.sbin/digictl/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/digictl/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- usr.sbin/digictl/Makefile 2001/05/17 01:42:52 1.3 +++ usr.sbin/digictl/Makefile 2001/06/24 15:46:23 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/digictl/Makefile,v 1.3 2001/05/17 01:42:52 brian Exp $ PROG= digictl +WARNS?= 2 MAN= digictl.8 .include Index: usr.sbin/lastlogin/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/lastlogin/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- usr.sbin/lastlogin/Makefile 2001/03/26 14:40:33 1.3 +++ usr.sbin/lastlogin/Makefile 2001/06/24 15:46:26 @@ -1,7 +1,7 @@ # $FreeBSD: src/usr.sbin/lastlogin/Makefile,v 1.3 2001/03/26 14:40:33 ru Exp $ PROG= lastlogin +WARNS?= 2 MAN= lastlogin.8 -CFLAGS+=-Wall .include Index: usr.sbin/procctl/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/procctl/Makefile,v retrieving revision 1.6 diff -u -r1.6 Makefile --- usr.sbin/procctl/Makefile 2001/03/26 14:41:30 1.6 +++ usr.sbin/procctl/Makefile 2001/06/24 15:46:42 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/procctl/Makefile,v 1.6 2001/03/26 14:41:30 ru Exp $ PROG= procctl +WARNS?= 2 MAN= procctl.8 .include Index: usr.sbin/rip6query/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/rip6query/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- usr.sbin/rip6query/Makefile 2001/03/26 14:41:41 1.4 +++ usr.sbin/rip6query/Makefile 2001/06/24 15:46:42 @@ -3,6 +3,7 @@ # $FreeBSD: src/usr.sbin/rip6query/Makefile,v 1.4 2001/03/26 14:41:41 ru Exp $ PROG= rip6query +WARNS?= 2 MAN= rip6query.8 CFLAGS+=-DINET6 -I${.CURDIR}/../route6d Index: usr.sbin/usbdevs/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/usbdevs/Makefile,v retrieving revision 1.8 diff -u -r1.8 Makefile --- usr.sbin/usbdevs/Makefile 2001/05/18 13:41:42 1.8 +++ usr.sbin/usbdevs/Makefile 2001/06/24 15:46:47 @@ -2,6 +2,7 @@ # FreeBSD $FreeBSD: src/usr.sbin/usbdevs/Makefile,v 1.8 2001/05/18 13:41:42 ru Exp $ PROG= usbdevs +WARNS?= 2 MAN= usbdevs.8 .include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 24 21:39:26 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 3B74037B401 for ; Sun, 24 Jun 2001 21:39:20 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5P4qB091629; Mon, 25 Jun 2001 00:52:11 -0400 (EDT) (envelope-from mike) Date: Mon, 25 Jun 2001 00:52:11 -0400 (EDT) Message-Id: <200106250452.f5P4qB091629@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.bin/lastcomm patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/lastcomm.20010623.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- lastcomm.20010623.patch o s/time/flags/g; to avoid shadowing a global declaration. o Make some variables const to silence compiler warnings. o Set WARNS?=2 Index: lastcomm/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/lastcomm/Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile --- lastcomm/Makefile 1994/05/27 12:31:57 1.1.1.1 +++ lastcomm/Makefile 2001/06/24 03:17:42 @@ -1,5 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= lastcomm +WARNS?= 2 .include Index: lastcomm/lastcomm.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lastcomm/lastcomm.c,v retrieving revision 1.12 diff -u -r1.12 lastcomm.c --- lastcomm/lastcomm.c 2001/06/16 07:08:37 1.12 +++ lastcomm/lastcomm.c 2001/06/24 03:17:42 @@ -32,7 +32,7 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1980, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ @@ -61,10 +61,9 @@ time_t expand __P((u_int)); char *flagbits __P((int)); -char *getdev __P((dev_t)); +const char *getdev __P((dev_t)); int requested __P((char *[], struct acct *)); static void usage __P((void)); -char *user_from_uid(); #define AC_UTIME 1 /* user */ #define AC_STIME 2 /* system */ @@ -88,8 +87,8 @@ off_t size; time_t t; int ch; - char *acctfile; - int time = 0; + const char *acctfile; + int flags = 0; acctfile = _PATH_ACCT; while ((ch = getopt(argc, argv, "f:usecSE")) != -1) @@ -99,24 +98,24 @@ break; case 'u': - time |= AC_UTIME; /* user time */ + flags |= AC_UTIME; /* user time */ break; case 's': - time |= AC_STIME; /* system time */ + flags |= AC_STIME; /* system time */ break; case 'e': - time |= AC_ETIME; /* elapsed time */ + flags |= AC_ETIME; /* elapsed time */ break; case 'c': - time |= AC_CTIME; /* user + system time */ + flags |= AC_CTIME; /* user + system time */ break; case 'S': - time |= AC_BTIME; /* starting time */ + flags |= AC_BTIME; /* starting time */ break; case 'E': /* exit time (starting time + elapsed time )*/ - time |= AC_FTIME; + flags |= AC_FTIME; break; case '?': @@ -125,8 +124,8 @@ } /* default user + system time and starting time */ - if (!time) { - time = AC_CTIME | AC_BTIME; + if (!flags) { + flags = AC_CTIME | AC_BTIME; } argc -= optind; @@ -184,34 +183,34 @@ /* user + system time */ - if (time & AC_CTIME) { + if (flags & AC_CTIME) { (void)printf(" %6.2f secs", (expand(ab.ac_utime) + expand(ab.ac_stime))/AC_HZ); } /* usr time */ - if (time & AC_UTIME) { + if (flags & AC_UTIME) { (void)printf(" %6.2f us", expand(ab.ac_utime)/AC_HZ); } /* system time */ - if (time & AC_STIME) { + if (flags & AC_STIME) { (void)printf(" %6.2f sy", expand(ab.ac_stime)/AC_HZ); } /* elapsed time */ - if (time & AC_ETIME) { + if (flags & AC_ETIME) { (void)printf(" %8.2f es", expand(ab.ac_etime)/AC_HZ); } /* starting time */ - if (time & AC_BTIME) { + if (flags & AC_BTIME) { (void)printf(" %.16s", ctime(&ab.ac_btime)); } /* exit time (starting time + elapsed time )*/ - if (time & AC_FTIME) { + if (flags & AC_FTIME) { t = ab.ac_btime; t += (time_t)(expand(ab.ac_etime)/AC_HZ); (void)printf(" %.16s", ctime(&t)); @@ -260,7 +259,7 @@ register char *argv[]; register struct acct *acp; { - register char *p; + register const char *p; do { p = user_from_uid(acp->ac_uid, 0); @@ -274,12 +273,12 @@ return (0); } -char * +const char * getdev(dev) dev_t dev; { static dev_t lastdev = (dev_t)-1; - static char *lastname; + static const char *lastname; if (dev == NODEV) /* Special case. */ return ("__"); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 24 21:43:57 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id BCBBD37B401 for ; Sun, 24 Jun 2001 21:43:55 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f5P4hqV94722; Sun, 24 Jun 2001 22:43:52 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106250443.f5P4hqV94722@harmony.village.org> To: Mike Barcroft Subject: Re: src/usr.bin/lastcomm patch Cc: audit@FreeBSD.ORG In-reply-to: Your message of "Mon, 25 Jun 2001 00:52:11 EDT." <200106250452.f5P4qB091629@coffee.q9media.com> References: <200106250452.f5P4qB091629@coffee.q9media.com> Date: Sun, 24 Jun 2001 22:43:52 -0600 From: Warner Losh 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 In message <200106250452.f5P4qB091629@coffee.q9media.com> Mike Barcroft writes: : - register char *p; : + register const char *p; Is there a specific reason you left register in place? Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 24 21:44:21 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 70D8437B406 for ; Sun, 24 Jun 2001 21:44:18 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f5P4iGV94741; Sun, 24 Jun 2001 22:44:16 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106250444.f5P4iGV94741@harmony.village.org> To: Mike Barcroft Subject: Re: src/usr.bin/lastcomm patch Cc: audit@FreeBSD.ORG In-reply-to: Your message of "Mon, 25 Jun 2001 00:52:11 EDT." <200106250452.f5P4qB091629@coffee.q9media.com> References: <200106250452.f5P4qB091629@coffee.q9media.com> Date: Sun, 24 Jun 2001 22:44:16 -0600 From: Warner Losh 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 In message <200106250452.f5P4qB091629@coffee.q9media.com> Mike Barcroft writes: : I would appreciate it if someone would review and commit the patch at : the end of this message. Also available at: : http://testbed.q9media.net/freebsd/lastcomm.20010623.patch Other than the one nit in my last message, this patch looks good. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 24 21:50:28 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 6B8F537B401 for ; Sun, 24 Jun 2001 21:50:25 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5P53Im91660; Mon, 25 Jun 2001 01:03:18 -0400 (EDT) (envelope-from mike) Date: Mon, 25 Jun 2001 01:03:18 -0400 (EDT) Message-Id: <200106250503.f5P53Im91660@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.sbin/mixer patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/mixer.20010625.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- mixer.20010625.patch o Fix minor compiler warning and set WARNS?=2. Index: mixer/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/mixer/Makefile,v retrieving revision 1.8 diff -u -r1.8 Makefile --- mixer/Makefile 2001/03/26 14:40:48 1.8 +++ mixer/Makefile 2001/06/25 04:46:01 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/mixer/Makefile,v 1.8 2001/03/26 14:40:48 ru Exp $ -PROG = mixer +PROG= mixer +WARNS?= 2 MAN= mixer.8 .include Index: mixer/mixer.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/mixer/mixer.c,v retrieving revision 1.15 diff -u -r1.15 mixer.c --- mixer/mixer.c 2001/04/09 11:10:34 1.15 +++ mixer/mixer.c 2001/06/25 04:46:01 @@ -24,7 +24,7 @@ #include #include -char *names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; +const char *names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; void usage(int devmask, int recmask); int res_name(const char *name, int mask); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 24 22: 2:46 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 1BCF037B407 for ; Sun, 24 Jun 2001 22:02:41 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5P5FXo91684; Mon, 25 Jun 2001 01:15:33 -0400 (EDT) (envelope-from mike) Date: Mon, 25 Jun 2001 01:15:33 -0400 (EDT) Message-Id: <200106250515.f5P5FXo91684@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.sbin/fdcontrol patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/fdcontrol.20010625.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- fdcontrol.20010625.patch o Make two functions static to silence compiler warnings o Clean up the Makefile a little and set WARNS?=2 Index: fdcontrol/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/fdcontrol/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- fdcontrol/Makefile 2001/03/26 14:40:02 1.3 +++ fdcontrol/Makefile 2001/06/25 04:58:06 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/fdcontrol/Makefile,v 1.3 2001/03/26 14:40:02 ru Exp $ -PROG = fdcontrol -MAN = fdcontrol.8 +PROG= fdcontrol +WARNS?= 2 +MAN= fdcontrol.8 .include Index: fdcontrol/fdcontrol.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/fdcontrol/fdcontrol.c,v retrieving revision 1.7 diff -u -r1.7 fdcontrol.c --- fdcontrol/fdcontrol.c 2001/06/06 06:16:12 1.7 +++ fdcontrol/fdcontrol.c 2001/06/25 04:58:06 @@ -37,7 +37,7 @@ #include #include -int +static int getnumber(void) { int i; @@ -50,7 +50,7 @@ return i; } -void +static void usage(void) { fprintf(stderr, "usage: fdcontrol [-d 0|1] | [-s] device-node\n"); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 24 22:31:42 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 D793737B405 for ; Sun, 24 Jun 2001 22:31:33 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5P5iQR91718; Mon, 25 Jun 2001 01:44:26 -0400 (EDT) (envelope-from mike) Date: Mon, 25 Jun 2001 01:44:26 -0400 (EDT) Message-Id: <200106250544.f5P5iQR91718@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.sbin/spray patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/spray.20010625.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- spray.20010625.patch o Add missing header o Make some ints unsigned to avoid compiler warnings. o Since the prototypes aren't K&R compatible anyway, convert them to ANSI C. o Set WARNS?=2 Index: spray/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/spray/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- spray/Makefile 2001/03/26 14:41:59 1.7 +++ spray/Makefile 2001/06/25 05:24:11 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/spray/Makefile,v 1.7 2001/03/26 14:41:59 ru Exp $ PROG= spray +WARNS?= 2 MAN= spray.8 DPADD= ${LIBRPCSVC} LDADD= -lrpcsvc Index: spray/spray.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/spray/spray.c,v retrieving revision 1.6 diff -u -r1.6 spray.c --- spray/spray.c 2000/05/28 15:05:15 1.6 +++ spray/spray.c 2001/06/25 05:24:12 @@ -33,6 +33,7 @@ "$FreeBSD: src/usr.sbin/spray/spray.c,v 1.6 2000/05/28 15:05:15 charnier Exp $"; #endif /* not lint */ +#include #include #include #include @@ -44,8 +45,8 @@ #define SPRAYOVERHEAD 86 #endif -static void usage (); -void print_xferstats (); +static void usage(void); +static void print_xferstats(int, int, double); /* spray buffer */ char spray_buffer[SPRAYMAX]; @@ -64,8 +65,8 @@ sprayarr host_array; CLIENT *cl; int c; - int i; - int count = 0; + u_int i; + u_int count = 0; int delay = 0; int length = 0; double xmit_time; /* time to receive data */ @@ -186,11 +187,8 @@ } -void -print_xferstats(packets, packetlen, xfertime) - int packets; - int packetlen; - double xfertime; +static void +print_xferstats(int packets, int packetlen, double xfertime) { int datalen; double pps; /* packets per second */ @@ -212,7 +210,7 @@ static void -usage () +usage(void) { fprintf(stderr, "usage: spray [-c count] [-l length] [-d delay] host\n"); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 24 22:43:27 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 75FBC37B401 for ; Sun, 24 Jun 2001 22:43:25 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 22A633E28; Sun, 24 Jun 2001 22:43:25 -0700 (PDT) To: Mike Barcroft Cc: audit@FreeBSD.org Subject: Re: src/usr.sbin/spray patch In-Reply-To: <200106250544.f5P5iQR91718@coffee.q9media.com>; from mike@q9media.com on "Mon, 25 Jun 2001 01:44:26 -0400 (EDT)" Date: Sun, 24 Jun 2001 22:43:25 -0700 From: Dima Dorfman Message-Id: <20010625054325.22A633E28@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 Mike Barcroft writes: > @@ -186,11 +187,8 @@ > } > > > -void > -print_xferstats(packets, packetlen, xfertime) > - int packets; > - int packetlen; > - double xfertime; > +static void > +print_xferstats(int packets, int packetlen, double xfertime) > { > int datalen; > double pps; /* packets per second */ > @@ -212,7 +210,7 @@ > > > static void > -usage () > +usage(void) > { If you're going to ANSIify these, you might as well ANSIify the rest (i.e., main). As Warner (imp@) said to me once, "The one thing worse than old K&R code in the tree is broken K&R code in the tree." Dima Dorfman dima@unixfreak.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 24 23:30:16 2001 Delivered-To: freebsd-audit@freebsd.org Received: from smtp.www-service.de (smtp.www-service.de [212.77.161.16]) by hub.freebsd.org (Postfix) with SMTP id 7ED5137B406 for ; Sun, 24 Jun 2001 23:30:11 -0700 (PDT) (envelope-from thz@Lennartz-electronic.de) Received: (qmail 9507 invoked from network); 25 Jun 2001 06:30:08 -0000 Received: from pd90065a0.dip.t-dialin.net (HELO fw.tue.le) (217.0.101.160) by smtp.www-service.de with SMTP; 25 Jun 2001 06:30:08 -0000 Received: from mezcal.tue.le (mezcal.tue.le [192.168.201.20]) by fw.tue.le (8.8.8/8.8.8) with ESMTP id IAA05104 for ; Mon, 25 Jun 2001 08:29:56 +0200 (CEST) (envelope-from thz@mezcal.tue.le) Received: (from thz@localhost) by mezcal.tue.le (8.11.3/8.11.3) id f5P6Tt421502 for audit@freebsd.org; Mon, 25 Jun 2001 08:29:55 +0200 (CEST) (envelope-from thz) Date: Mon, 25 Jun 2001 08:22:17 +0200 From: Thomas Zenker To: audit@freebsd.org Subject: Re: bin/27029: strptime: %s formatting missing (patch) Message-ID: <20010625082217.A21418@mezcal.tue.le> References: <200106250228.f5P2Sik45523@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200106250228.f5P2Sik45523@freefall.freebsd.org>; from dd@FreeBSD.org on Sun, Jun 24, 2001 at 07:28:44PM -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 --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Jun 24, 2001 at 07:28:44PM -0700, dd@FreeBSD.org wrote: > Synopsis: strptime: %s formatting missing (patch) > > State-Changed-From-To: open->feedback > State-Changed-By: dd > State-Changed-When: Sun Jun 24 19:28:08 PDT 2001 > State-Changed-Why: > The patch looks pretty good; however, could you please send it to > audit@freebsd.org for further review? > > http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27029 Hello, I have this patch running in our production software since half a year and not encountered problems. It applies to current also (at least when I revised it last time). -- Thomas Zenker c/o Lennartz electronic GmbH Bismarckstrasse 136, D-72072 Tuebingen, Germany Phone: +49-(0)7071-93550 Email: thz@lennartz-electronic.de --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch-strptime Index: lib/libc/stdtime/strptime.c =================================================================== RCS file: /usr/cvs/FreeBSD/src/lib/libc/stdtime/strptime.c,v retrieving revision 1.17.2.1 diff -u -r1.17.2.1 strptime.c --- lib/libc/stdtime/strptime.c 2000/10/26 16:07:53 1.17.2.1 +++ lib/libc/stdtime/strptime.c 2001/04/27 19:38:51 @@ -513,6 +513,16 @@ } } break; + case 's': + { + time_t t; + const char *cp; + t = strtol(buf, &cp, 10); + buf = cp; + memcpy(tm, gmtime(&t), sizeof(struct tm)); + got_GMT = 1; + } + break; } } return (char *)buf; --LQksG6bCIzRHxTLp-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 24 23:52:51 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id A8B7F37B401 for ; Sun, 24 Jun 2001 23:52:31 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 8015 invoked by uid 1000); 25 Jun 2001 06:50:45 -0000 Date: Mon, 25 Jun 2001 09:50:45 +0300 From: Peter Pentchev To: Thomas Zenker Cc: audit@freebsd.org Subject: Re: bin/27029: strptime: %s formatting missing (patch) Message-ID: <20010625095045.B934@ringworld.oblivion.bg> Mail-Followup-To: Thomas Zenker , audit@freebsd.org References: <200106250228.f5P2Sik45523@freefall.freebsd.org> <20010625082217.A21418@mezcal.tue.le> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010625082217.A21418@mezcal.tue.le>; from thz@Lennartz-electronic.de on Mon, Jun 25, 2001 at 08:22:17AM +0200 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, Jun 25, 2001 at 08:22:17AM +0200, Thomas Zenker wrote: > On Sun, Jun 24, 2001 at 07:28:44PM -0700, dd@FreeBSD.org wrote: > > Synopsis: strptime: %s formatting missing (patch) > > > > State-Changed-From-To: open->feedback > > State-Changed-By: dd > > State-Changed-When: Sun Jun 24 19:28:08 PDT 2001 > > State-Changed-Why: > > The patch looks pretty good; however, could you please send it to > > audit@freebsd.org for further review? > > > > http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27029 > > Hello, I have this patch running in our production software since half a year > and not encountered problems. It applies to current also (at least when I > revised it last time). Looks good to me. G'luck, Peter -- This sentence no verb. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 25 8: 6:22 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 D141437B401 for ; Mon, 25 Jun 2001 08:06:14 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5PFJ4J92475; Mon, 25 Jun 2001 11:19:04 -0400 (EDT) (envelope-from mike) Date: Mon, 25 Jun 2001 11:19:04 -0400 (EDT) Message-Id: <200106251519.f5PFJ4J92475@coffee.q9media.com> To: Warner Losh From: Mike Barcroft Cc: audit@FreeBSD.ORG Subject: Re: src/usr.bin/lastcomm patch 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 Warner Losh writes: > Is there a specific reason you left register in place? Good point. Patch which also removes register is available at the bottom of this e-mail and also at: http://testbed.q9media.net/freebsd/lastcomm.20010625.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- lastcomm.20010625.patch o s/time/flags/g; to avoid shadowing a global declaration. o Make some variables const to silence compiler warnings. o Remove register storage-classes. o Set WARNS?=2 Index: lastcomm/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/lastcomm/Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile --- lastcomm/Makefile 1994/05/27 12:31:57 1.1.1.1 +++ lastcomm/Makefile 2001/06/25 14:41:49 @@ -1,5 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= lastcomm +WARNS?= 2 .include Index: lastcomm/lastcomm.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lastcomm/lastcomm.c,v retrieving revision 1.12 diff -u -r1.12 lastcomm.c --- lastcomm/lastcomm.c 2001/06/16 07:08:37 1.12 +++ lastcomm/lastcomm.c 2001/06/25 14:41:50 @@ -32,7 +32,7 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1980, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ @@ -61,10 +61,9 @@ time_t expand __P((u_int)); char *flagbits __P((int)); -char *getdev __P((dev_t)); +const char *getdev __P((dev_t)); int requested __P((char *[], struct acct *)); static void usage __P((void)); -char *user_from_uid(); #define AC_UTIME 1 /* user */ #define AC_STIME 2 /* system */ @@ -81,15 +80,15 @@ int argc; char *argv[]; { - register char *p; + char *p; struct acct ab; struct stat sb; FILE *fp; off_t size; time_t t; int ch; - char *acctfile; - int time = 0; + const char *acctfile; + int flags = 0; acctfile = _PATH_ACCT; while ((ch = getopt(argc, argv, "f:usecSE")) != -1) @@ -99,24 +98,24 @@ break; case 'u': - time |= AC_UTIME; /* user time */ + flags |= AC_UTIME; /* user time */ break; case 's': - time |= AC_STIME; /* system time */ + flags |= AC_STIME; /* system time */ break; case 'e': - time |= AC_ETIME; /* elapsed time */ + flags |= AC_ETIME; /* elapsed time */ break; case 'c': - time |= AC_CTIME; /* user + system time */ + flags |= AC_CTIME; /* user + system time */ break; case 'S': - time |= AC_BTIME; /* starting time */ + flags |= AC_BTIME; /* starting time */ break; case 'E': /* exit time (starting time + elapsed time )*/ - time |= AC_FTIME; + flags |= AC_FTIME; break; case '?': @@ -125,8 +124,8 @@ } /* default user + system time and starting time */ - if (!time) { - time = AC_CTIME | AC_BTIME; + if (!flags) { + flags = AC_CTIME | AC_BTIME; } argc -= optind; @@ -184,34 +183,34 @@ /* user + system time */ - if (time & AC_CTIME) { + if (flags & AC_CTIME) { (void)printf(" %6.2f secs", (expand(ab.ac_utime) + expand(ab.ac_stime))/AC_HZ); } /* usr time */ - if (time & AC_UTIME) { + if (flags & AC_UTIME) { (void)printf(" %6.2f us", expand(ab.ac_utime)/AC_HZ); } /* system time */ - if (time & AC_STIME) { + if (flags & AC_STIME) { (void)printf(" %6.2f sy", expand(ab.ac_stime)/AC_HZ); } /* elapsed time */ - if (time & AC_ETIME) { + if (flags & AC_ETIME) { (void)printf(" %8.2f es", expand(ab.ac_etime)/AC_HZ); } /* starting time */ - if (time & AC_BTIME) { + if (flags & AC_BTIME) { (void)printf(" %.16s", ctime(&ab.ac_btime)); } /* exit time (starting time + elapsed time )*/ - if (time & AC_FTIME) { + if (flags & AC_FTIME) { t = ab.ac_btime; t += (time_t)(expand(ab.ac_etime)/AC_HZ); (void)printf(" %.16s", ctime(&t)); @@ -225,7 +224,7 @@ expand(t) u_int t; { - register time_t nt; + time_t nt; nt = t & 017777; t >>= 13; @@ -238,7 +237,7 @@ char * flagbits(f) - register int f; + int f; { static char flags[20] = "-"; char *p; @@ -257,10 +256,10 @@ int requested(argv, acp) - register char *argv[]; - register struct acct *acp; + char *argv[]; + struct acct *acp; { - register char *p; + const char *p; do { p = user_from_uid(acp->ac_uid, 0); @@ -274,12 +273,12 @@ return (0); } -char * +const char * getdev(dev) dev_t dev; { static dev_t lastdev = (dev_t)-1; - static char *lastname; + static const char *lastname; if (dev == NODEV) /* Special case. */ return ("__"); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 25 8:17:58 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 CCE6E37B401 for ; Mon, 25 Jun 2001 08:17:51 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5PFUhS92501; Mon, 25 Jun 2001 11:30:43 -0400 (EDT) (envelope-from mike) Date: Mon, 25 Jun 2001 11:30:43 -0400 (EDT) Message-Id: <200106251530.f5PFUhS92501@coffee.q9media.com> To: Dima Dorfman From: Mike Barcroft Cc: audit@FreeBSD.ORG Subject: Re: src/usr.sbin/spray patch 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: > If you're going to ANSIify these, you might as well ANSIify the rest > (i.e., main). As Warner (imp@) said to me once, "The one thing worse > than old K&R code in the tree is broken K&R code in the tree." Oops, missed main(). Thanks for spotting that. Updated patch at the bottom of this e-mail and also available at: http://testbed.q9media.net/freebsd/spray.20010626.patch I've also cleaned up the way 'count' is handled. Best regards, Mike Barcroft ----------------------------------------------------------------------- spray.20010626.patch o Add missing header o Make some ints unsigned to avoid compiler warnings. o Since the prototypes aren't K&R compatible anyway, convert them to ANSI C. o Set WARNS?=2 Index: spray/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/spray/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- spray/Makefile 2001/03/26 14:41:59 1.7 +++ spray/Makefile 2001/06/25 14:50:45 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/spray/Makefile,v 1.7 2001/03/26 14:41:59 ru Exp $ PROG= spray +WARNS?= 2 MAN= spray.8 DPADD= ${LIBRPCSVC} LDADD= -lrpcsvc Index: spray/spray.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/spray/spray.c,v retrieving revision 1.6 diff -u -r1.6 spray.c --- spray/spray.c 2000/05/28 15:05:15 1.6 +++ spray/spray.c 2001/06/25 14:50:46 @@ -33,6 +33,7 @@ "$FreeBSD: src/usr.sbin/spray/spray.c,v 1.6 2000/05/28 15:05:15 charnier Exp $"; #endif /* not lint */ +#include #include #include #include @@ -44,8 +45,8 @@ #define SPRAYOVERHEAD 86 #endif -static void usage (); -void print_xferstats (); +static void usage(void); +static void print_xferstats(unsigned int, int, double); /* spray buffer */ char spray_buffer[SPRAYMAX]; @@ -56,16 +57,14 @@ struct timeval TIMEOUT = { 25, 0 }; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { spraycumul host_stats; sprayarr host_array; CLIENT *cl; int c; - int i; - int count = 0; + u_int i; + u_int count = 0; int delay = 0; int length = 0; double xmit_time; /* time to receive data */ @@ -143,7 +142,7 @@ /* Spray server with packets */ - printf ("sending %d packets of lnth %d to %s ...", count, length, *argv); + printf ("sending %u packets of lnth %d to %s ...", count, length, *argv); fflush (stdout); for (i = 0; i < count; i++) { @@ -186,11 +185,8 @@ } -void -print_xferstats(packets, packetlen, xfertime) - int packets; - int packetlen; - double xfertime; +static void +print_xferstats(u_int packets, int packetlen, double xfertime) { int datalen; double pps; /* packets per second */ @@ -212,7 +208,7 @@ static void -usage () +usage(void) { fprintf(stderr, "usage: spray [-c count] [-l length] [-d delay] host\n"); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 25 12: 3:12 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 49D7E37B40B; Mon, 25 Jun 2001 12:03:02 -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 NHPRVFB2; Mon, 25 Jun 2001 22:58:21 +0400 Received: (from yar@localhost) by comp.chem.msu.su (8.11.1/8.11.1) id f5PJ2ux13205; Mon, 25 Jun 2001 23:02:56 +0400 (MSD) (envelope-from yar) Date: Mon, 25 Jun 2001 23:02:55 +0400 From: Yar Tikhiy To: audit@freebsd.org, net@freebsd.org Subject: Long ether frames & MTU Message-ID: <20010625230255.A11496@comp.chem.msu.su> 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 there, While more and more Ethernet NIC drivers start supporting long frames (>1518 bytes), the user/admin still cannot raise MTU on an Ethernet interface above the 1500 byte limit due to outdated code in net/if_ethersubr.c Please review the following patch that removes the limitation, and also substitutes predefined symbolic names for some numeric constants. -- Yar --- if_ethersubr.c Wed Mar 14 01:00:32 2001 +++ /home/yar/if_ethersubr.c Mon Jun 25 22:45:25 2001 @@ -677,8 +677,8 @@ if_attach(ifp); ifp->if_type = IFT_ETHER; - ifp->if_addrlen = 6; - ifp->if_hdrlen = 14; + ifp->if_addrlen = ETHER_ADDR_LEN; + ifp->if_hdrlen = ETHER_HDR_LEN; ifp->if_mtu = ETHERMTU; ifp->if_resolvemulti = ether_resolvemulti; if (ifp->if_baudrate == 0) @@ -805,7 +805,7 @@ /* * Set the interface MTU. */ - if (ifr->ifr_mtu > ETHERMTU) { + if (ifr->ifr_mtu > ETHERMTU + ifp->if_hdrlen - ETHER_HDR_LEN) { error = EINVAL; } else { ifp->if_mtu = ifr->ifr_mtu; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 25 12:27:24 2001 Delivered-To: freebsd-audit@freebsd.org Received: from prism.flugsvamp.com (cb58709-a.mdsn1.wi.home.com [24.17.241.9]) by hub.freebsd.org (Postfix) with ESMTP id 11B9B37B406; Mon, 25 Jun 2001 12:27:18 -0700 (PDT) (envelope-from jlemon@flugsvamp.com) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id f5PJPgs08421; Mon, 25 Jun 2001 14:25:42 -0500 (CDT) (envelope-from jlemon) Date: Mon, 25 Jun 2001 14:25:42 -0500 From: Jonathan Lemon To: Yar Tikhiy Cc: audit@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: Long ether frames & MTU Message-ID: <20010625142542.Z33375@prism.flugsvamp.com> References: <20010625230255.A11496@comp.chem.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <20010625230255.A11496@comp.chem.msu.su> 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, Jun 25, 2001 at 11:02:55PM +0400, Yar Tikhiy wrote: > Hi there, > > While more and more Ethernet NIC drivers start supporting long > frames (>1518 bytes), the user/admin still cannot raise MTU on an > Ethernet interface above the 1500 byte limit due to outdated code > in net/if_ethersubr.c > > Please review the following patch that removes the limitation, and > also substitutes predefined symbolic names for some numeric constants. > > -- > Yar > > --- if_ethersubr.c Wed Mar 14 01:00:32 2001 > +++ /home/yar/if_ethersubr.c Mon Jun 25 22:45:25 2001 > @@ -677,8 +677,8 @@ > > if_attach(ifp); > ifp->if_type = IFT_ETHER; > - ifp->if_addrlen = 6; > - ifp->if_hdrlen = 14; > + ifp->if_addrlen = ETHER_ADDR_LEN; > + ifp->if_hdrlen = ETHER_HDR_LEN; > ifp->if_mtu = ETHERMTU; > ifp->if_resolvemulti = ether_resolvemulti; > if (ifp->if_baudrate == 0) > @@ -805,7 +805,7 @@ > /* > * Set the interface MTU. > */ > - if (ifr->ifr_mtu > ETHERMTU) { > + if (ifr->ifr_mtu > ETHERMTU + ifp->if_hdrlen - ETHER_HDR_LEN) { I'm not at all sure how this change will help anything, unless each driver alters if_hdrlen. My inclination would be to just leave the code alone, at the standard 1500 MTU. Drivers which actually are able to handle a larger mtu (e.g: 9000 byte Jumbograms) already have to do their own checks, and thus don't call this function. See, for example, any of the gigabit drivers. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 25 14: 8:56 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 B894D37B40B for ; Mon, 25 Jun 2001 14:08:49 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 304673E28; Mon, 25 Jun 2001 14:08:00 -0700 (PDT) To: Mike Barcroft Cc: audit@FreeBSD.org Subject: Re: src/usr.sbin/fdcontrol patch In-Reply-To: <200106250515.f5P5FXo91684@coffee.q9media.com>; from mike@q9media.com on "Mon, 25 Jun 2001 01:15:33 -0400 (EDT)" Date: Mon, 25 Jun 2001 14:08:00 -0700 From: Dima Dorfman Message-Id: <20010625210800.304673E28@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 Mike Barcroft writes: > I would appreciate it if someone would review and commit the patch at > the end of this message. Also available at: > http://testbed.q9media.net/freebsd/fdcontrol.20010625.patch > > > Best regards, > Mike Barcroft > > ----------------------------------------------------------------------- > > fdcontrol.20010625.patch > > o Make two functions static to silence compiler warnings I think the right thing to do here would be to add prototypes. > o Clean up the Makefile a little and set WARNS?=2 > > > Index: fdcontrol/Makefile > =================================================================== > RCS file: /home/ncvs/src/usr.sbin/fdcontrol/Makefile,v > retrieving revision 1.3 > diff -u -r1.3 Makefile > --- fdcontrol/Makefile 2001/03/26 14:40:02 1.3 > +++ fdcontrol/Makefile 2001/06/25 04:58:06 > @@ -1,6 +1,7 @@ > # $FreeBSD: src/usr.sbin/fdcontrol/Makefile,v 1.3 2001/03/26 14:40:02 ru Exp > $ > > -PROG = fdcontrol > -MAN = fdcontrol.8 > +PROG= fdcontrol > +WARNS?= 2 > +MAN= fdcontrol.8 > > .include > Index: fdcontrol/fdcontrol.c > =================================================================== > RCS file: /home/ncvs/src/usr.sbin/fdcontrol/fdcontrol.c,v > retrieving revision 1.7 > diff -u -r1.7 fdcontrol.c > --- fdcontrol/fdcontrol.c 2001/06/06 06:16:12 1.7 > +++ fdcontrol/fdcontrol.c 2001/06/25 04:58:06 > @@ -37,7 +37,7 @@ > #include > #include > > -int > +static int > getnumber(void) > { > int i; > @@ -50,7 +50,7 @@ > return i; > } > > -void > +static void > usage(void) > { > fprintf(stderr, "usage: fdcontrol [-d 0|1] | [-s] device-node\n"); > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-audit" 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 Mon Jun 25 14:56:50 2001 Delivered-To: freebsd-audit@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 0E1BE37B406; Mon, 25 Jun 2001 14:56:44 -0700 (PDT) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id HAA08754; Tue, 26 Jun 2001 07:56:29 +1000 (EST) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37641) with ESMTP id <01K57RGPE3XSVFADV7@cim.alcatel.com.au>; Tue, 26 Jun 2001 07:56:15 +1000 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.1/8.11.1) id f5PLuOW82464; Tue, 26 Jun 2001 07:56:24 +1000 (EST envelope-from jeremyp) Content-return: prohibited Date: Tue, 26 Jun 2001 07:56:24 +1000 From: Peter Jeremy Subject: Re: Long ether frames & MTU In-reply-to: <20010625142542.Z33375@prism.flugsvamp.com>; from jlemon@flugsvamp.com on Mon, Jun 25, 2001 at 02:25:42PM -0500 To: Jonathan Lemon Cc: Yar Tikhiy , audit@FreeBSD.ORG, net@FreeBSD.ORG Mail-Followup-To: Jonathan Lemon , Yar Tikhiy , audit@FreeBSD.ORG, net@FreeBSD.ORG Message-id: <20010626075624.D95583@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: <20010625230255.A11496@comp.chem.msu.su> <20010625142542.Z33375@prism.flugsvamp.com> 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 2001-Jun-25 14:25:42 -0500, Jonathan Lemon wrote: >On Mon, Jun 25, 2001 at 11:02:55PM +0400, Yar Tikhiy wrote: >> Hi there, >> >> While more and more Ethernet NIC drivers start supporting long >> frames (>1518 bytes), the user/admin still cannot raise MTU on an >> Ethernet interface above the 1500 byte limit due to outdated code >> in net/if_ethersubr.c [patch removed] >I'm not at all sure how this change will help anything, unless each >driver alters if_hdrlen. One benefit is for 802.1Q VLAN support - the existence of lots of hard-wired values that restrict frames to 1518 bytes makes configuring VLAN's a pain. It would be nice if attaching a vlan(4) to a driver that handled 1522 byte frames resulted in a 1500 byte MTU on the vlan. > Drivers which actually are able >to handle a larger mtu (e.g: 9000 byte Jumbograms) already have to do >their own checks, and thus don't call this function. IMHO, it would be nicer if more of the checking was centralised, rather than each driver repeating the same checks. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 25 15:25: 1 2001 Delivered-To: freebsd-audit@freebsd.org Received: from prism.flugsvamp.com (cb58709-a.mdsn1.wi.home.com [24.17.241.9]) by hub.freebsd.org (Postfix) with ESMTP id 8D52337B407; Mon, 25 Jun 2001 15:24:55 -0700 (PDT) (envelope-from jlemon@flugsvamp.com) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id f5PMNIb14733; Mon, 25 Jun 2001 17:23:18 -0500 (CDT) (envelope-from jlemon) Date: Mon, 25 Jun 2001 17:23:18 -0500 From: Jonathan Lemon To: Jonathan Lemon , Yar Tikhiy , audit@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: Long ether frames & MTU Message-ID: <20010625172318.C33375@prism.flugsvamp.com> References: <20010625230255.A11496@comp.chem.msu.su> <20010625142542.Z33375@prism.flugsvamp.com> <20010626075624.D95583@gsmx07.alcatel.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <20010626075624.D95583@gsmx07.alcatel.com.au> 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, Jun 26, 2001 at 07:56:24AM +1000, Peter Jeremy wrote: > On 2001-Jun-25 14:25:42 -0500, Jonathan Lemon wrote: > >On Mon, Jun 25, 2001 at 11:02:55PM +0400, Yar Tikhiy wrote: > >> Hi there, > >> > >> While more and more Ethernet NIC drivers start supporting long > >> frames (>1518 bytes), the user/admin still cannot raise MTU on an > >> Ethernet interface above the 1500 byte limit due to outdated code > >> in net/if_ethersubr.c > [patch removed] > > >I'm not at all sure how this change will help anything, unless each > >driver alters if_hdrlen. > > One benefit is for 802.1Q VLAN support - the existence of lots of > hard-wired values that restrict frames to 1518 bytes makes configuring > VLAN's a pain. It would be nice if attaching a vlan(4) to a driver that > handled 1522 byte frames resulted in a 1500 byte MTU on the vlan. Maybe I'm being dense here, but even with 1522 byte frames, the MTU of the device should still be 1500. MTU in this context applies to IP, so it wouldn't include either the vlan header or the ethernet header. E.g.: there is this check in vlan_config(): if (p->if_data.ifi_hdrlen == sizeof(struct ether_vlan_header)) ifv->ifv_if.if_mtu = p->if_mtu; else ifv->ifv_if.if_mtu = p->if_data.ifi_mtu - EVL_ENCAPLEN; So if the underlying device is willing to support long frames (which is indicated by hacking in a longer headerlen), the vlan MTU is 1500, and the device MTU is 1500. If the underlying device does not support long frames, then the vlan MTU is reduced appropriately. > > Drivers which actually are able > >to handle a larger mtu (e.g: 9000 byte Jumbograms) already have to do > >their own checks, and thus don't call this function. > > IMHO, it would be nicer if more of the checking was centralised, rather > than each driver repeating the same checks. It might be cleaner if the call to ether_ioctl() passed both the proposed MTU and the maximum MTU that the driver is willing to support. However, that would require quite a bit of code restructuring and modifications to existing drivers. I'm not sure it would provide any benefits, as the code in question is a simply a single 'if' statement. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 25 19:44:57 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 063E937B401; Mon, 25 Jun 2001 19:44:52 -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 f5Q2inI59462; Tue, 26 Jun 2001 11:44:49 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: arch@freebsd.org Cc: audit@freebsd.org, athlete@kta.att.ne.jp, iwasaki@jp.freebsd.org Subject: CFR: Crusoe LongRun Support 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: <20010626114448O.iwasaki@jp.FreeBSD.org> Date: Tue, 26 Jun 2001 11:44:48 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 23 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'm going to commit the patches for Transmeta Crusoe LongRun Support. This was originally created by HATTORI-san http://home.att.ne.jp/delta/athlete/longrun/longrun.html as a device driver, then I made cleanups and adding sysctl interface support, like this. hw.crusoe.longrun: 2 hw.crusoe.frequency: 600 hw.crusoe.voltage: 1600 hw.crusoe.percentage: 100 Only hw.crusoe.longrun is changeable, valid values are 0, 1, 2 and 3. The latest patches against sys/sys/i386/i386/identcpu.c at http://people.freebsd.org/~iwasaki/apm/sys-longrun-20010626.diff I'd like to have the patches reviewed in terms of sysctl namespace, security issues and other problems. Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 25 21:22: 3 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 28D6B37B407 for ; Mon, 25 Jun 2001 21:21:59 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5Q4YtR93160; Tue, 26 Jun 2001 00:34:55 -0400 (EDT) (envelope-from mike) Date: Tue, 26 Jun 2001 00:34:55 -0400 (EDT) Message-Id: <200106260434.f5Q4YtR93160@coffee.q9media.com> To: Dima Dorfman From: Mike Barcroft Cc: audit@FreeBSD.ORG Subject: Re: src/usr.sbin/fdcontrol patch 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: > Mike Barcroft writes: >> fdcontrol.20010625.patch >> >> o Make two functions static to silence compiler warnings > > I think the right thing to do here would be to add prototypes. Agreed. Updated patch available at the end of this email and also at: http://testbed.q9media.net/freebsd/fdcontrol.20010626.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- fdcontrol.20010626.patch o Make two functions static to silence compiler warnings o Prototype functions and sort includes o Clean up the Makefile a little and set WARNS?=2 Index: fdcontrol/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/fdcontrol/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- fdcontrol/Makefile 2001/03/26 14:40:02 1.3 +++ fdcontrol/Makefile 2001/06/26 04:12:27 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/fdcontrol/Makefile,v 1.3 2001/03/26 14:40:02 ru Exp $ -PROG = fdcontrol -MAN = fdcontrol.8 +PROG= fdcontrol +WARNS?= 2 +MAN= fdcontrol.8 .include Index: fdcontrol/fdcontrol.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/fdcontrol/fdcontrol.c,v retrieving revision 1.7 diff -u -r1.7 fdcontrol.c --- fdcontrol/fdcontrol.c 2001/06/06 06:16:12 1.7 +++ fdcontrol/fdcontrol.c 2001/06/26 04:12:28 @@ -30,14 +30,18 @@ "$FreeBSD: src/usr.sbin/fdcontrol/fdcontrol.c,v 1.7 2001/06/06 06:16:12 joerg Exp $"; #endif /* not lint */ +#include +#include + #include #include #include #include -#include -#include + +static int getnumber(void); +static void usage(void); -int +static int getnumber(void) { int i; @@ -50,7 +54,7 @@ return i; } -void +static void usage(void) { fprintf(stderr, "usage: fdcontrol [-d 0|1] | [-s] device-node\n"); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 25 22: 8:30 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 628FD37B401 for ; Mon, 25 Jun 2001 22:08:25 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5Q5LR593219; Tue, 26 Jun 2001 01:21:27 -0400 (EDT) (envelope-from mike) Date: Tue, 26 Jun 2001 01:21:27 -0400 (EDT) Message-Id: <200106260521.f5Q5LR593219@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.sbin/burncd patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/burncd.20010626.patch I wasn't able to set WARNS?=2 because cleanup() doesn't use the integer in it's prototype. Does anyone have any suggestions to solve this? Best regards, Mike Barcroft ----------------------------------------------------------------------- o Clean up compile-time warnings. Index: burncd/burncd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/burncd/burncd.c,v retrieving revision 1.13 diff -u -r1.13 burncd.c --- burncd/burncd.c 2001/05/30 08:13:39 1.13 +++ burncd/burncd.c 2001/06/26 04:56:24 @@ -56,7 +56,7 @@ { int ch, arg, addr; int eject=0, list=0, multi=0, preemp=0, speed=1, test_write=0; - char *devname = "/dev/acd0c", *prog_name; + const char *dev_name = "/dev/acd0c", *prog_name; int block_size = 0; prog_name = argv[0]; @@ -67,7 +67,7 @@ break; case 'f': - devname = optarg; + dev_name = optarg; break; case 'l': @@ -106,8 +106,8 @@ if (argc == 0) usage(prog_name); - if ((fd = open(devname, O_RDWR, 0)) < 0) - err(EX_NOINPUT, "open(%s)", devname); + if ((fd = open(dev_name, O_RDWR, 0)) < 0) + err(EX_NOINPUT, "open(%s)", dev_name); if (ioctl(fd, CDRIOCWRITESPEED, &speed) < 0) err(EX_IOERR, "ioctl(CDRIOCWRITESPEED)"); @@ -134,7 +134,7 @@ err(EX_IOERR, "ioctl(CDIOREADTOCENTRY)"); if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, &addr) < 0) err(EX_IOERR, "ioctl(CDRIOCNEXTWRITEABLEADDR)"); - fprintf(stderr, "%d, %d\n", + fprintf(stderr, "%lu, %d\n", ntohl(entry.entry.addr.lba), addr); break; @@ -207,7 +207,7 @@ while (fgets(file_buf, sizeof(file_buf), fp) != NULL) { if (*file_buf == '#' || *file_buf == '\n') continue; - if (eol = strchr(file_buf, '\n')) + if ((eol = strchr(file_buf, '\n')) != NULL) *eol = NULL; write_file(file_buf, block_size); } @@ -252,7 +252,7 @@ { int addr, count, file, filesize, size; char buf[2352*BLOCKS]; - struct stat stat; + struct stat filestat; static int cdopen, done_stdin, tot_size = 0; if (!strcmp(name, "-")) { @@ -278,9 +278,9 @@ if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, &addr) < 0) err(EX_IOERR, "ioctl(CDRIOCNEXTWRITEABLEADDR)"); - if (fstat(file, &stat) < 0) + if (fstat(file, &filestat) < 0) err(EX_IOERR, "fstat(%s)", name); - filesize = stat.st_size / 1024; + filesize = filestat.st_size / 1024; if (!quiet) { fprintf(stderr, "next writeable LBA %d\n", addr); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 25 23:14:29 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id 0625D37B407 for ; Mon, 25 Jun 2001 23:14:26 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 19104 invoked by uid 1000); 26 Jun 2001 06:19:12 -0000 Date: Tue, 26 Jun 2001 09:19:12 +0300 From: Peter Pentchev To: Mike Barcroft Cc: audit@FreeBSD.org Subject: Re: src/usr.sbin/burncd patch Message-ID: <20010626091912.H780@ringworld.oblivion.bg> Mail-Followup-To: Mike Barcroft , audit@FreeBSD.org References: <200106260521.f5Q5LR593219@coffee.q9media.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200106260521.f5Q5LR593219@coffee.q9media.com>; from mike@q9media.com on Tue, Jun 26, 2001 at 01:21:27AM -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 Tue, Jun 26, 2001 at 01:21:27AM -0400, Mike Barcroft wrote: > I would appreciate it if someone would review and commit the patch at > the end of this message. Also available at: > http://testbed.q9media.net/freebsd/burncd.20010626.patch > > I wasn't able to set WARNS?=2 because cleanup() doesn't use the integer > in it's prototype. Does anyone have any suggestions to solve this? Yep, void cleanup(int dummy __unused). G'luck, Peter -- If this sentence didn't exist, somebody would have invented it. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 12:42:52 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 2B53B37B405 for ; Tue, 26 Jun 2001 12:42:46 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f5QJgjU08616 for ; Tue, 26 Jun 2001 13:42:45 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106261942.f5QJgjU08616@harmony.village.org> To: audit@freebsd.org Subject: Config patch to stable. Date: Tue, 26 Jun 2001 13:42:45 -0600 From: Warner Losh 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 Enclosed please find a url for some minor patches to -stable's config. They are relevant only to -stable. It removes the strlc{at,cp} from config. This is a big hassle for some people doing upgrades. http://people.freebsd.org/~imp/config-stable.diff Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 14:21:15 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 5EF4B37B406 for ; Tue, 26 Jun 2001 14:21:13 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f5QLL9n87654; Tue, 26 Jun 2001 17:21:09 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <200106261942.f5QJgjU08616@harmony.village.org> References: <200106261942.f5QJgjU08616@harmony.village.org> Date: Tue, 26 Jun 2001 17:21:07 -0400 To: Warner Losh , audit@FreeBSD.ORG From: Garance A Drosihn Subject: Re: Config patch to stable. 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 1:42 PM -0600 6/26/01, Warner Losh wrote: >Enclosed please find a url for some minor patches to -stable's >config. They are relevant only to -stable. It removes the >strlc{at,cp} from config. This is a big hassle for some people >doing upgrades. In what situations does strlcpy cause a problem in stable upgrades? I just changed TO using strl* routines in a few places in lpr, and intended to do more of that. At what point (release) did strl* routines show up in freebsd? -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 14:22:33 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 03DB637B406 for ; Tue, 26 Jun 2001 14:22:31 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f5QLMQU09714; Tue, 26 Jun 2001 15:22:26 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106262122.f5QLMQU09714@harmony.village.org> To: Garance A Drosihn Subject: Re: Config patch to stable. Cc: audit@FreeBSD.ORG In-reply-to: Your message of "Tue, 26 Jun 2001 17:21:07 EDT." References: <200106261942.f5QJgjU08616@harmony.village.org> Date: Tue, 26 Jun 2001 15:22:25 -0600 From: Warner Losh 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 In message Garance A Drosihn writes: : At 1:42 PM -0600 6/26/01, Warner Losh wrote: : >Enclosed please find a url for some minor patches to -stable's : >config. They are relevant only to -stable. It removes the : >strlc{at,cp} from config. This is a big hassle for some people : >doing upgrades. : : In what situations does strlcpy cause a problem in stable : upgrades? I just changed TO using strl* routines in a few : places in lpr, and intended to do more of that. At what : point (release) did strl* routines show up in freebsd? 4.2 or so was when strl* arrived. And it is a problem because it is a bootstrap tool. lpr/lpd isn't. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 14:45:24 2001 Delivered-To: freebsd-audit@freebsd.org Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by hub.freebsd.org (Postfix) with ESMTP id 5D49C37B401; Tue, 26 Jun 2001 14:43:16 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.11.0/8.11.0) id f5QLhFt11927; Tue, 26 Jun 2001 14:43:15 -0700 Date: Tue, 26 Jun 2001 14:43:15 -0700 From: Brooks Davis To: net@freebsd.org, audit@freebsd.org Subject: review request: network interface cloning Message-ID: <20010626144313.A7909@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" 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 --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Please review the attached patch. It does the following: - implementes network interface cloning via ifconfig - adds cloning support to gif - removes gif dependencies from stf - makes gif and stf modular Notes: The cloning API isn't quite that of NetBSD because the NetBSD API only supported the creation of staticaly numbered interfaces which can lead to races and starvation in theory. This patch instead allows interfaces to implement wildcard interface creation via "ifconfig gif# create". Hajimu UMEMOTO found a bug related to deletion of gif IPv6 tunnels in certain situations. We're fairly certain it's in the IPv6 routing code rather then in gif. Since even with this bug, the world will be a better place with this patch, I've documented it in gif(4)'s BUGS section and suggest we commit anyway to get cloning into the system. -- Brooks P.S. The patch can also be found at: http://people.freebsd.org/~brooks/patches/gif.diff --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 Index: sbin/ifconfig/ifconfig.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sbin/ifconfig/ifconfig.8,v retrieving revision 1.42 diff -u -u -r1.42 ifconfig.8 --- sbin/ifconfig/ifconfig.8 2001/06/11 12:38:43 1.42 +++ sbin/ifconfig/ifconfig.8 2001/06/22 01:11:23 @@ -43,6 +43,7 @@ .Op Fl L .Op Fl m .Ar interface +.Op Cm create .Op Ar address_family .Oo .Ar address Ns Op Cm / Ns Ar prefixlength @@ -50,6 +51,9 @@ .Oc .Op Ar parameters .Nm +.Ar interface +.Cm destroy +.Nm .Fl a .Op Fl L .Op Fl d @@ -66,6 +70,7 @@ .Op Fl d .Op Fl m .Op Fl u +.Op Fl C .Sh DESCRIPTION .Nm Ifconfig is used to assign an address @@ -269,6 +274,18 @@ Unconfigure the physical source and destination address for IP tunnel interfaces previously configured with .Cm tunnel . +.It Cm create +Create the specified network pseudo-device. +.It Cm destroy +Destroy the specified network pseudo-device. +.It Cm plumb +Another name for the +.Fl create +parameter. Included for Solaris compatability. +.It Cm unplumb +Another name for the +.Fl destroy +parameter. Included for Solaris compatability. .It Cm vlan Ar vlan_tag If the interface is a vlan pseudo interface, set the vlan tag value to @@ -586,6 +603,12 @@ and .Fl u=20 (only list interfaces that are up). +.Pp +The +.Fl C +flag may be used to list all of the interface cloners available on +the system, with no additional information. Use of this flag is +mutually exclusive with all other flags and commands. .Pp Only the super-user may modify the configuration of a network interface. .Sh NOTES Index: sbin/ifconfig/ifconfig.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sbin/ifconfig/ifconfig.c,v retrieving revision 1.63 diff -u -u -r1.63 ifconfig.c --- sbin/ifconfig/ifconfig.c 2001/06/11 12:38:43 1.63 +++ sbin/ifconfig/ifconfig.c 2001/06/22 01:12:06 @@ -135,6 +135,7 @@ struct afswtch; =20 int supmedia =3D 0; +int listcloners =3D 0; =20 #ifdef INET6 char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/ @@ -144,6 +145,7 @@ void checkatrange __P((struct sockaddr_at *)); int ifconfig __P((int argc, char *const *argv, const struct afswtch *afp)); void notealias __P((const char *, int, int, const struct afswtch *afp)); +void list_cloners __P((void)); void printb __P((const char *s, unsigned value, const char *bits)); void rt_xaddrs __P((caddr_t, caddr_t, struct rt_addrinfo *)); void status __P((const struct afswtch *afp, int addrcount, @@ -175,8 +177,12 @@ #endif c_func setifipdst; c_func setifflags, setifmetric, setifmtu, setiflladdr; +c_func clone_destroy; =20 =20 +void clone_create __P((void)); + + #define NEXTARG 0xffffff #define NEXTARG2 0xfffffe =20 @@ -239,6 +245,13 @@ { "vlandev", NEXTARG, setvlandev }, { "-vlandev", NEXTARG, unsetvlandev }, #endif +#if 0 + /* XXX `create' special-cased below */ + {"create", 0, clone_create }, + {"plumb", 0, clone_create }, +#endif + {"destroy", 0, clone_destroy }, + {"unplumb", 0, clone_destroy }, #ifdef USE_IEEE80211 { "ssid", NEXTARG, set80211ssid }, { "nwid", NEXTARG, set80211ssid }, @@ -364,16 +377,20 @@ usage() { #ifndef INET6 - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: ifconfig interface address_family [address [dest_address]]", " [parameters]", + " ifconfig -C", + " ifconfig interface create", " ifconfig -a [-d] [-m] [-u] [address_family]", " ifconfig -l [-d] [-u] [address_family]", " ifconfig [-d] [-m] [-u]"); #else - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: ifconfig [-L] interface address_family [address [dest_address]]", " [parameters]", + " ifconfig -C", + " ifconfig interface create", " ifconfig -a [-L] [-d] [-m] [-u] [address_family]", " ifconfig -l [-d] [-u] [address_family]", " ifconfig [-L] [-d] [-m] [-u]"); @@ -402,7 +419,7 @@ =20 /* Parse leading line options */ all =3D downonly =3D uponly =3D namesonly =3D 0; - while ((c =3D getopt(argc, argv, "adlmu" + while ((c =3D getopt(argc, argv, "Cadlmu" #ifdef INET6 "L" #endif @@ -428,6 +445,9 @@ case 'm': /* show media choices in status */ supmedia =3D 1; break; + case 'C': + listcloners =3D 1; + break; default: usage(); break; @@ -436,6 +456,16 @@ argc -=3D optind; argv +=3D optind; =20 + if (listcloners) { + /* -C must be solitary */ + if (all || supmedia || uponly || downonly || namesonly || + argc > 0) + usage(); + =09 + list_cloners(); + exit(0); + } + /* -l cannot be used with -a or -m */ if (namesonly && (all || supmedia)) usage(); @@ -448,6 +478,7 @@ if (!namesonly && argc < 1) all =3D 1; =20 + /* -a and -l allow an address family arg to limit the output */ if (all || namesonly) { if (argc > 1) @@ -473,6 +504,18 @@ =20 /* check and maybe load support for this interface */ ifmaybeload(name); + + /* + * NOTE: We must special-case the `create' command right + * here as we would otherwise fail when trying to find + * the interface. + */ + if (argc > 0 && strcmp(argv[0], "create") =3D=3D 0) { + clone_create(); + argc--, argv++; + if (argc =3D=3D 0) + exit(0); + } } =20 /* Check for address family */ @@ -1861,7 +1904,8 @@ =20 /* turn interface and unit into module name */ strcpy(ifkind, "if_"); - for (cp =3D name, dp =3D ifkind + 3; (*cp !=3D 0) && !isdigit(*cp); cp++,= dp++) + for (cp =3D name, dp =3D ifkind + 3; + (*cp !=3D 0) && !isdigit(*cp) && *cp !=3D '#'; cp++, dp++) *dp =3D *cp; *dp =3D 0; =20 @@ -1887,4 +1931,82 @@ =20 /* not present, we should try to load it */ kldload(ifkind); +} + +void +list_cloners(void) +{ + struct if_clonereq ifcr; + char *cp, *buf; + int idx; + int s; + + s =3D socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) + err(1, "socket"); + + memset(&ifcr, 0, sizeof(ifcr)); + + if (ioctl(s, SIOCIFGCLONERS, &ifcr) < 0) + err(1, "SIOCIFGCLONERS for count"); + + buf =3D malloc(ifcr.ifcr_total * IFNAMSIZ); + if (buf =3D=3D NULL) + err(1, "unable to allocate cloner name buffer"); + + ifcr.ifcr_count =3D ifcr.ifcr_total; + ifcr.ifcr_buffer =3D buf; + + if (ioctl(s, SIOCIFGCLONERS, &ifcr) < 0) + err(1, "SIOCIFGCLONERS for names"); + + /* + * In case some disappeared in the mean time, clamp it down. + */ + if (ifcr.ifcr_count > ifcr.ifcr_total) + ifcr.ifcr_count =3D ifcr.ifcr_total; + + for (cp =3D buf, idx =3D 0; idx < ifcr.ifcr_count; idx++, cp +=3D IFNAMSI= Z) { + if (idx > 0) + putchar(' '); + printf("%s", cp); + } + + putchar('\n'); + free(buf); + return; +} + +void +clone_create() +{ + int s; + + s =3D socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) + err(1, "socket"); + + bzero(&ifr, sizeof(ifr)); + (void) strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + if (ioctl(s, SIOCIFCREATE, &ifr) < 0) + err(1, "SIOCIFCREATE"); + + if (strcmp(name, ifr.ifr_name) !=3D 0) { + printf("%s\n", ifr.ifr_name); + strlcpy(name, ifr.ifr_name, sizeof(name)); + } + + close(s); +} + +void +clone_destroy(val, d, s, rafp) + const char *val; + int d; + int s; + const struct afswtch *rafp; +{ + (void) strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) + err(1, "SIOCIFDESTROY"); } Index: sys/conf/files =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/conf/files,v retrieving revision 1.535 diff -u -u -r1.535 files --- sys/conf/files 2001/06/22 06:34:40 1.535 +++ sys/conf/files 2001/06/23 06:40:44 @@ -893,7 +893,7 @@ net/if_ethersubr.c optional ether net/if_faith.c count faith net/if_fddisubr.c optional fddi -net/if_gif.c count gif +net/if_gif.c optional gif net/if_iso88025subr.c optional token net/if_loop.c optional loop net/if_media.c standard @@ -901,7 +901,7 @@ net/if_ppp.c count ppp net/if_sl.c optional sl net/if_spppsubr.c optional sppp -net/if_stf.c count stf +net/if_stf.c optional stf net/if_tun.c optional tun net/if_tap.c optional tap net/if_vlan.c count vlan Index: sys/i386/conf/GENERIC =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/i386/conf/GENERIC,v retrieving revision 1.312 diff -u -u -r1.312 GENERIC --- sys/i386/conf/GENERIC 2001/06/12 09:39:57 1.312 +++ sys/i386/conf/GENERIC 2001/06/18 22:04:21 @@ -210,7 +210,7 @@ device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" -device gif 4 # IPv6 and IPv4 tunneling +device gif # IPv6 and IPv4 tunneling device faith 1 # IPv6-to-IPv4 relaying (translation) =20 # The `bpf' device enables the Berkeley Packet Filter. Index: sys/ia64/conf/GENERIC =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/ia64/conf/GENERIC,v retrieving revision 1.10 diff -u -u -r1.10 GENERIC --- sys/ia64/conf/GENERIC 2001/05/29 18:49:03 1.10 +++ sys/ia64/conf/GENERIC 2001/06/09 00:55:41 @@ -140,7 +140,7 @@ device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" -device gif 4 # IPv6 and IPv4 tunneling +device gif # IPv6 and IPv4 tunneling device faith 1 # IPv6-to-IPv4 relaying/(translation) =20 # The `bpf' device enables the Berkeley Packet Filter. Index: sys/alpha/conf/GENERIC =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/alpha/conf/GENERIC,v retrieving revision 1.113 diff -u -u -r1.113 GENERIC --- sys/alpha/conf/GENERIC 2001/05/30 03:19:05 1.113 +++ sys/alpha/conf/GENERIC 2001/06/09 00:55:14 @@ -165,7 +165,7 @@ device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" -device gif 4 # IPv6 and IPv4 tunneling +device gif # IPv6 and IPv4 tunneling device faith 1 # IPv6-to-IPv4 relaying/(translation) =20 # The `bpf' device enables the Berkeley Packet Filter. Index: sys/net/if.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/if.c,v retrieving revision 1.109 diff -u -u -r1.109 if.c --- sys/net/if.c 2001/06/11 12:38:58 1.109 +++ sys/net/if.c 2001/06/22 00:11:09 @@ -56,6 +56,7 @@ #include #include #include +#include #include #include =20 @@ -96,6 +97,12 @@ extern void nd6_setmtu __P((struct ifnet *)); #endif =20 +struct if_clone *if_clone_lookup __P((const char *, int *)); +int if_clone_list __P((struct if_clonereq *)); + +LIST_HEAD(, if_clone) if_cloners =3D LIST_HEAD_INITIALIZER(if_cloners); +int if_cloners_count; + /* * Network interface utility routines. * @@ -350,6 +357,179 @@ } =20 /* + * Create a clone network interface. + */ +int +if_clone_create(name, len) + char *name; + int len; +{ + struct if_clone *ifc; + char *dp; + int wildcard =3D 0; + int unit; + int err; + + ifc =3D if_clone_lookup(name, &unit); + if (ifc =3D=3D NULL) + return (EINVAL); + + if (ifunit(name) !=3D NULL) + return (EEXIST); + + if (unit < 0) + wildcard =3D 1; + + err =3D (*ifc->ifc_create)(ifc, &unit); + if (err !=3D 0) + return (err); + + /* In the wildcard case, we need to update the name. */ + if (wildcard) { + for (dp =3D name; *dp !=3D '#'; dp++); + if (snprintf(dp, len - (dp-name), "%d", unit) > + len - (dp-name) - 1) { + /* + * This can only be a programmer error and + * there's no straightforward way to recover if + * it happens. + */ + panic("interface name too long"); + } + =09 + } + + return (0); +} + +/* + * Destroy a clone network interface. + */ +int +if_clone_destroy(name) + const char *name; +{ + struct if_clone *ifc; + struct ifnet *ifp; + + ifc =3D if_clone_lookup(name, NULL); + if (ifc =3D=3D NULL) + return (EINVAL); + + ifp =3D ifunit(name); + if (ifp =3D=3D NULL) + return (ENXIO); + + if (ifc->ifc_destroy =3D=3D NULL) + return (EOPNOTSUPP); + + (*ifc->ifc_destroy)(ifp); + return (0); +} + +/* + * Look up a network interface cloner. + */ +struct if_clone * +if_clone_lookup(name, unitp) + const char *name; + int *unitp; +{ + struct if_clone *ifc; + const char *cp; + int i; + + for (ifc =3D LIST_FIRST(&if_cloners); ifc !=3D NULL;) { + for (cp =3D name, i =3D 0; i < ifc->ifc_namelen; i++, cp++) { + if (ifc->ifc_name[i] !=3D *cp) + goto next_ifc; + } + goto found_name; + next_ifc: + ifc =3D LIST_NEXT(ifc, ifc_list); + } + + /* No match. */ + return (NULL); + + found_name: + if (*cp =3D=3D '#' && *(cp+1) =3D=3D '\0') { + i =3D -1; + } else { + for (i =3D 0; *cp !=3D '\0'; cp++) { + if (*cp < '0' || *cp > '9') { + /* Bogus unit number. */ + return (NULL); + } + i =3D (i * 10) + (*cp - '0'); + } + } + + if (unitp !=3D NULL) + *unitp =3D i; + return (ifc); +} + +/* + * Register a network interface cloner. + */ +void +if_clone_attach(ifc) + struct if_clone *ifc; +{ + + LIST_INSERT_HEAD(&if_cloners, ifc, ifc_list); + if_cloners_count++; +} + +/* + * Unregister a network interface cloner. + */ +void +if_clone_detach(ifc) + struct if_clone *ifc; +{ + + LIST_REMOVE(ifc, ifc_list); + if_cloners_count--; +} + +/* + * Provide list of interface cloners to userspace. + */ +int +if_clone_list(ifcr) + struct if_clonereq *ifcr; +{ + char outbuf[IFNAMSIZ], *dst; + struct if_clone *ifc; + int count, error =3D 0; + + ifcr->ifcr_total =3D if_cloners_count; + if ((dst =3D ifcr->ifcr_buffer) =3D=3D NULL) { + /* Just asking how many there are. */ + return (0); + } + + if (ifcr->ifcr_count < 0) + return (EINVAL); + + count =3D (if_cloners_count < ifcr->ifcr_count) ? + if_cloners_count : ifcr->ifcr_count; + + for (ifc =3D LIST_FIRST(&if_cloners); ifc !=3D NULL && count !=3D 0; + ifc =3D LIST_NEXT(ifc, ifc_list), count--, dst +=3D IFNAMSIZ) { + strncpy(outbuf, ifc->ifc_name, IFNAMSIZ); + outbuf[IFNAMSIZ - 1] =3D '\0'; /* sanity */ + error =3D copyout(outbuf, dst, IFNAMSIZ); + if (error) + break; + } + + return (error); +} + +/* * Locate an interface based on a complete address. */ /*ARGSUSED*/ @@ -687,10 +867,10 @@ * interface structure pointer. */ struct ifnet * -ifunit(char *name) +ifunit(const char *name) { char namebuf[IFNAMSIZ + 1]; - char *cp; + const char *cp; struct ifnet *ifp; int unit; unsigned len, m; @@ -781,6 +961,20 @@ return (ifconf(cmd, data)); } ifr =3D (struct ifreq *)data; + + switch (cmd) { + case SIOCIFCREATE: + case SIOCIFDESTROY: + if ((error =3D suser(p)) !=3D 0) + return (error); + return ((cmd =3D=3D SIOCIFCREATE) ? + if_clone_create(ifr->ifr_name, sizeof(ifr->ifr_name)) : + if_clone_destroy(ifr->ifr_name)); +=09 + case SIOCIFGCLONERS: + return (if_clone_list((struct if_clonereq *)data)); + } + ifp =3D ifunit(ifr->ifr_name); if (ifp =3D=3D 0) return (ENXIO); Index: sys/net/if.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/if.h,v retrieving revision 1.61 diff -u -u -r1.61 if.h --- sys/net/if.h 2001/02/21 06:39:56 1.61 +++ sys/net/if.h 2001/06/22 06:03:23 @@ -37,6 +37,8 @@ #ifndef _NET_IF_H_ #define _NET_IF_H_ =20 +#include + /* * does not depend on on most other systems. This * helps userland compatibility. (struct timeval ifi_lastchange) @@ -45,6 +47,40 @@ #include #endif =20 +struct ifnet; + +/* + * Length of interface external name, including terminating '\0'. + * Note: this is the same size as a generic device's external name. + */ +#define IFNAMSIZ 16 +#define IF_NAMESIZE IFNAMSIZ + +/* + * Structure describing a `cloning' interface. + */ +struct if_clone { + LIST_ENTRY(if_clone) ifc_list; /* on list of cloners */ + const char *ifc_name; /* name of device, e.g. `gif' */ + size_t ifc_namelen; /* length of name */ + + int (*ifc_create)(struct if_clone *, int *); + void (*ifc_destroy)(struct ifnet *); +}; + +#define IF_CLONE_INITIALIZER(name, create, destroy) \ + { { 0 }, name, sizeof(name) - 1, create, destroy } + +/* + * Structure used to query names of interface cloners. + */ + +struct if_clonereq { + int ifcr_total; /* total cloners (out) */ + int ifcr_count; /* room for this many in user buffer */ + char *ifcr_buffer; /* buffer for cloner names */ +}; + /* * Structure describing information about an interface * which may be of interest to management entities. @@ -151,8 +187,6 @@ * remainder may be interface specific. */ struct ifreq { -#define IFNAMSIZ 16 -#define IF_NAMESIZE IFNAMSIZ char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ union { struct sockaddr ifru_addr; Index: sys/net/if_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/if_var.h,v retrieving revision 1.33 diff -u -u -r1.33 if_var.h --- sys/net/if_var.h 2001/03/28 09:17:55 1.33 +++ sys/net/if_var.h 2001/06/22 00:00:59 @@ -401,7 +401,7 @@ /*void ifinit __P((void));*/ /* declared in systm.h for main() */ int ifioctl __P((struct socket *, u_long, caddr_t, struct proc *)); int ifpromisc __P((struct ifnet *, int)); -struct ifnet *ifunit __P((char *)); +struct ifnet *ifunit __P((const char *)); struct ifnet *if_withname __P((struct sockaddr *)); =20 int if_poll_recv_slow __P((struct ifnet *ifp, int *quotap)); @@ -422,6 +422,12 @@ struct ifmultiaddr *ifmaof_ifpforaddr __P((struct sockaddr *, struct ifnet *)); int if_simloop __P((struct ifnet *ifp, struct mbuf *m, int af, int hlen)); + +void if_clone_attach __P((struct if_clone *)); +void if_clone_detach __P((struct if_clone *)); + +int if_clone_create __P((char *, int)); +int if_clone_destroy __P((const char *)); =20 #endif /* _KERNEL */ =20 Index: sys/net/if_gif.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/if_gif.c,v retrieving revision 1.11 diff -u -u -r1.11 if_gif.c --- sys/net/if_gif.c 2001/06/19 15:53:51 1.11 +++ sys/net/if_gif.c 2001/06/25 20:21:24 @@ -44,6 +44,9 @@ #include #include #include +#include +#include /* XXX: Shouldn't really be required! */ +#include #include =20 #include @@ -58,6 +61,8 @@ #ifdef INET #include #include +#include +#include #endif /* INET */ =20 #ifdef INET6 @@ -74,29 +79,47 @@ #include #include =20 -#include "gif.h" -#include "bpf.h" -#define NBPFILTER NBPF - #include + +#define GIFNAME "gif" +#define GIFDEV "if_gif" +#define GIF_MAXUNIT 0x7fff /* ifp->if_unit is only 15 bits */ + +static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); +static struct rman gifunits[1]; +TAILQ_HEAD(gifhead, gif_softc) gifs =3D TAILQ_HEAD_INITIALIZER(gifs); =20 -#if NGIF > 0 +int gif_clone_create __P((struct if_clone *, int *)); +void gif_clone_destroy __P((struct ifnet *)); =20 -void gifattach __P((void *)); +struct if_clone gif_cloner =3D + IF_CLONE_INITIALIZER("gif", gif_clone_create, gif_clone_destroy); + +static int gifmodevent __P((module_t, int, void *)); +void gif_delete_tunnel __P((struct gif_softc *)); static int gif_encapcheck __P((const struct mbuf *, int, int, void *)); + #ifdef INET -extern struct protosw in_gif_protosw; +extern struct domain inetdomain; +struct ipprotosw in_gif_protosw =3D +{ SOCK_RAW, &inetdomain, 0/*IPPROTO_IPV[46]*/, PR_ATOMIC|PR_ADDR, + in_gif_input, rip_output, 0, rip_ctloutput, + 0, + 0, 0, 0, 0, + &rip_usrreqs +}; +#endif +#ifdef INET6 +extern struct domain6 inet6domain; +struct ip6protosw in6_gif_protosw =3D +{ SOCK_RAW, &inet6domain, 0/*IPPROTO_IPV[46]*/, PR_ATOMIC|PR_ADDR, + in6_gif_input, rip6_output, 0, rip6_ctloutput, + 0, + 0, 0, 0, 0, + &rip6_usrreqs +}; #endif -#ifdef INET6 -extern struct ip6protosw in6_gif_protosw; -#endif =20 -/* - * gif global variable definitions - */ -static int ngif; /* number of interfaces */ -static struct gif_softc *gif =3D 0; - #ifndef MAX_GIF_NEST /* * This macro controls the upper limitation on nesting of gif tunnels. @@ -110,64 +133,158 @@ #endif static int max_gif_nesting =3D MAX_GIF_NEST; =20 -void -gifattach(dummy) - void *dummy; +int +gif_clone_create(ifc, unit) + struct if_clone *ifc; + int *unit; { + struct resource *r; struct gif_softc *sc; - int i; =20 - ngif =3D NGIF; - gif =3D sc =3D malloc(ngif * sizeof(struct gif_softc), M_DEVBUF, M_WAITOK= ); - bzero(sc, ngif * sizeof(struct gif_softc)); - for (i =3D 0; i < ngif; sc++, i++) { - sc->gif_if.if_name =3D "gif"; - sc->gif_if.if_unit =3D i; - - sc->encap_cookie4 =3D sc->encap_cookie6 =3D NULL; -#ifdef INET - sc->encap_cookie4 =3D encap_attach_func(AF_INET, -1, - gif_encapcheck, &in_gif_protosw, sc); - if (sc->encap_cookie4 =3D=3D NULL) { - printf("%s: attach failed\n", if_name(&sc->gif_if)); - continue; - } + if (*unit > GIF_MAXUNIT) + return (ENXIO); + + if (*unit < 0) { + r =3D rman_reserve_resource(gifunits, 0, GIF_MAXUNIT, 1, + RF_ALLOCATED | RF_ACTIVE, NULL); + if (r =3D=3D NULL) + return (ENOSPC); + *unit =3D rman_get_start(r); + } else { + r =3D rman_reserve_resource(gifunits, *unit, *unit, 1, + RF_ALLOCATED | RF_ACTIVE, NULL); + if (r =3D=3D NULL) + return (EEXIST); + } +=09 + sc =3D malloc (sizeof(struct gif_softc), M_GIF, M_WAITOK); + bzero(sc, sizeof(struct gif_softc)); + + sc->gif_if.if_softc =3D sc; + sc->gif_if.if_name =3D GIFNAME; + sc->gif_if.if_unit =3D *unit; + sc->r_unit =3D r; + + sc->encap_cookie4 =3D sc->encap_cookie6 =3D NULL; +#ifdef INET + sc->encap_cookie4 =3D encap_attach_func(AF_INET, -1, + gif_encapcheck, (struct protosw*)&in_gif_protosw, sc); + if (sc->encap_cookie4 =3D=3D NULL) { + printf("%s: unable to attach encap4\n", if_name(&sc->gif_if)); + free(sc, M_GIF); + return (EIO); /* XXX */ + } #endif #ifdef INET6 - sc->encap_cookie6 =3D encap_attach_func(AF_INET6, -1, - gif_encapcheck, (struct protosw *)&in6_gif_protosw, sc); - if (sc->encap_cookie6 =3D=3D NULL) { - if (sc->encap_cookie4) { - encap_detach(sc->encap_cookie4); - sc->encap_cookie4 =3D NULL; - } - printf("%s: attach failed\n", if_name(&sc->gif_if)); - continue; + sc->encap_cookie6 =3D encap_attach_func(AF_INET6, -1, + gif_encapcheck, (struct protosw *)&in6_gif_protosw, sc); + if (sc->encap_cookie6 =3D=3D NULL) { + if (sc->encap_cookie4) { + encap_detach(sc->encap_cookie4); + sc->encap_cookie4 =3D NULL; } + printf("%s: unable to attach encap6\n", if_name(&sc->gif_if)); + free(sc, M_GIF); + return (EIO); /* XXX */ + } #endif =20 - sc->gif_if.if_mtu =3D GIF_MTU; - sc->gif_if.if_flags =3D IFF_POINTOPOINT | IFF_MULTICAST; + sc->gif_if.if_mtu =3D GIF_MTU; + sc->gif_if.if_flags =3D IFF_POINTOPOINT | IFF_MULTICAST; #if 0 - /* turn off ingress filter */ - sc->gif_if.if_flags |=3D IFF_LINK2; + /* turn off ingress filter */ + sc->gif_if.if_flags |=3D IFF_LINK2; #endif - sc->gif_if.if_ioctl =3D gif_ioctl; - sc->gif_if.if_output =3D gif_output; - sc->gif_if.if_type =3D IFT_GIF; - sc->gif_if.if_snd.ifq_maxlen =3D IFQ_MAXLEN; - if_attach(&sc->gif_if); -#if NBPFILTER > 0 -#ifdef HAVE_OLD_BPF - bpfattach(&sc->gif_if, DLT_NULL, sizeof(u_int)); -#else - bpfattach(&sc->gif_if.if_bpf, &sc->gif_if, DLT_NULL, sizeof(u_int)); + sc->gif_if.if_ioctl =3D gif_ioctl; + sc->gif_if.if_output =3D gif_output; + sc->gif_if.if_type =3D IFT_GIF; + sc->gif_if.if_snd.ifq_maxlen =3D IFQ_MAXLEN; + if_attach(&sc->gif_if); + bpfattach(&sc->gif_if, DLT_NULL, sizeof(u_int)); + TAILQ_INSERT_TAIL(&gifs, sc, gif_link); + return (0); +} + +void +gif_clone_destroy(ifp) + struct ifnet *ifp; +{ + int err; + struct gif_softc *sc =3D ifp->if_softc; + + gif_delete_tunnel(sc); + TAILQ_REMOVE(&gifs, sc, gif_link); + if (sc->encap_cookie4 !=3D NULL) { + err =3D encap_detach(sc->encap_cookie4); + KASSERT(err =3D=3D 0, ("Unexpected error detaching encap_cookie4")); + } + if (sc->encap_cookie6 !=3D NULL) { + err =3D encap_detach(sc->encap_cookie6); + KASSERT(err =3D=3D 0, ("Unexpected error detaching encap_cookie6")); + } + + bpfdetach(ifp); + if_detach(ifp); + + err =3D rman_release_resource(sc->r_unit); + KASSERT(err =3D=3D 0, ("Unexpected error freeing resource")); + + free(sc, M_GIF); +} + +static int +gifmodevent(mod, type, data) + module_t mod; + int type; + void *data; +{ + int err; + + switch (type) { + case MOD_LOAD: + gifunits->rm_type =3D RMAN_ARRAY; + gifunits->rm_descr =3D "configurable if_gif units"; + err =3D rman_init(gifunits); + if (err !=3D 0) + return (err); + err =3D rman_manage_region(gifunits, 0, GIF_MAXUNIT); + if (err !=3D 0) { + printf("%s: gifunits: rman_manage_region: Failed %d\n", + GIFNAME, err); + rman_fini(gifunits); + return (err); + } + if_clone_attach(&gif_cloner); + +#ifdef INET6 + ip6_gif_hlim =3D GIF_HLIM; #endif + + break; + case MOD_UNLOAD: + if_clone_detach(&gif_cloner); + + while (!TAILQ_EMPTY(&gifs)) + gif_clone_destroy(&TAILQ_FIRST(&gifs)->gif_if); + + err =3D rman_fini(gifunits); + if (err !=3D 0) + return (err); +#ifdef INET6 + ip6_gif_hlim =3D 0; #endif + break; } + return 0; } + +static moduledata_t gif_mod =3D { + "if_gif", + gifmodevent, + 0 +}; =20 -PSEUDO_SET(gifattach, if_gif); +DECLARE_MODULE(if_gif, gif_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); =20 static int gif_encapcheck(m, off, proto, arg) @@ -261,7 +378,6 @@ goto end; } =20 -#if NBPFILTER > 0 if (ifp->if_bpf) { /* * We need to prepend the address family as @@ -277,13 +393,8 @@ m0.m_len =3D 4; m0.m_data =3D (char *)⁡ =09 -#ifdef HAVE_OLD_BPF bpf_mtap(ifp, &m0); -#else - bpf_mtap(ifp->if_bpf, &m0); -#endif } -#endif ifp->if_opackets++;=09 ifp->if_obytes +=3D m->m_pkthdr.len; =20 @@ -333,7 +444,6 @@ =20 m->m_pkthdr.rcvif =3D gifp; =09 -#if NBPFILTER > 0 if (gifp->if_bpf) { /* * We need to prepend the address family as @@ -349,13 +459,8 @@ m0.m_len =3D 4; m0.m_data =3D (char *)&af1; =09 -#ifdef HAVE_OLD_BPF bpf_mtap(gifp, &m0); -#else - bpf_mtap(gifp->if_bpf, &m0); -#endif } -#endif /*NBPFILTER > 0*/ =20 /* * Put the packet to the network layer input queue according to the @@ -408,8 +513,8 @@ int error =3D 0, size; struct sockaddr *dst, *src; struct sockaddr *sa; - int i; int s; + struct ifnet *ifp2; struct gif_softc *sc2; =09 switch (cmd) { @@ -523,8 +628,10 @@ break; } =20 - for (i =3D 0; i < ngif; i++) { - sc2 =3D gif + i; + TAILQ_FOREACH(ifp2, &ifnet, if_link) { + if (strcmp(ifp2->if_name, GIFNAME) !=3D 0) + continue; + sc2 =3D ifp2->if_softc; if (sc2 =3D=3D sc) continue; if (!sc2->gif_pdst || !sc2->gif_psrc) @@ -697,5 +804,21 @@ } bad: return error; +} + +void +gif_delete_tunnel(sc) + struct gif_softc *sc; +{ + /* XXX: NetBSD protects this function with splsoftnet() */ + + if (sc->gif_psrc) { + free((caddr_t)sc->gif_psrc, M_IFADDR); + sc->gif_psrc =3D NULL; + } + if (sc->gif_pdst) { + free((caddr_t)sc->gif_pdst, M_IFADDR); + sc->gif_pdst =3D NULL; + } + /* change the IFF_UP flag as well? */ } -#endif /*NGIF > 0*/ Index: sys/net/if_gif.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/if_gif.h,v retrieving revision 1.4 diff -u -u -r1.4 if_gif.h --- sys/net/if_gif.h 2001/06/11 12:38:58 1.4 +++ sys/net/if_gif.h 2001/06/25 20:16:12 @@ -60,6 +60,8 @@ int gif_flags; const struct encaptab *encap_cookie4; const struct encaptab *encap_cookie6; + struct resource *r_unit; /* resource allocated for this unit */ + TAILQ_ENTRY(gif_softc) gif_link; /* all gif's are linked */ }; =20 #define gif_ro gifsc_gifscr.gifscr_ro Index: sys/net/if_stf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/if_stf.c,v retrieving revision 1.7 diff -u -u -r1.7 if_stf.c --- sys/net/if_stf.c 2001/06/11 12:38:58 1.7 +++ sys/net/if_stf.c 2001/06/25 20:11:52 @@ -98,12 +98,12 @@ #include #include #include +#include #include #include =20 #include #include -#include #include #include =20 @@ -113,23 +113,7 @@ =20 #include =20 -#include "bpf.h" -#define NBPFILTER NBPF -#include "stf.h" -#include "gif.h" /*XXX*/ - -#if NBPFILTER > 0 #include -#endif - -#if NGIF > 0 -#include -#endif - -#if NSTF > 0 -#if NSTF !=3D 1 -# error only single stf interface allowed -#endif =20 #define IN6_IS_ADDR_6TO4(x) (ntohs((x)->s6_addr16[0]) =3D=3D 0x2002) #define GET_V4(x) ((struct in_addr *)(&(x)->s6_addr16[1])) @@ -145,17 +129,20 @@ }; =20 static struct stf_softc *stf; -static int nstf; =20 -#if NGIF > 0 -extern int ip_gif_ttl; /*XXX*/ -#else -static int ip_gif_ttl =3D 40; /*XXX*/ -#endif +static MALLOC_DEFINE(M_STF, "stf", "6to4 Tunnel Interface"); +static int ip_stf_ttl =3D 40; =20 -extern struct protosw in_stf_protosw; +extern struct domain inetdomain; +struct ipprotosw in_stf_protosw =3D +{ SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, + in_stf_input, rip_output, 0, rip_ctloutput, + 0, + 0, 0, 0, 0, + &rip_usrreqs +}; =20 -void stfattach __P((void *)); +static int stfmodevent __P((module_t, int, void *)); static int stf_encapcheck __P((const struct mbuf *, int, int, void *)); static struct in6_ifaddr *stf_getsrcifa6 __P((struct ifnet *)); static int stf_output __P((struct ifnet *, struct mbuf *, struct sockaddr = *, @@ -167,31 +154,31 @@ static void stf_rtrequest __P((int, struct rtentry *, struct sockaddr *)); static int stf_ioctl __P((struct ifnet *, u_long, caddr_t)); =20 -void -stfattach(dummy) - void *dummy; +static int +stfmodevent(mod, type, data) + module_t mod; + int type; + void *data; { struct stf_softc *sc; - int i; + int err; const struct encaptab *p; + + switch (type) { + case MOD_LOAD: + stf =3D malloc(sizeof(struct stf_softc), M_STF, M_WAITOK); + bzero(stf, sizeof(struct stf_softc)); + sc =3D stf; =20 - nstf =3D NSTF; - stf =3D malloc(nstf * sizeof(struct stf_softc), M_DEVBUF, M_WAITOK); - bzero(stf, nstf * sizeof(struct stf_softc)); - sc =3D stf; - - /* XXX just in case... */ - for (i =3D 0; i < nstf; i++) { - sc =3D &stf[i]; bzero(sc, sizeof(*sc)); sc->sc_if.if_name =3D "stf"; - sc->sc_if.if_unit =3D i; + sc->sc_if.if_unit =3D 0; =20 p =3D encap_attach_func(AF_INET, IPPROTO_IPV6, stf_encapcheck, &in_stf_protosw, sc); if (p =3D=3D NULL) { printf("%s: attach failed\n", if_name(&sc->sc_if)); - continue; + return (ENOMEM); } sc->encap_cookie =3D p; =20 @@ -206,18 +193,33 @@ #endif sc->sc_if.if_snd.ifq_maxlen =3D IFQ_MAXLEN; if_attach(&sc->sc_if); -#if NBPFILTER > 0 #ifdef HAVE_OLD_BPF bpfattach(&sc->sc_if, DLT_NULL, sizeof(u_int)); #else bpfattach(&sc->sc_if.if_bpf, &sc->sc_if, DLT_NULL, sizeof(u_int)); #endif -#endif + break; + case MOD_UNLOAD: + sc =3D stf; + bpfdetach(&sc->sc_if); + if_detach(&sc->sc_if); + err =3D encap_detach(sc->encap_cookie); + KASSERT(err =3D=3D 0, ("Unexpected error detaching encap_cookie")); + free(sc, M_STF); + break; } + + return (0); } =20 -PSEUDO_SET(stfattach, if_stf); +static moduledata_t stf_mod =3D { + "if_stf", + stfmodevent, + 0 +}; =20 +DECLARE_MODULE(if_stf, stf_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); + static int stf_encapcheck(m, off, proto, arg) const struct mbuf *m; @@ -389,7 +391,7 @@ &ip->ip_src, sizeof(ip->ip_src)); bcopy(in4, &ip->ip_dst, sizeof(ip->ip_dst)); ip->ip_p =3D IPPROTO_IPV6; - ip->ip_ttl =3D ip_gif_ttl; /*XXX*/ + ip->ip_ttl =3D ip_stf_ttl; ip->ip_len =3D m->m_pkthdr.len; /*host order*/ if (ifp->if_flags & IFF_LINK1) ip_ecn_ingress(ECN_ALLOWED, &ip->ip_tos, &tos); @@ -583,7 +585,6 @@ =20 m->m_pkthdr.rcvif =3D ifp; =09 -#if NBPFILTER > 0 if (ifp->if_bpf) { /* * We need to prepend the address family as @@ -605,7 +606,6 @@ bpf_mtap(ifp->if_bpf, &m0); #endif } -#endif /*NBPFILTER > 0*/ =20 /* * Put the packet to the network layer input queue according to the @@ -679,5 +679,3 @@ =20 return error; } - -#endif /* NSTF > 0 */ Index: sys/netinet/in_gif.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/netinet/in_gif.c,v retrieving revision 1.10 diff -u -u -r1.10 in_gif.c --- sys/netinet/in_gif.c 2001/06/11 12:39:00 1.10 +++ sys/netinet/in_gif.c 2001/06/22 19:21:57 @@ -67,17 +67,9 @@ =20 #include =09 =20 -#include "gif.h" - -#include - #include =20 -#if NGIF > 0 int ip_gif_ttl =3D GIF_TTL; -#else -int ip_gif_ttl =3D 0; -#endif SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_RW, &ip_gif_ttl, 0, ""); =20 @@ -210,25 +202,15 @@ } =20 void -#if __STDC__ -in_gif_input(struct mbuf *m, ...) -#else -in_gif_input(m, va_alist) +in_gif_input(m, off, proto) struct mbuf *m; - va_dcl -#endif + int off; + int proto; { - int off, proto; struct ifnet *gifp =3D NULL; struct ip *ip; - va_list ap; int af; u_int8_t otos; - - va_start(ap, m); - off =3D va_arg(ap, int); - proto =3D va_arg(ap, int); - va_end(ap); =20 ip =3D mtod(m, struct ip *); =20 Index: sys/netinet/in_gif.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/netinet/in_gif.h,v retrieving revision 1.4 diff -u -u -r1.4 in_gif.h --- sys/netinet/in_gif.h 2000/07/04 16:35:05 1.4 +++ sys/netinet/in_gif.h 2001/06/22 19:19:23 @@ -37,7 +37,7 @@ =20 extern int ip_gif_ttl; =20 -void in_gif_input __P((struct mbuf *, ...)); +void in_gif_input __P((struct mbuf *, int off, int proto)); int in_gif_output __P((struct ifnet *, int, struct mbuf *, struct rtentry = *)); int gif_encapcheck4 __P((const struct mbuf *, int, int, void *)); =20 Index: sys/netinet/in_proto.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/netinet/in_proto.c,v retrieving revision 1.56 diff -u -u -r1.56 in_proto.c --- sys/netinet/in_proto.c 2001/06/11 12:39:00 1.56 +++ sys/netinet/in_proto.c 2001/06/11 17:41:06 @@ -78,16 +78,6 @@ #include #endif /* IPSEC */ =20 -#include "gif.h" -#if NGIF > 0 -#include -#endif - -#include "stf.h" -#if NSTF > 0 -#include -#endif - #ifdef IPXIP #include #endif @@ -212,26 +202,6 @@ &rip_usrreqs }, }; - -#if NGIF > 0 -struct ipprotosw in_gif_protosw =3D -{ SOCK_RAW, &inetdomain, 0/*IPPROTO_IPV[46]*/, PR_ATOMIC|PR_ADDR, - in_gif_input, rip_output, 0, rip_ctloutput, - 0, - 0, 0, 0, 0, - &rip_usrreqs -}; -#endif /*NGIF*/ - -#if NSTF > 0 -struct ipprotosw in_stf_protosw =3D -{ SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, - in_stf_input, rip_output, 0, rip_ctloutput, - 0, - 0, 0, 0, 0, - &rip_usrreqs -}; -#endif /*NSTF*/ =20 extern int in_inithead __P((void **, int)); =20 Index: sys/netinet6/in6.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/netinet6/in6.c,v retrieving revision 1.12 diff -u -u -r1.12 in6.c --- sys/netinet6/in6.c 2001/06/11 12:39:05 1.12 +++ sys/netinet6/in6.c 2001/06/11 17:00:35 @@ -105,11 +105,6 @@ #include #endif =20 -#include "gif.h" -#if NGIF > 0 -#include -#endif - #include =20 MALLOC_DEFINE(M_IPMADDR, "in6_multi", "internet multicast address"); Index: sys/netinet6/in6_proto.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/netinet6/in6_proto.c,v retrieving revision 1.14 diff -u -u -r1.14 in6_proto.c --- sys/netinet6/in6_proto.c 2001/06/11 12:39:05 1.14 +++ sys/netinet6/in6_proto.c 2001/06/11 17:01:55 @@ -128,11 +128,6 @@ =20 #include =20 -#include "gif.h" -#if NGIF > 0 -#include -#endif - #include =20 /* @@ -251,16 +246,6 @@ }, }; =20 -#if NGIF > 0 -struct ip6protosw in6_gif_protosw =3D -{ SOCK_RAW, &inet6domain, 0/*IPPROTO_IPV[46]*/, PR_ATOMIC|PR_ADDR, - in6_gif_input, rip6_output, 0, rip6_ctloutput, - 0, - 0, 0, 0, 0, - &rip6_usrreqs -}; -#endif /*NGIF*/ - extern int in6_inithead __P((void **, int)); =20 struct domain inet6domain =3D @@ -299,11 +284,7 @@ int ip6_dad_count =3D 1; /* DupAddrDetectionTransmits */ u_int32_t ip6_flow_seq; int ip6_auto_flowlabel =3D 1; -#if NGIF > 0 -int ip6_gif_hlim =3D GIF_HLIM; -#else int ip6_gif_hlim =3D 0; -#endif int ip6_use_deprecated =3D 1; /* allow deprecated addr (RFC2462 5.5.4) */ int ip6_rr_prune =3D 5; /* router renumbering prefix * walk list every 5 sec. */ Index: sys/netinet6/ip6_input.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/netinet6/ip6_input.c,v retrieving revision 1.27 diff -u -u -r1.27 ip6_input.c --- sys/netinet6/ip6_input.c 2001/06/11 12:39:05 1.27 +++ sys/netinet6/ip6_input.c 2001/06/11 16:58:56 @@ -121,7 +121,6 @@ #include =20 #include "faith.h" -#include "gif.h" =20 #include =20 Index: sys/sys/sockio.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/sys/sockio.h,v retrieving revision 1.18 diff -u -u -r1.18 sockio.h --- sys/sys/sockio.h 2001/06/11 20:34:19 1.18 +++ sys/sys/sockio.h 2001/06/21 21:22:58 @@ -100,4 +100,8 @@ #define SIOCGIFSTATUS _IOWR('i', 59, struct ifstat) /* get IF status */ #define SIOCSIFLLADDR _IOW('i', 60, struct ifreq) /* set link level addr */ =20 +#define SIOCIFCREATE _IOWR('i', 122, struct ifreq) /* create clone if */ +#define SIOCIFDESTROY _IOW('i', 121, struct ifreq) /* destroy clone if */ +#define SIOCIFGCLONERS _IOWR('i', 120, struct if_clonereq) /* get cloners = */ + #endif /* !_SYS_SOCKIO_H_ */ Index: sys/modules/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/modules/Makefile,v retrieving revision 1.186 diff -u -u -r1.186 Makefile --- sys/modules/Makefile 2001/06/14 15:15:54 1.186 +++ sys/modules/Makefile 2001/06/22 01:10:08 @@ -8,7 +8,8 @@ =20 SUBDIR=3D 3dfx accf_data accf_http agp aha amr an aue \ cam ccd cd9660 coda cue dc de dgm digi ed fdescfs fs fxp if_disc if_ef \ - if_ppp if_sl if_tap if_tun ip6fw ipfilter ipfw ispfw joy kue lge \ + if_gif if_ppp if_sl if_stf if_tap if_tun \ + ip6fw ipfilter ipfw ispfw joy kue lge \ libmchain linux lnc md mii mlx msdosfs ncp netgraph nfs nge ntfs \ nullfs nwfs pcn portalfs procfs ${_random} \ rl rp sf sis sk sn snp sound sppp ste sym syscons sysvipc ti tl twe \ --- sys/modules/if_gif/Makefile.orig Fri Jun 8 19:00:25 2001 +++ sys/modules/if_gif/Makefile Fri Jun 8 19:04:43 2001 @@ -0,0 +1,18 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet ${.CURDIR}/../../neti= net6 + +KMOD=3D if_gif +SRCS=3D if_gif.c in_gif.c in6_gif.c opt_inet.h opt_inet6.h opt_mrouting.h +NOMAN=3D + +opt_inet.h: + echo "#define INET 1" > ${.TARGET} + +opt_inet6.h: + echo "#define INET6 1" > ${.TARGET} + +opt_mrouting.h: + echo "#define MROUTING 1" > ${.TARGET} + +.include --- sys/modules/if_stf/Makefile.orig Mon Jun 11 11:34:03 2001 +++ sys/modules/if_stf/Makefile Mon Jun 11 11:36:30 2001 @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net + +KMOD=3D if_stf +SRCS=3D if_stf.c opt_inet.h opt_inet6.h +NOMAN=3D + +opt_inet.h: + echo "#define INET 1" > ${.TARGET} + +opt_inet6.h: + echo "#define INET6 1" > ${.TARGET} + +.include Index: etc/rc.network =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/etc/rc.network,v retrieving revision 1.99 diff -u -u -r1.99 rc.network --- etc/rc.network 2001/06/16 15:48:43 1.99 +++ etc/rc.network 2001/06/22 01:29:04 @@ -766,7 +766,7 @@ continue ;; *) - ifconfig $i tunnel ${peers} + ifconfig $i create tunnel ${peers} ;; esac done Index: share/man/man4/gif.4 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/share/man/man4/gif.4,v retrieving revision 1.9 diff -u -r1.9 gif.4 --- share/man/man4/gif.4 2001/06/11 12:38:48 1.9 +++ share/man/man4/gif.4 2001/06/25 20:42:04 @@ -35,7 +35,7 @@ .Nm gif .Nd generic tunnel interface .Sh SYNOPSIS -.Cd "device gif" Op Ar count +.Cd "device gif" .Sh DESCRIPTION The .Nm @@ -210,3 +210,19 @@ .Dv IFF_LINK0 flag. The behavior was obsoleted and is no longer supported. +.Pp +In some cases, when +.Cm ifconfig gifN destroy +is executed, an IPv6 default route is removed. +This problem occures when the following conditions are met: +.Bl -dash -offset indent -compact +.It +The host doesn't accept RA (i.e. net.inet6.ip6.accept_rtadv=3D0), +.It +the default route is installed manually, and +.It +.Cm ifconfig gifN destroy +is executed. +.El +It is thought that this is not actually a bug in gif, but rather lies +somewhere around a manipulation of an IPv6 routing table. --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7OQHwXY6L6fI4GtQRAjnsAKC3laFZY6DXqns41zRclOrTtYKPLwCfRxrn NZRRjCE/ol1qSUMwRxh+mkg= =uDfo -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 15:58: 6 2001 Delivered-To: freebsd-audit@freebsd.org Received: from iatl0x01.coxmail.com (iatl1x01.coxmail.com [206.157.231.23]) by hub.freebsd.org (Postfix) with ESMTP id CD11437B405 for ; Tue, 26 Jun 2001 15:58:02 -0700 (PDT) (envelope-from mheffner@novacoxmail.com) Received: from enterprise.muriel.penguinpowered.com ([208.138.198.178]) by iatl0x01.coxmail.com (InterMail vK.4.03.02.00 201-232-124 license 85f4f10023be2bd3bce00b3a38363ea2) with ESMTP id <20010626225802.GQRY1034.iatl0x01@enterprise.muriel.penguinpowered.com>; Tue, 26 Jun 2001 18:58:02 -0400 Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.5.0.FreeBSD:20010626225642:518=_"; micalg=pgp-md5; protocol="application/pgp-signature" In-Reply-To: <200106261942.f5QJgjU08616@harmony.village.org> Date: Tue, 26 Jun 2001 22:56:42 -0400 (EDT) Reply-To: Mike Heffner From: Mike Heffner To: Warner Losh Subject: RE: Config patch to stable. Cc: audit@freebsd.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 This message is in MIME format --_=XFMail.1.5.0.FreeBSD:20010626225642:518=_ Content-Type: text/plain; charset=us-ascii Looks good. Why did you add braces to the single statement `else'? On 26-Jun-2001 Warner Losh wrote: | | Enclosed please find a url for some minor patches to -stable's | config. They are relevant only to -stable. It removes the | strlc{at,cp} from config. This is a big hassle for some people doing | upgrades. | | http://people.freebsd.org/~imp/config-stable.diff Mike -- Mike Heffner Fredericksburg, VA --_=XFMail.1.5.0.FreeBSD:20010626225642:518=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7OUtpFokZQs3sv5kRAhZnAKCjraMudhBw4B1N2Z+Nv2m+Xsvl8wCfUPnp z0B54nSZhriVx/UQXC9nx5g= =jsRq -----END PGP SIGNATURE----- --_=XFMail.1.5.0.FreeBSD:20010626225642:518=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 16: 2:46 2001 Delivered-To: freebsd-audit@freebsd.org Received: from iatl0x01.coxmail.com (iatl1x01.coxmail.com [206.157.231.23]) by hub.freebsd.org (Postfix) with ESMTP id 49A9D37B401 for ; Tue, 26 Jun 2001 16:02:43 -0700 (PDT) (envelope-from mheffner@novacoxmail.com) Received: from enterprise.muriel.penguinpowered.com ([208.138.198.178]) by iatl0x01.coxmail.com (InterMail vK.4.03.02.00 201-232-124 license 85f4f10023be2bd3bce00b3a38363ea2) with ESMTP id <20010626230242.GQXE1034.iatl0x01@enterprise.muriel.penguinpowered.com>; Tue, 26 Jun 2001 19:02:42 -0400 Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.5.0.FreeBSD:20010626230122:518=_"; micalg=pgp-md5; protocol="application/pgp-signature" In-Reply-To: <200106260521.f5Q5LR593219@coffee.q9media.com> Date: Tue, 26 Jun 2001 23:01:22 -0400 (EDT) Reply-To: Mike Heffner From: Mike Heffner To: Mike Barcroft Subject: RE: src/usr.sbin/burncd patch Cc: audit@FreeBSD.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 This message is in MIME format --_=XFMail.1.5.0.FreeBSD:20010626230122:518=_ Content-Type: text/plain; charset=us-ascii On 26-Jun-2001 Mike Barcroft wrote: | I would appreciate it if someone would review and commit the patch at | the end of this message. Also available at: | http://testbed.q9media.net/freebsd/burncd.20010626.patch Looks good. You might also want to pass these past Soren too. Mike -- Mike Heffner Fredericksburg, VA --_=XFMail.1.5.0.FreeBSD:20010626230122:518=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7OUyBFokZQs3sv5kRAsfmAKCAW9L8gbhRk5Y8Wx07F3GM/5WH9gCfeBkS POFO5BB0sIGmuB9afUSf4Kc= =dgVz -----END PGP SIGNATURE----- --_=XFMail.1.5.0.FreeBSD:20010626230122:518=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 16: 8:46 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 61FAE37B405 for ; Tue, 26 Jun 2001 16:08:44 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f5QN8gU11078; Tue, 26 Jun 2001 17:08:42 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106262308.f5QN8gU11078@harmony.village.org> To: Mike Heffner Subject: Re: Config patch to stable. Cc: audit@freebsd.org In-reply-to: Your message of "Tue, 26 Jun 2001 22:56:42 EDT." References: Date: Tue, 26 Jun 2001 17:08:42 -0600 From: Warner Losh 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 In message Mike Heffner writes: : Looks good. Why did you add braces to the single statement `else'? Because if you have braces on one part of an if statement, you need them on both parts. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 16:22: 0 2001 Delivered-To: freebsd-audit@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 89B3437B405 for ; Tue, 26 Jun 2001 16:21:56 -0700 (PDT) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id JAA15844; Wed, 27 Jun 2001 09:21:54 +1000 (EST) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37641) with ESMTP id <01K598QY21K0VFATL2@cim.alcatel.com.au>; Wed, 27 Jun 2001 09:21:40 +1000 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.1/8.11.1) id f5QNLoR93519; Wed, 27 Jun 2001 09:21:51 +1000 (EST envelope-from jeremyp) Content-return: prohibited Date: Wed, 27 Jun 2001 09:21:50 +1000 From: Peter Jeremy Subject: Re: Config patch to stable. In-reply-to: <200106262308.f5QN8gU11078@harmony.village.org>; from imp@harmony.village.org on Tue, Jun 26, 2001 at 05:08:42PM -0600 To: Warner Losh Cc: audit@FreeBSD.ORG Mail-Followup-To: Warner Losh , audit@FreeBSD.ORG Message-id: <20010627092150.Q95583@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: <200106262308.f5QN8gU11078@harmony.village.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 On 2001-Jun-26 17:08:42 -0600, Warner Losh wrote: >In message Mike Heffner writes: >: Looks good. Why did you add braces to the single statement `else'? > >Because if you have braces on one part of an if statement, you need >them on both parts. Not according to style(9): if (test) stmt; else if (bar) { stmt; stmt; } else stmt; Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 16:24:55 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id EA33837B406 for ; Tue, 26 Jun 2001 16:24:51 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f5QNOeU11299; Tue, 26 Jun 2001 17:24:40 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106262324.f5QNOeU11299@harmony.village.org> To: Peter Jeremy Subject: Re: Config patch to stable. Cc: audit@FreeBSD.ORG In-reply-to: Your message of "Wed, 27 Jun 2001 09:21:50 +1000." <20010627092150.Q95583@gsmx07.alcatel.com.au> References: <20010627092150.Q95583@gsmx07.alcatel.com.au> <200106262308.f5QN8gU11078@harmony.village.org> Date: Tue, 26 Jun 2001 17:24:40 -0600 From: Warner Losh 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 In message <20010627092150.Q95583@gsmx07.alcatel.com.au> Peter Jeremy writes: : On 2001-Jun-26 17:08:42 -0600, Warner Losh wrote: : >In message Mike Heffner writes: : >: Looks good. Why did you add braces to the single statement `else'? : > : >Because if you have braces on one part of an if statement, you need : >them on both parts. : : Not according to style(9): : if (test) : stmt; : else if (bar) { : stmt; : stmt; : } else : stmt; I could have *SWORN* that was in style(9). It is allowed however "Braces that aren't necessary may be left out." :-) Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 16:41:37 2001 Delivered-To: freebsd-audit@freebsd.org Received: from iatl0x01.coxmail.com (iatl1x01.coxmail.com [206.157.231.23]) by hub.freebsd.org (Postfix) with ESMTP id 69C0A37B401 for ; Tue, 26 Jun 2001 16:41:34 -0700 (PDT) (envelope-from mheffner@novacoxmail.com) Received: from enterprise.muriel.penguinpowered.com ([208.138.198.178]) by iatl0x01.coxmail.com (InterMail vK.4.03.02.00 201-232-124 license 85f4f10023be2bd3bce00b3a38363ea2) with ESMTP id <20010626234133.GSMX1034.iatl0x01@enterprise.muriel.penguinpowered.com>; Tue, 26 Jun 2001 19:41:33 -0400 Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.5.0.FreeBSD:20010626234014:518=_"; micalg=pgp-md5; protocol="application/pgp-signature" In-Reply-To: <200106262308.f5QN8gU11078@harmony.village.org> Date: Tue, 26 Jun 2001 23:40:14 -0400 (EDT) Reply-To: Mike Heffner From: Mike Heffner To: Warner Losh Subject: Re: Config patch to stable. Cc: audit@freebsd.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 This message is in MIME format --_=XFMail.1.5.0.FreeBSD:20010626234014:518=_ Content-Type: text/plain; charset=us-ascii On 26-Jun-2001 Warner Losh wrote: | In message Mike Heffner | writes: |: Looks good. Why did you add braces to the single statement `else'? | | Because if you have braces on one part of an if statement, you need | them on both parts. That doesn't appear to agree with style(9): Closing and opening braces go on the same line as the else. Braces that aren't necessary may be left out. if (test) stmt; else if (bar) { stmt; stmt; } else stmt; Mike -- Mike Heffner Fredericksburg, VA --_=XFMail.1.5.0.FreeBSD:20010626234014:518=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7OVWdFokZQs3sv5kRAjJ/AKCRAL2JGmpWjS+yokSTpSsxDHdxLwCgos/T KN5mR0bMO2r9WowwRtxsx54= =9Mfx -----END PGP SIGNATURE----- --_=XFMail.1.5.0.FreeBSD:20010626234014:518=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 16:46:17 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 2840637B405 for ; Tue, 26 Jun 2001 16:46:15 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f5QNkDU11463; Tue, 26 Jun 2001 17:46:13 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106262346.f5QNkDU11463@harmony.village.org> To: Mike Heffner Subject: Re: Config patch to stable. Cc: audit@freebsd.org In-reply-to: Your message of "Tue, 26 Jun 2001 23:40:14 EDT." References: Date: Tue, 26 Jun 2001 17:46:13 -0600 From: Warner Losh 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 In message Mike Heffner writes: : Braces that aren't necessary may be left out. It is allowed by this statement. If they may be left out, they may be left in too :-) Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 17: 5:20 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 8F69437B407; Tue, 26 Jun 2001 17:05:15 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5R0IPj94518; Tue, 26 Jun 2001 20:18:25 -0400 (EDT) (envelope-from mike) Date: Tue, 26 Jun 2001 20:18:25 -0400 (EDT) Message-Id: <200106270018.f5R0IPj94518@coffee.q9media.com> To: Soren Schmidt From: Mike Barcroft Cc: audit@FreeBSD.org, Peter Pentchev , Mike Heffner Subject: Re: src/usr.sbin/burncd patch 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 Soren, I have a clean up patch to burncd(8). I would appreciate it if you would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/burncd.20010627.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- o Clean up compile-time warnings. o Set WARNS?=2 Index: burncd/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/burncd/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- burncd/Makefile 2001/03/26 14:39:38 1.4 +++ burncd/Makefile 2001/06/26 23:49:00 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/burncd/Makefile,v 1.4 2001/03/26 14:39:38 ru Exp $ PROG= burncd +WARNS?= 2 MAN= burncd.8 .include Index: burncd/burncd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/burncd/burncd.c,v retrieving revision 1.13 diff -u -r1.13 burncd.c --- burncd/burncd.c 2001/05/30 08:13:39 1.13 +++ burncd/burncd.c 2001/06/26 23:49:00 @@ -56,7 +56,7 @@ { int ch, arg, addr; int eject=0, list=0, multi=0, preemp=0, speed=1, test_write=0; - char *devname = "/dev/acd0c", *prog_name; + const char *dev_name = "/dev/acd0c", *prog_name; int block_size = 0; prog_name = argv[0]; @@ -67,7 +67,7 @@ break; case 'f': - devname = optarg; + dev_name = optarg; break; case 'l': @@ -106,8 +106,8 @@ if (argc == 0) usage(prog_name); - if ((fd = open(devname, O_RDWR, 0)) < 0) - err(EX_NOINPUT, "open(%s)", devname); + if ((fd = open(dev_name, O_RDWR, 0)) < 0) + err(EX_NOINPUT, "open(%s)", dev_name); if (ioctl(fd, CDRIOCWRITESPEED, &speed) < 0) err(EX_IOERR, "ioctl(CDRIOCWRITESPEED)"); @@ -134,7 +134,7 @@ err(EX_IOERR, "ioctl(CDIOREADTOCENTRY)"); if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, &addr) < 0) err(EX_IOERR, "ioctl(CDRIOCNEXTWRITEABLEADDR)"); - fprintf(stderr, "%d, %d\n", + fprintf(stderr, "%lu, %d\n", ntohl(entry.entry.addr.lba), addr); break; @@ -207,7 +207,7 @@ while (fgets(file_buf, sizeof(file_buf), fp) != NULL) { if (*file_buf == '#' || *file_buf == '\n') continue; - if (eol = strchr(file_buf, '\n')) + if ((eol = strchr(file_buf, '\n')) != NULL) *eol = NULL; write_file(file_buf, block_size); } @@ -233,7 +233,7 @@ } void -cleanup(int dummy) +cleanup(int dummy __unused) { if (ioctl(fd, CDRIOCSETBLOCKSIZE, &saved_block_size) < 0) err(EX_IOERR, "ioctl(CDRIOCSETBLOCKSIZE)"); @@ -252,7 +252,7 @@ { int addr, count, file, filesize, size; char buf[2352*BLOCKS]; - struct stat stat; + struct stat filestat; static int cdopen, done_stdin, tot_size = 0; if (!strcmp(name, "-")) { @@ -278,9 +278,9 @@ if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, &addr) < 0) err(EX_IOERR, "ioctl(CDRIOCNEXTWRITEABLEADDR)"); - if (fstat(file, &stat) < 0) + if (fstat(file, &filestat) < 0) err(EX_IOERR, "fstat(%s)", name); - filesize = stat.st_size / 1024; + filesize = filestat.st_size / 1024; if (!quiet) { fprintf(stderr, "next writeable LBA %d\n", addr); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 17:13:28 2001 Delivered-To: freebsd-audit@freebsd.org Received: from iatl0x01.coxmail.com (iatl1x01.coxmail.com [206.157.231.23]) by hub.freebsd.org (Postfix) with ESMTP id 59FF937B401 for ; Tue, 26 Jun 2001 17:13:26 -0700 (PDT) (envelope-from mheffner@novacoxmail.com) Received: from enterprise.muriel.penguinpowered.com ([208.138.198.178]) by iatl0x01.coxmail.com (InterMail vK.4.03.02.00 201-232-124 license 85f4f10023be2bd3bce00b3a38363ea2) with ESMTP id <20010627001325.GTRL1034.iatl0x01@enterprise.muriel.penguinpowered.com>; Tue, 26 Jun 2001 20:13:25 -0400 Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.5.0.FreeBSD:20010627001206:518=_"; micalg=pgp-md5; protocol="application/pgp-signature" In-Reply-To: <200106262346.f5QNkDU11463@harmony.village.org> Date: Wed, 27 Jun 2001 00:12:06 -0400 (EDT) Reply-To: Mike Heffner From: Mike Heffner To: Warner Losh Subject: Re: Config patch to stable. Cc: audit@freebsd.org, Mike Heffner 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 This message is in MIME format --_=XFMail.1.5.0.FreeBSD:20010627001206:518=_ Content-Type: text/plain; charset=us-ascii On 26-Jun-2001 Warner Losh wrote: | In message Mike Heffner | writes: |: Braces that aren't necessary may be left out. | | It is allowed by this statement. If they may be left out, they may be | left in too :-) But they shouldn't be added in :P Mike -- Mike Heffner Fredericksburg, VA --_=XFMail.1.5.0.FreeBSD:20010627001206:518=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7OV0VFokZQs3sv5kRAi67AJ9zjqOn8JplGcmKkjmMbaZhuNbuwACffLOE 4/Ybwa3CsCMNe6Kv7MNarN8= =rP9x -----END PGP SIGNATURE----- --_=XFMail.1.5.0.FreeBSD:20010627001206:518=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 22:45:10 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gull.mail.pas.earthlink.net (gull.mail.pas.earthlink.net [207.217.121.85]) by hub.freebsd.org (Postfix) with ESMTP id 12D9037B401 for ; Tue, 26 Jun 2001 22:45:09 -0700 (PDT) (envelope-from cjc@earthlink.net) Received: from blossom.cjclark.org (dialup-209.245.129.76.Dial1.SanJose1.Level3.net [209.245.129.76]) by gull.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id WAA12784; Tue, 26 Jun 2001 22:44:58 -0700 (PDT) Received: (from cjc@localhost) by blossom.cjclark.org (8.11.4/8.11.3) id f5R5icc01775; Tue, 26 Jun 2001 22:44:38 -0700 (PDT) (envelope-from cjc) Date: Tue, 26 Jun 2001 22:44:34 -0700 From: "Crist J. Clark" To: Mike Heffner Cc: Warner Losh , audit@FreeBSD.ORG Subject: Re: Config patch to stable. Message-ID: <20010626224434.A303@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <200106262346.f5QNkDU11463@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mheffner@novacoxmail.com on Wed, Jun 27, 2001 at 12:12:06AM -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, Jun 27, 2001 at 12:12:06AM -0400, Mike Heffner wrote: > > On 26-Jun-2001 Warner Losh wrote: > | In message Mike Heffner > | writes: > |: Braces that aren't necessary may be left out. > | > | It is allowed by this statement. If they may be left out, they may be > | left in too :-) > > But they shouldn't be added in :P Uh-oh. Time to rewrite style(8) with RFC-style "MUST," "SHOULD," and "MAY"s? -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 22:52:50 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 149D737B401 for ; Tue, 26 Jun 2001 22:52:48 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f5R5qhU13684; Tue, 26 Jun 2001 23:52:43 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106270552.f5R5qhU13684@harmony.village.org> To: cjclark@alum.mit.edu Subject: Re: Config patch to stable. Cc: Mike Heffner , audit@FreeBSD.ORG In-reply-to: Your message of "Tue, 26 Jun 2001 22:44:34 PDT." <20010626224434.A303@blossom.cjclark.org> References: <20010626224434.A303@blossom.cjclark.org> <200106262346.f5QNkDU11463@harmony.village.org> Date: Tue, 26 Jun 2001 23:52:43 -0600 From: Warner Losh 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 In message <20010626224434.A303@blossom.cjclark.org> "Crist J. Clark" writes: : > | It is allowed by this statement. If they may be left out, they may be : > | left in too :-) : > : > But they shouldn't be added in :P : : Uh-oh. Time to rewrite style(8) with RFC-style "MUST," "SHOULD," and : "MAY"s? No. That's taking style(9) too far. The change is allowed, but not required by, style(9). Since it is to a stable branch, I likely shouldn't make it. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 26 23:44:39 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 90C5337B406 for ; Tue, 26 Jun 2001 23:44:36 -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 QAA07345; Wed, 27 Jun 2001 16:44:19 +1000 Date: Wed, 27 Jun 2001 16:42:24 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Warner Losh Cc: Mike Heffner , audit@FreeBSD.ORG Subject: Re: Config patch to stable. In-Reply-To: <200106262346.f5QNkDU11463@harmony.village.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 On Tue, 26 Jun 2001, Warner Losh wrote: > In message Mike Heffner writes: > : Braces that aren't necessary may be left out. > > It is allowed by this statement. If they may be left out, they may be > left in too :-) This statement is a bug in style(9). To fix it, upgrade to rev.1.22 which said "Don't add braces that aren't necessary". (Some unnecessary braces are actually necessary to prevent compiler warnings. Hopefully the compiler warnings are of high quality. I like gcc's warnings about braces, but not its ones about logical and binary logical operations in combination with themselves.) The rule must give an unambigous number of braces; otherwise the code will keep changing when people who like braces and them and people who don't like them delete them. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 0:44:22 2001 Delivered-To: freebsd-audit@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id B46B537B405 for ; Wed, 27 Jun 2001 00:44:20 -0700 (PDT) (envelope-from cjc@earthlink.net) Received: from blossom.cjclark.org (dialup-209.245.129.76.Dial1.SanJose1.Level3.net [209.245.129.76]) by albatross.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id AAA19772; Wed, 27 Jun 2001 00:43:28 -0700 (PDT) Received: (from cjc@localhost) by blossom.cjclark.org (8.11.4/8.11.3) id f5R7g2s02098; Wed, 27 Jun 2001 00:42:02 -0700 (PDT) (envelope-from cjc) Date: Wed, 27 Jun 2001 00:41:37 -0700 From: "Crist J. Clark" To: Warner Losh Cc: cjclark@alum.mit.edu, Mike Heffner , audit@FreeBSD.ORG Subject: Re: Config patch to stable. Message-ID: <20010627004137.B303@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <20010626224434.A303@blossom.cjclark.org> <200106262346.f5QNkDU11463@harmony.village.org> <20010626224434.A303@blossom.cjclark.org> <200106270552.f5R5qhU13684@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200106270552.f5R5qhU13684@harmony.village.org>; from imp@harmony.village.org on Tue, Jun 26, 2001 at 11:52:43PM -0600 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, Jun 26, 2001 at 11:52:43PM -0600, Warner Losh wrote: > In message <20010626224434.A303@blossom.cjclark.org> "Crist J. Clark" writes: > : > | It is allowed by this statement. If they may be left out, they may be > : > | left in too :-) > : > > : > But they shouldn't be added in :P > : > : Uh-oh. Time to rewrite style(8) with RFC-style "MUST," "SHOULD," and > : "MAY"s? > > No. That's taking style(9) too far. Sorry. I didn't know that my remark required a ;). It was in jest. -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 1:12:53 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 EC59B37B401; Wed, 27 Jun 2001 01:12:27 -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 f5R8C0u11775; Wed, 27 Jun 2001 11:12:00 +0300 (EEST) (envelope-from ru) Date: Wed, 27 Jun 2001 11:12:00 +0300 From: Ruslan Ermilov To: Brooks Davis Cc: net@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: review request: network interface cloning Message-ID: <20010627111159.E2097@sunbay.com> Mail-Followup-To: Brooks Davis , net@FreeBSD.ORG, audit@FreeBSD.ORG References: <20010626144313.A7909@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010626144313.A7909@Odin.AC.HMC.Edu>; from brooks@one-eyed-alien.net on Tue, Jun 26, 2001 at 02:43:15PM -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 Tue, Jun 26, 2001 at 02:43:15PM -0700, Brooks Davis wrote: > Please review the attached patch. It does the following: > > - implementes network interface cloning via ifconfig > - adds cloning support to gif > - removes gif dependencies from stf > - makes gif and stf modular > > Notes: > > The cloning API isn't quite that of NetBSD because the NetBSD API only > supported the creation of staticaly numbered interfaces which can lead > to races and starvation in theory. This patch instead allows interfaces > to implement wildcard interface creation via "ifconfig gif# create". > > Hajimu UMEMOTO found a bug related to deletion of gif IPv6 tunnels in > certain situations. We're fairly certain it's in the IPv6 routing code > rather then in gif. Since even with this bug, the world will be a better > place with this patch, I've documented it in gif(4)'s BUGS section and > suggest we commit anyway to get cloning into the system. > > -- Brooks > > P.S. The patch can also be found at: > > http://people.freebsd.org/~brooks/patches/gif.diff > > -- > Any statement of the form "X is the one, true Y" is FALSE. > PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 > > > Index: sbin/ifconfig/ifconfig.8 > +.It Cm plumb > +Another name for the > +.Fl create > +parameter. Included for Solaris compatability. > +.It Cm unplumb > +Another name for the > +.Fl destroy > +parameter. Included for Solaris compatability. Please don't use hard sentence breaks. Always start new sentence at new line. Should not the "compatability" be spelled as "compatibility"? > +.Fl C > +flag may be used to list all of the interface cloners available on > +the system, with no additional information. Use of this flag is > +mutually exclusive with all other flags and commands. Get rid of hard-sentence break. > Index: sbin/ifconfig/ifconfig.c > - while ((c = getopt(argc, argv, "adlmu" > + while ((c = getopt(argc, argv, "Cadlmu" > #ifdef INET6 > "L" > #endif > @@ -428,6 +445,9 @@ > case 'm': /* show media choices in status */ > supmedia = 1; > break; > + case 'C': > + listcloners = 1; > + break; > default: > usage(); > break; Especially with the long getopt() list, it might be a good idea to put `case' statements in the same order as they were in getopt() call. > @@ -448,6 +478,7 @@ > if (!namesonly && argc < 1) > all = 1; > > + > /* -a and -l allow an address family arg to limit the output */ > if (all || namesonly) { > if (argc > 1) Unnecessary newline. > +void > +list_cloners(void) > +{ > + struct if_clonereq ifcr; > + char *cp, *buf; > + int idx; > + int s; > + > + s = socket(AF_INET, SOCK_DGRAM, 0); > + if (s < 0) > + err(1, "socket"); > + Syscalls return -1 on error, not <0. > + putchar('\n'); > + free(buf); > + return; > +} void functions do not need `return' at the end. > +void > +clone_create() > +{ > + int s; > + > + s = socket(AF_INET, SOCK_DGRAM, 0); > + if (s < 0) > + err(1, "socket"); > + > + bzero(&ifr, sizeof(ifr)); You need to decide, memset(3) or bzero(3). :-) > +void > +clone_destroy(val, d, s, rafp) > + const char *val; > + int d; > + int s; > + const struct afswtch *rafp; > +{ > + (void) strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) > + err(1, "SIOCIFDESTROY"); > } > Missing newline after `{'. > Index: sys/net/if.c [...] > /* > + * Create a clone network interface. > + */ > +int > +if_clone_create(name, len) > + char *name; > + int len; > +{ > + struct if_clone *ifc; > + char *dp; > + int wildcard = 0; How about moving the initialization part below? > + int unit; > + int err; > + > + ifc = if_clone_lookup(name, &unit); > + if (ifc == NULL) > + return (EINVAL); > + > + if (ifunit(name) != NULL) > + return (EEXIST); > + > + if (unit < 0) > + wildcard = 1; wildcard = (unit < 0); > + > + err = (*ifc->ifc_create)(ifc, &unit); > + if (err != 0) > + return (err); > + if (err) return (err); is more traditional :-) > + /* In the wildcard case, we need to update the name. */ > + if (wildcard) { > + for (dp = name; *dp != '#'; dp++); > + if (snprintf(dp, len - (dp-name), "%d", unit) > > + len - (dp-name) - 1) { > + /* > + * This can only be a programmer error and > + * there's no straightforward way to recover if > + * it happens. > + */ > + panic("interface name too long"); Probably worth including the function name in the panic() string. > +/* > + * Look up a network interface cloner. > + */ > +struct if_clone * > +if_clone_lookup(name, unitp) > + const char *name; > + int *unitp; > +{ > + struct if_clone *ifc; > + const char *cp; > + int i; > + > + for (ifc = LIST_FIRST(&if_cloners); ifc != NULL;) { > + for (cp = name, i = 0; i < ifc->ifc_namelen; i++, cp++) { > + if (ifc->ifc_name[i] != *cp) > + goto next_ifc; > + } > + goto found_name; > + next_ifc: > + ifc = LIST_NEXT(ifc, ifc_list); > + } > + > + /* No match. */ > + return (NULL); > + return ((struct if_clone *)NULL); IMO looks better. > Index: sys/sys/sockio.h > =================================================================== > RCS file: /home/ncvs/src/sys/sys/sockio.h,v > retrieving revision 1.18 > diff -u -u -r1.18 sockio.h > --- sys/sys/sockio.h 2001/06/11 20:34:19 1.18 > +++ sys/sys/sockio.h 2001/06/21 21:22:58 > @@ -100,4 +100,8 @@ > #define SIOCGIFSTATUS _IOWR('i', 59, struct ifstat) /* get IF status */ > #define SIOCSIFLLADDR _IOW('i', 60, struct ifreq) /* set link level addr */ > > +#define SIOCIFCREATE _IOWR('i', 122, struct ifreq) /* create clone if */ > +#define SIOCIFDESTROY _IOW('i', 121, struct ifreq) /* destroy clone if */ > +#define SIOCIFGCLONERS _IOWR('i', 120, struct if_clonereq) /* get cloners */ > + > #endif /* !_SYS_SOCKIO_H_ */ These should be documented in netintro(4). > Index: share/man/man4/gif.4 > +In some cases, when > +.Cm ifconfig gifN destroy > +is executed, an IPv6 default route is removed. > +This problem occures when the following conditions are met: "occurs"? > +.Bl -dash -offset indent -compact > +.It > +The host doesn't accept RA (i.e. net.inet6.ip6.accept_rtadv=0), Please use the full form of contractions, i.e., "does not". > +.It > +the default route is installed manually, and > +.It > +.Cm ifconfig gifN destroy > +is executed. .Nm ifconfig Ar gifN Cm destroy > +It is thought that this is not actually a bug in gif, but rather lies It is thought that this is not actually a bug in .Nm , but rather lies 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 Wed Jun 27 3:58:44 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id 2110037B406 for ; Wed, 27 Jun 2001 03:58:38 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 23242 invoked by uid 1000); 27 Jun 2001 11:03:22 -0000 Date: Wed, 27 Jun 2001 14:03:22 +0300 From: Peter Pentchev To: arch@FreeBSD.org Cc: audit@FreeBSD.org, freebsd-standards@bostonradio.org Subject: Re: patch for '%lld' handling in *scanf(3) Message-ID: <20010627140322.C19162@ringworld.oblivion.bg> Mail-Followup-To: arch@FreeBSD.org, audit@FreeBSD.org, freebsd-standards@bostonradio.org References: <20010623151310.A497@ringworld.oblivion.bg> <20010623160748.C497@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: <20010623160748.C497@ringworld.oblivion.bg>; from roam@orbitel.bg on Sat, Jun 23, 2001 at 04:07:48PM +0300 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, Jun 23, 2001 at 04:07:48PM +0300, Peter Pentchev wrote: > On Sat, Jun 23, 2001 at 03:13:10PM +0300, Peter Pentchev wrote: > > Hi, > > > > scanf(3) does not understand %lld for 'long long', it only understands > > %qd, and it treats %lld as plain %ld. printf(3) prints out %lld just fine. > > The fix needed is just three lines of code, which have been in both NetBSD > > and OpenBSD for some time. > [snip] > > The patch is attached. > > > > OK, so maybe this patch is not quite semantically correct; it tends > > to assume that 'long long' is the same as 'quad', or at least, that > > the programmer asked for 'quad' by using %lld. A 'real' fix would > > be defining a LONGLONG flag for scanf(). > > Well, here's a patch that implements %lld the proper way :) Somebody told me in private mail that this change should be accompanied by an update to the scanf(3) manual page. At a quick look at the manual page, the 'q' modifier is documented as providing a 'long long int' value. Thus, it seems that 'q' and 'll' should be equivalent, if 'q' is documented as doing exactly what 'll' should do. What to do now? Use my first patch (with 'll' adding QUAD to the flag), or define the new LONGLONG type? If the latter, should 'q' retain the QUAD type, or use the LONGLONG type? In any case, how should the manpage be worded (WRT both 'll' and 'q')? FWIW, here's a chart of the current situation in the several BSD's: LONGLONG flag QUAD flag %lld type %qd type FreeBSD no no none quad_t OpenBSD no yes quad quad_t NetBSD yes yes long long quad_t All the manpages document 'q' as producing a 'long long', and none of the manpages mention 'll'. G'luck, Peter (in a state of utter confuzzlement) -- No language can express every thought unambiguously, least of all this one. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 5:57:29 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 1148B37B405; Wed, 27 Jun 2001 05:57:23 -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 WAA06846; Wed, 27 Jun 2001 22:57:15 +1000 Date: Wed, 27 Jun 2001 22:55:20 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Peter Pentchev Cc: arch@FreeBSD.ORG, audit@FreeBSD.ORG, freebsd-standards@bostonradio.org Subject: Re: patch for '%lld' handling in *scanf(3) In-Reply-To: <20010627140322.C19162@ringworld.oblivion.bg> 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 On Wed, 27 Jun 2001, Peter Pentchev wrote: > Somebody told me in private mail that this change should be accompanied > by an update to the scanf(3) manual page. At a quick look at the manual > page, the 'q' modifier is documented as providing a 'long long int' value. This is a bug IMO. 'q' provides a quad_t value (but see below). > Thus, it seems that 'q' and 'll' should be equivalent, if 'q' is documented > as doing exactly what 'll' should do. 'll' provides a 'long long' value, although it is currently (mis)implemented by type punning long iongs to quad_t's. > What to do now? Use my first patch (with 'll' adding QUAD to the flag), > or define the new LONGLONG type? If the latter, should 'q' retain the QUAD > type, or use the LONGLONG type? In any case, how should the manpage > be worded (WRT both 'll' and 'q')? Use your second patch. Also, implement it right by not type punning long longs as quads or using strtoq() to parse them (use strtoll()). Maybe fix the longstanding breakage of overflow handling from misusing strtoq() instead of strtol() to parse long values while you are there. > FWIW, here's a chart of the current situation in the several BSD's: > > LONGLONG flag QUAD flag %lld type %qd type > > FreeBSD no no none quad_t > OpenBSD no yes quad quad_t > NetBSD yes yes long long quad_t This oversimplifes things :-). %qd is for quad_t's, but gcc's format checker thinks that it is for long longs (at least for printf, and I think scanf is no different here. Since quad_t's are plain longs on some machines (alphas), %qd is unusable in practice (in code that must compile with WARNS=2, etc.). > All the manpages document 'q' as producing a 'long long', and none > of the manpages mention 'll'. The FreeBSD printf.3 documents this correctly. quad_t and %q should go away when C99's intmax_t and %j become Normal. I think it is time to deprecate them in man pages. (%q is already deprecated in the kernel by not permitting it in FreeBSD's version of gcc's format checker for gcc -fformat-extensions.) long long and %ll unfortunately won't go away, but using them will usually be wrong. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 6:28:46 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id 2829B37B401 for ; Wed, 27 Jun 2001 06:28:34 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 61796 invoked by uid 1000); 27 Jun 2001 13:33:10 -0000 Date: Wed, 27 Jun 2001 16:33:10 +0300 From: Peter Pentchev To: Bruce Evans Cc: arch@FreeBSD.ORG, audit@FreeBSD.ORG, freebsd-standards@bostonradio.org Subject: Re: patch for '%lld' handling in *scanf(3) Message-ID: <20010627163310.G19162@ringworld.oblivion.bg> Mail-Followup-To: Bruce Evans , arch@FreeBSD.ORG, audit@FreeBSD.ORG, freebsd-standards@bostonradio.org References: <20010627140322.C19162@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 bde@zeta.org.au on Wed, Jun 27, 2001 at 10:55:20PM +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, Jun 27, 2001 at 10:55:20PM +1000, Bruce Evans wrote: > On Wed, 27 Jun 2001, Peter Pentchev wrote: > > > Somebody told me in private mail that this change should be accompanied > > by an update to the scanf(3) manual page. At a quick look at the manual > > page, the 'q' modifier is documented as providing a 'long long int' value. > > This is a bug IMO. 'q' provides a quad_t value (but see below). > > > Thus, it seems that 'q' and 'll' should be equivalent, if 'q' is documented > > as doing exactly what 'll' should do. > > 'll' provides a 'long long' value, although it is currently (mis)implemented > by type punning long iongs to quad_t's. > > > What to do now? Use my first patch (with 'll' adding QUAD to the flag), > > or define the new LONGLONG type? If the latter, should 'q' retain the QUAD > > type, or use the LONGLONG type? In any case, how should the manpage > > be worded (WRT both 'll' and 'q')? > > Use your second patch. Also, implement it right by not type punning > long longs as quads or using strtoq() to parse them (use strtoll()). > Maybe fix the longstanding breakage of overflow handling from misusing > strtoq() instead of strtol() to parse long values while you are there. Eep.. ok, I completely forgot about strtoll(). > > FWIW, here's a chart of the current situation in the several BSD's: > > > > LONGLONG flag QUAD flag %lld type %qd type > > > > FreeBSD no no none quad_t > > OpenBSD no yes quad quad_t > > NetBSD yes yes long long quad_t > > This oversimplifes things :-). %qd is for quad_t's, but gcc's format > checker thinks that it is for long longs (at least for printf, and I > think scanf is no different here. Since quad_t's are plain longs > on some machines (alphas), %qd is unusable in practice (in code that > must compile with WARNS=2, etc.). Yes, I didn't say it was complete, I didn't say any of it was correct, it was just a look at lib/lib/stdio/{scanf.3,vfscanf.c} in the various BSD's :) > > All the manpages document 'q' as producing a 'long long', and none > > of the manpages mention 'll'. > > The FreeBSD printf.3 documents this correctly. > > quad_t and %q should go away when C99's intmax_t and %j become Normal. > I think it is time to deprecate them in man pages. (%q is already > deprecated in the kernel by not permitting it in FreeBSD's version of > gcc's format checker for gcc -fformat-extensions.) long long and %ll > unfortunately won't go away, but using them will usually be wrong. Hmm maybe I should spend some more time on this, and at least implement %j? NetBSD has implemented some C99 extensions already.. G'luck, Peter -- Thit sentence is not self-referential because "thit" is not a word. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 10:12:50 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 8415D37B401; Wed, 27 Jun 2001 10:12:43 -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 NHPRVH4D; Wed, 27 Jun 2001 21:07:48 +0400 Received: (from yar@localhost) by comp.chem.msu.su (8.11.1/8.11.1) id f5RHCWQ61872; Wed, 27 Jun 2001 21:12:32 +0400 (MSD) (envelope-from yar) Date: Wed, 27 Jun 2001 21:12:32 +0400 From: Yar Tikhiy To: Jonathan Lemon Cc: audit@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: Long ether frames & MTU Message-ID: <20010627211231.B52886@comp.chem.msu.su> References: <20010625230255.A11496@comp.chem.msu.su> <20010625142542.Z33375@prism.flugsvamp.com> <20010626075624.D95583@gsmx07.alcatel.com.au> <20010625172318.C33375@prism.flugsvamp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010625172318.C33375@prism.flugsvamp.com>; from jlemon@flugsvamp.com on Mon, Jun 25, 2001 at 05:23:18PM -0500 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, Jun 25, 2001 at 05:23:18PM -0500, Jonathan Lemon wrote: > On Tue, Jun 26, 2001 at 07:56:24AM +1000, Peter Jeremy wrote: > > On 2001-Jun-25 14:25:42 -0500, Jonathan Lemon wrote: > > >On Mon, Jun 25, 2001 at 11:02:55PM +0400, Yar Tikhiy wrote: > > >> > > >> While more and more Ethernet NIC drivers start supporting long > > >> frames (>1518 bytes), the user/admin still cannot raise MTU on an > > >> Ethernet interface above the 1500 byte limit due to outdated code > > >> in net/if_ethersubr.c > > [patch removed] > > > > >I'm not at all sure how this change will help anything, unless each > > >driver alters if_hdrlen. > > > > One benefit is for 802.1Q VLAN support - the existence of lots of > > hard-wired values that restrict frames to 1518 bytes makes configuring > > VLAN's a pain. It would be nice if attaching a vlan(4) to a driver that > > handled 1522 byte frames resulted in a 1500 byte MTU on the vlan. > > Maybe I'm being dense here, but even with 1522 byte frames, the MTU > of the device should still be 1500. MTU in this context applies to IP, > so it wouldn't include either the vlan header or the ethernet header. You have a point there! I mistook the layer 3 (IP, IPX etc) MTU for the physical MTU of the ethernet NIC, which is rather high by default for many adapter types, unlike MRU. To run VLANs, one don't need to increase the IP MTU on the trunk interface. So I recall the patch, sorry. -- Yar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 11: 7: 1 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peace.mahoroba.org (peace.calm.imasy.or.jp [202.227.26.34]) by hub.freebsd.org (Postfix) with ESMTP id 6EDFB37B407; Wed, 27 Jun 2001 11:06:54 -0700 (PDT) (envelope-from ume@mahoroba.org) Received: from localhost (IDENT:Uim4Ksh19a0M6sT0FkwwIprS8JZHwSn73PirERPuhLj+rFHz/0qOu2VUMVdB0xOP@localhost [::1]) (authenticated as ume with CRAM-MD5) by peace.mahoroba.org (8.11.4/8.11.4/peace) with ESMTP/inet6 id f5RI6PC76136; Thu, 28 Jun 2001 03:06:25 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 28 Jun 2001 03:06:22 +0900 (JST) Message-Id: <20010628.030622.104053637.ume@mahoroba.org> To: brooks@one-eyed-alien.net Cc: net@freebsd.org, audit@freebsd.org Subject: Re: review request: network interface cloning From: Hajimu UMEMOTO In-Reply-To: <20010626144313.A7909@Odin.AC.HMC.Edu> References: <20010626144313.A7909@Odin.AC.HMC.Edu> X-Mailer: xcite1.38> Mew version 1.95b119 on Emacs 20.7 / Mule 4.0 =?iso-2022-jp?B?KBskQjJWMWMbKEIp?= X-PGP-Public-Key: http://www.imasy.org/~ume/publickey.asc X-PGP-Fingerprint: 6B 0C 53 FC 5D D0 37 91 05 D0 B3 EF 36 9B 6A BC X-URL: http://www.imasy.org/~ume/ X-Operating-System: FreeBSD 5.0-CURRENT Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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, 26 Jun 2001 14:43:15 -0700 >>>>> Brooks Davis said: brooks> Hajimu UMEMOTO found a bug related to deletion of gif IPv6 tunnels in brooks> certain situations. We're fairly certain it's in the IPv6 routing code brooks> rather then in gif. Since even with this bug, the world will be a better brooks> place with this patch, I've documented it in gif(4)'s BUGS section and brooks> suggest we commit anyway to get cloning into the system. At last, I found it. I just committed the fix. Please remove the description from gif(4) manpage. http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet6/nd6.c.diff?r1=1.10&r2=1.11 -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 12:40:21 2001 Delivered-To: freebsd-audit@freebsd.org Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by hub.freebsd.org (Postfix) with ESMTP id EF13737B406; Wed, 27 Jun 2001 12:40:09 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.11.0/8.11.0) id f5RJe9C29463; Wed, 27 Jun 2001 12:40:09 -0700 Date: Wed, 27 Jun 2001 12:40:09 -0700 From: Brooks Davis To: Ruslan Ermilov Cc: net@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: review request: network interface cloning Message-ID: <20010627124009.D12739@Odin.AC.HMC.Edu> References: <20010626144313.A7909@Odin.AC.HMC.Edu> <20010627111159.E2097@sunbay.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="osDK9TLjxFScVI/L" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010627111159.E2097@sunbay.com>; from ru@FreeBSD.ORG on Wed, Jun 27, 2001 at 11:12:00AM +0300 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 --osDK9TLjxFScVI/L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thanks for the review. On Wed, Jun 27, 2001 at 11:12:00AM +0300, Ruslan Ermilov wrote: > Please don't use hard sentence breaks. I'm, not sure what you mean by this. Do you mean, don't use ". " or what? I've moved to split sentences by lines. > Especially with the long getopt() list, it might be a good idea to put > `case' statements in the same order as they were in getopt() call. I've reordered the switch statement to be ordered like getopt. It's not entierly right and Sheldon is correct that usage and the SYNOPSIS are also misorderd, but I'm not going to fix that just now. There are lots of problems with ifconfig and fixing them isn't really the point of this patch. I'm actually thinking of taking a look at adding our local extensions to the NetBSD ifconfig source and moving to that since they have actually maintained it. > You need to decide, memset(3) or bzero(3). :-) memset looks more common so I'm using it now. Some bzeros remain in unrelated parts of the code. > > + err =3D (*ifc->ifc_create)(ifc, &unit); > > + if (err !=3D 0) > > + return (err); > > + > if (err) > return (err); >=20 > is more traditional :-) But err isn't a boolean and the example in style(9) is: error =3D function(a1, a2); if (error !=3D 0) exit(error); The bug I documented in the gif manpage was caught and squashed so that has been removed. I've updated the diff at: http://people.freebsd.org/~brooks/patches/gif.diff -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --osDK9TLjxFScVI/L Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7OjaYXY6L6fI4GtQRAv9SAJ9yM2ydWxKe3mWdUrNSPat/0jKTGgCaA22p z1cbc1x7Dj2iOuUZBwQqriY= =Tw8F -----END PGP SIGNATURE----- --osDK9TLjxFScVI/L-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 13:10: 9 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 5983237B401; Wed, 27 Jun 2001 13:10:04 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f5RK9wU96634; Wed, 27 Jun 2001 14:09:58 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106272009.f5RK9wU96634@harmony.village.org> To: Brooks Davis Subject: Re: review request: network interface cloning Cc: Ruslan Ermilov , net@FreeBSD.ORG, audit@FreeBSD.ORG In-reply-to: Your message of "Wed, 27 Jun 2001 12:40:09 PDT." <20010627124009.D12739@Odin.AC.HMC.Edu> References: <20010627124009.D12739@Odin.AC.HMC.Edu> <20010626144313.A7909@Odin.AC.HMC.Edu> <20010627111159.E2097@sunbay.com> Date: Wed, 27 Jun 2001 14:09:58 -0600 From: Warner Losh 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 In message <20010627124009.D12739@Odin.AC.HMC.Edu> Brooks Davis writes: : On Wed, Jun 27, 2001 at 11:12:00AM +0300, Ruslan Ermilov wrote: : > Please don't use hard sentence breaks. : : I'm, not sure what you mean by this. Do you mean, don't use ". " or : what? I've moved to split sentences by lines. He means to split the sentences by lines. They should look like this in the *roff source. It sounds like you did the right thing. They should not look like how one would normally write them. That causes *roff to mostly do the right thing, but sometimes the wrong thing. A paragraph like this one that looks good to read would cause minor problems for *roff. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 17:51:34 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id E0C9E37B403 for ; Wed, 27 Jun 2001 17:51:11 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f5S0ntp31270; Wed, 27 Jun 2001 20:49:55 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: Date: Wed, 27 Jun 2001 20:49:52 -0400 To: freebsd-print@bostonradio.org From: Garance A Drosihn Subject: Initial ctlinfo, for checking incoming jobs to lpd Cc: freebsd-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 The following patch would add a new source file to lpr/common_source, called ctlinfo.c. While I have several plans for ctlinfo.c, this first cut just replaces calls to link & unlink in lpd/recvjob.c with a call to a new routine which does a whole bunch of work. The basic goal here is to sanity and safety-check all the lines in an incoming 'control file' ("cf*") for jobs coming into lpd from remote hosts. Once we can clean up problems when receiving those jobs, there are other things we can do with less fear of causing security or processing problems. For instance, we can finally fix 'lpr -s -r' processing for real (pr bin/5031). I know Garrett is out-of-town/vacationing for awhile, so I don't intend to commit this right away. I also intend to do some more extensive testing of this at RPI (where I can keep an eye on it) before committing. I'm sure I'll be making some minor adjustments to the code based on that testing, but I wanted to get this general idea out there in case others had the time to look it over and comment on it. Note that this attempts to make up and cover a multitude of sins in OTHER implementations of lpr, which makes some of the code a little tricky to test. I mean, you need a BROKEN lpr to send the kind of control files that this is trying to fix... :-) Of particular note, this does NOT remove any of the temporary control files (which exist while receiving a job), because I want to be able to test what my fancy control-file-rewriting routine is doing. So, you wouldn't want to put THIS in production, unless you were going to run 'lpc clean all' once a week or so. Either that, or un-comment the two 'unlink()' calls at the end of the ctl_renametf routine. This is the first time I've written a whole new source file, so I've also tossed in a "copyright section" which seemed about right, but I'm certainly interested in any comments on that too. I expect to be making and committing other "less interesting" patches before committing this, but after this is committed then I can start bringing in some of the more interesting changes that I had been babbling about back before I got my committer bit for working on lpr/lpd. Anyway, here's the patch: - - - - - - - - - - - - Index: common_source/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/lpr/common_source/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- common_source/Makefile 1999/08/28 01:16:47 1.5 +++ common_source/Makefile 2001/06/28 00:22:01 @@ -6,8 +6,8 @@ # but the library makes it much easier to modularize them. # LIB= lpr -SRCS= common.c displayq.c net.c printcap.c request.c rmjob.c \ - startdaemon.c +SRCS= common.c ctlinfo.c displayq.c net.c printcap.c request.c \ + rmjob.c startdaemon.c NOMAN= noman NOPROFILE= noprofile NOPIC= nopic Index: common_source/ctlinfo.c =================================================================== RCS file: ctlinfo.c diff -N ctlinfo.c --- /dev/null Wed Jun 27 16:16:50 2001 +++ ctlinfo.c Wed Jun 27 17:22:01 2001 @@ -0,0 +1,590 @@ +/* + * ------+---------+---------+---------+---------+---------+---------+---------* + * Copyright (c) 2001 - Garance Alistair Drosehn . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation + * are those of the authors and should not be interpreted as representing + * official policies, either expressed or implied, of the FreeBSD Project. + * + * ------+---------+---------+---------+---------+---------+---------+---------* + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) + +/* + * This has to be large enough to fit the maximum length of a single line + * in a control-file, including the leading 'command id', a trailing '\n' + * and ending '\0'. The max size of an 'U'nlink line, for instance, is + * 1 ('U') + PATH_MAX (filename) + 2 ('\n\0'). The maximum 'H'ost line is + * 1 ('H') + NI_MAXHOST (remote hostname) + 2 ('\n\0'). Other lines can be + * even longer than those. So, pick some nice, large, arbitrary value. + */ +#define CTI_LINEMAX PATH_MAX+NI_MAXHOST+5 + +/* + * ctlinfo - This collection of routines will know everything there is to + * know about the information inside a control file ('cf*') which is used + * to describe a print job in lpr & friends. The eventual goal is that it + * will be the ONLY source file to know what's inside these control-files. + */ + +struct cjobinfo { + int cji_dfcount; /* number of data files to print */ + int cji_uncount; /* number of unlink-file requests */ + char *cji_class; /* class-name */ + char *cji_fname; /* filename of the control file */ + char *cji_jobname; /* job-name (for banner) */ + char *cji_mailto; /* userid to send email to (or null) */ + char *cji_orighost; /* host-of-origin for this job */ + char *cji_origuser; /* userid who sent the job (ie, person + * who would be charged for it) */ + char *cji_username; /* "literal" user-name (for banner) or + * NULL if no banner-page is wanted */ +}; +struct cjprivate { + struct cjobinfo pub; + char *cji_buff; /* buffer for getline */ + char *cji_eobuff; /* end of initial malloc'ed area */ + off_t cji_firstdf; /* where the first datafile is listed */ + FILE *cji_fstream; +}; + +extern const char *from_host; /* client's machine name */ +extern const char *from_ip; /* client machine's IP address */ + +__BEGIN_DECLS +void ctl_freeinf(struct cjobinfo *_cjinf); +static char *ctl_getline(struct cjobinfo *_cjinf); +struct cjobinfo *ctl_readcf(const char *_ptrname, const char *_cfname); +void ctl_renametf(const char *_ptrname, const char *_tfname); +static void ctl_rewindcf(struct cjobinfo *_cjinf); +void ctl_rmjob(const char *_cfname); +__END_DECLS + +/* + * Control-files (cf*) have the following format. + * + * Each control-file describes a single job. It will list one or more + * "datafiles" (df*) which should be copied to some printer. Usually + * there is only one datafile per job. For the curious, RFC 1179 is an + * informal and out-of-date description of lpr/lpd circa 1990. + * + * Each line in the file gives an attribute of the job as a whole, or one + * of the datafiles in the job, or a "command" indicating something to do + * with one of the datafiles. Each line starts with an 'id' that indicates + * what that line is there for. The 'id' is historically a single byte, + * but may be multiple bytes (obviously it would be best if multi-byte ids + * started with some letter not already used as a single-byte id!). + * After the 'id', the remainder of the line will be the value of the + * indicated attribute, or a name of the datafile to be operated on. + * + * In the following lists of ids, the ids with a '!' in front of them are + * NOT explicitly supported by this version of lpd, or at least "not yet + * supported". They are only listed for reference purposes, so people + * won't be tempted to reuse the same id for a different purpose. + * + * The following are attributes of the job which should not appear more + * than once in a control file. Only the 'H' and 'P' lines are required + * by the RFC, but some implementations of lpr won't even get that right. + * + * ! A - [used by lprNG] + * B - As far as I know, this is never used as a single-byte id. + * Therefore, I intend to use it for multi-byte id codes. + * C - "class name" to display on banner page (this is sometimes + * used to hold options for print filters) + * ! D - [in lprNG, "timestamp" of when the job was submitted] + * ! E - "environment variables" to set [some versions of linux] + * H - "host name" of machine where the original 'lpr' was done + * I - "indent", the amount to indent output + * J - "job name" to display on banner page + * L - "literal" user's name as it should be displayed on the + * banner page (it is the existence of an 'L' line which + * indicates that a job should have a banner page). + * M - "mail", userid to mail to when done printing (with email + * going to 'M'@'H', so to speak). + * P - "person", the user's login name (e.g. for accounting) + * ! Q - [used by lprNG for queue-name] + * R - "resolution" in dpi, for some laser printer queues + * T - "title" for files sent thru 'pr' + * W - "width" to use for printing plain-text files + * Z - In BSD, "locale" to use for datafiles sent thru 'pr'. + * (this BSD usage should move to a different id...) + * [in lprNG - this line holds the "Z options"] + * 1 - "R font file" for files sent thru troff + * 2 - "I font file" for files sent thru troff + * 3 - "B font file" for files sent thru troff + * 4 - "S font file" for files sent thru troff + * + * The following are attributes attached to a datafile, and thus may + * appear multiple times in a control file (once per datafile): + * + * N - "name" of file (for display purposes, used by 'lpq') + * S - "stat() info" used for symbolic link ('lpr -s') + * security checks. + * + * The following indicate actions to take on a given datafile. The same + * datafile may appear on more than one "print this file" command in the + * control file. Note that ALL ids with lowercase letters are commands + * to "print this file": + * + * f - "file name", a plain-text file to print + * l - "file name", text file with control chars to print (some + * printers recognize this id as a request to print a + * postscript file) + * p - "file name", text file to print with pr(1) + * t - "file name", troff(1) file to print + * n - "file name", ditroff(1) file to print + * d - "file name", dvi file to print + * g - "file name", plot(1G) file to print + * v - "file name", plain raster file to print + * c - "file name", cifplot file to print + * + * U - "file name" of datafile to unlink (ie, remove file + * from spool directory. To be done in a 'Pass 2', + * AFTER having processed all datafiles in the job). + * + */ + +void +ctl_freeinf(struct cjobinfo *cjinf) +{ +#define FREESTR(xStr) \ + if (xStr != NULL) { \ + free(xStr); \ + xStr = NULL;\ + } + + struct cjprivate *cpriv; + + if (cjinf == NULL) + return; + + cpriv = (struct cjprivate *)cjinf; + + FREESTR(cpriv->pub.cji_class); + /* [cpriv->pub.cji_fname is part of cpriv-malloced area] */ + FREESTR(cpriv->pub.cji_jobname); + FREESTR(cpriv->pub.cji_mailto); + FREESTR(cpriv->pub.cji_orighost); + FREESTR(cpriv->pub.cji_origuser); + FREESTR(cpriv->pub.cji_username); + + if (cpriv->cji_fstream != NULL) { + fclose(cpriv->cji_fstream); + cpriv->cji_fstream = NULL; + } + + free(cpriv); +#undef FREESTR +} + +struct cjobinfo * +ctl_readcf(const char *ptrname, const char *cfname) +{ + int id; + char *lbuff; + FILE *cfile; + struct cjprivate *cpriv; + size_t msize, sroom, sroom2; + + cfile = fopen(cfname, "r"); + if (cfile == NULL) { + syslog(LOG_ERR, "%s: ctl_readcf error open(%s): %s", + ptrname, cfname, strerror(errno)); + return NULL; + } + + sroom = roundup(sizeof(struct cjprivate), 8); + sroom2 = sroom + strlen(cfname) + 1; + sroom2 = roundup(sroom2, 8); + msize = sroom2 + CTI_LINEMAX; + msize = roundup(msize, 8); + cpriv = (struct cjprivate *)malloc(msize); + if (cpriv == NULL) + return NULL; + memset(cpriv, 0, msize); + + cpriv->pub.cji_fname = (char *)(cpriv + sroom); + strcpy(cpriv->pub.cji_fname, cfname); + cpriv->cji_buff = (char *)(cpriv + sroom2); + cpriv->cji_eobuff = (char *)(cpriv + msize - 1); + + cpriv->cji_fstream = cfile; + + /* + * Copy job-attribute values from control file to the struct of + * "public" information. In some cases, it is invalid for the + * value to be a null-string, so that is ignored. + */ + while ((lbuff = ctl_getline(&(cpriv->pub)))) { + id = *lbuff++; + switch (id) { + case 'C': + cpriv->pub.cji_class = strdup(lbuff); + break; + case 'H': + if (*lbuff == '\0') + break; + cpriv->pub.cji_orighost = strdup(lbuff); + break; + case 'J': + cpriv->pub.cji_jobname = strdup(lbuff); + break; + case 'L': + cpriv->pub.cji_username = strdup(lbuff); + break; + case 'M': + /* + * No valid mail-to address would start with a minus. + * If this one does, it is probably some trickster who + * is trying to trigger options on sendmail. Ignore. + */ + if (*lbuff == '-') + break; + if (*lbuff == '\0') + break; + cpriv->pub.cji_mailto = strdup(lbuff); + break; + case 'P': + /* don't allow userid's with a leading minus, either */ + if (*lbuff == '-') + break; + if (*lbuff == '\0') + break; + cpriv->pub.cji_origuser = strdup(lbuff); + break; + default: + if (islower(id)) { + cpriv->pub.cji_dfcount++; + } + break; + } + } + + /* the 'H'ost and 'P'erson fields are *always* supposed to be there */ + if (cpriv->pub.cji_orighost == NULL) + cpriv->pub.cji_orighost = strdup(".na."); + if (cpriv->pub.cji_origuser == NULL) + cpriv->pub.cji_origuser = strdup(".na."); + + return &(cpriv->pub); +} + +/* + * This routine renames the temporary control file as received from some + * other (remote) host. That file will always start with 'tfA*', because + * that's the name it is created with in recvjob.c. This will rewrite + * the file to 'tfB*' (correcting any lines which need correcting), rename + * 'tfB*' to 'cfA*', and then remove the original 'tfA*' file. + * + * The purpose of this routine is to be a little paranoid about the contents + * of that control file. It is partially meant to protect against people + * TRYING to cause trouble (perhaps after breaking into root of some host + * that this host will accept print jobs from). The fact that we're willing + * to print jobs from some remote host does not mean that we should blindly + * do anything that host tells us to do. + * + * This is also meant to protect us from errors in other implementations of + * lpr, particularly since we may want to use some values from the control + * file as environment variables when it comes time to print, or as parameters + * to commands which will be exec'ed, or values in statistics records. + * + * This may also do some "conversions" between how different versions of + * lpr or lprNG define the contents of various lines in a control file. + */ +void +ctl_renametf(const char *ptrname, const char *tfname) +{ + int res, nogood; + FILE *newcf; + struct cjobinfo *cjinf; + char *lbuff, *slash, *cp; + char tfname2[NAME_MAX+1], cfname2[NAME_MAX+1]; + + if (strncmp(tfname, "tfA", 3) != 0) { + syslog(LOG_ERR, "%s: ctl_renametf invalid filename: %s", + ptrname, tfname); + return; + } + + cjinf = ctl_readcf(ptrname, tfname); + if (cjinf == NULL) + return; /* error msg already printed */ + + strlcpy(tfname2, tfname, sizeof(tfname2)); + tfname2[2] = 'B'; /* tfB */ + newcf = fopen(tfname2, "w"); + if (newcf == NULL) { + syslog(LOG_ERR, "%s: ctl_renametf error open(%s): %s", + ptrname, tfname2, strerror(errno)); + goto error_ret; + } + + /* + * Do extra sanity checks on some key job-attribute fields, and + * write them out first (thus making sure they are written in the + * order we generally expect them to be in). + */ + /* + * Some lpr implementations on PC's set a null-string for their + * hostname. A MacOS 10 system which has not correctly setup + * /etc/hostconfig will claim a hostname of 'localhost'. Anything + * with blanks in it would be an invalid value for hostname. For + * any of these invalid hostname values, replace the given value + * with the name of the host that this job is coming from. + */ + nogood = 0; + if (cjinf->cji_orighost == NULL) + nogood = 1; + else if (strcmp(cjinf->cji_orighost, ".na.") == NULL) + nogood = 1; + else if (strcmp(cjinf->cji_orighost, "localhost") == NULL) + nogood = 1; + else { + for (cp = cjinf->cji_orighost; *cp != '\0'; cp++) { + if (*cp <= ' ') { + nogood = 1; + break; + } + } + } + if (nogood) + fprintf(newcf, "H%s\n", from_host); + else + fprintf(newcf, "H%s\n", cjinf->cji_orighost); + + /* + * Now do some sanity checks on the 'P' (original userid) value. Note + * that the 'P'erson line is the second one which is ALWAYS supposed + * to be present in a control file. + * + * There is no particularly good value to use for replacements, but + * at least make sure the value is something reasonable to use in + * environment variables and statistics records. Again, some PC + * implementations send a null-string for a value. Various Mac + * implementations will set whatever string the user has set for + * their 'Owner Name', which usually includes blanks, etc. + */ + nogood = 0; + if (cjinf->cji_origuser == NULL) + nogood = 1; + else { + for (cp = cjinf->cji_origuser; *cp != '\0'; cp++) { + if (*cp <= ' ') + *cp = '_'; + } + } + if (nogood) + fprintf(newcf, "P%s\n", ".na."); + else + fprintf(newcf, "P%s\n", cjinf->cji_origuser); + + /* No need for sanity checks on class, jobname, "literal" user. */ + if (cjinf->cji_class != NULL) + fprintf(newcf, "C%s\n", cjinf->cji_class); + if (cjinf->cji_jobname != NULL) + fprintf(newcf, "J%s\n", cjinf->cji_jobname); + if (cjinf->cji_username != NULL) + fprintf(newcf, "L%s\n", cjinf->cji_username); + + /* should probably add more sanity checks on mailto value */ + nogood = 0; + if (cjinf->cji_mailto == NULL) + nogood = 1; + else { + for (cp = cjinf->cji_origuser; *cp != '\0'; cp++) { + if (*cp <= ' ') { + nogood = 1; + break; + } + } + } + if (!nogood) + fprintf(newcf, "M%s\n", cjinf->cji_mailto); + + /* + * Now go thru the old control file, copying all information which + * hasn't already been written into the new file. + */ + ctl_rewindcf(cjinf); + while ((lbuff = ctl_getline(cjinf))) { + switch (lbuff[0]) { + case 'H': + case 'P': + case 'C': + case 'J': + case 'L': + case 'M': + /* already wrote values for these to the newcf */ + break; + case 'N': + /* see comments under 'U'... */ + if (cjinf->cji_dfcount == 0) { + /* in this case, 'N's will be done in 'U' */ + break; + } + fprintf(newcf, "%s\n", lbuff); + break; + case 'U': + /* + * check for the very common case where the remote + * host had to process 'lpr -s -r', but it did not + * remove the Unlink line from the control file. + * Such Unlink lines will legitimately have a '/' in + * them, but it is the original lpr host which would + * have done the unlink of such files, and not any + * host receiving that job. + */ + slash = strchr(lbuff, '/'); + if (slash != NULL) { + break; /* skip this line */ + } + /* + * Okay, another kind of broken lpr implementation + * is one which send datafiles, and Unlink's those + * datafiles, but never includes any PRINT request + * for those files. Experimentation shows that one + * copy of those datafiles should be printed with a + * format of 'f'. If this is an example of such a + * screwed-up control file, fix it here. + */ + if (cjinf->cji_dfcount == 0) { + lbuff++; + if (strncmp(lbuff, "df", 2) == 0) { + fprintf(newcf, "f%s\n", lbuff); + fprintf(newcf, "U%s\n", lbuff); + fprintf(newcf, "N%s\n", lbuff); + } + break; + } + fprintf(newcf, "%s\n", lbuff); + break; + default: + fprintf(newcf, "%s\n", lbuff); + break; + } + } + + ctl_freeinf(cjinf); + cjinf = NULL; + res = fclose(newcf); + if (newcf == NULL) { + syslog(LOG_ERR, "%s: ctl_renametf error fclose(%s): %s", + ptrname, tfname2, strerror(errno)); + goto error_ret; + } + + strlcpy(cfname2, tfname, sizeof(cfname2)); + cfname2[0] = 'c'; /* rename new file to 'cfA*' */ + res = link(tfname2, cfname2); + if (res != 0) { + syslog(LOG_ERR, "%s: ctl_renametf error link(%s,%s): %s", + ptrname, tfname2, cfname2, strerror(errno)); + goto error_ret; + } + /* not yet + unlink(tfname); + unlink(tfname2); + */ + + return; + +error_ret: + if (cjinf != NULL) + ctl_freeinf(cjinf); + if (newcf != NULL) + fclose(newcf); +} + +void +ctl_rmjob(const char *cfname __unused) +{ + +} + +/* + * Editorial note: + * I have no idea why the original getline() routine was expanding tabs + * when reading in control file lines, but it has always been implemented + * that way. Perhaps for the benefit of class, jobname, and "literal-user" + * fields, but it seems pretty stupid to me (particularly for most of other + * fields, like datafile names!). This routine could be much simpler if + * it did not look to expand tabs, but I'll leave it this way for the sake + * of compatibility and because I don't know what depends on it. + */ +static char * +ctl_getline(struct cjobinfo *cjinf) +{ + FILE *cfile; + int c, linel; + char *bp, *endp; + struct cjprivate *cpriv; + + cpriv = (struct cjprivate *)cjinf; + cfile = cpriv->cji_fstream; + bp = cpriv->cji_buff; + endp = cpriv->cji_eobuff; + /* XXX - should add safety checks on values for cjinf & cji_buff */ + + linel = 0; + while ((c = getc(cfile)) != '\n' && bp < endp) { + if (c == EOF) + return NULL; + if (c == '\t') { + do { + *bp++ = ' '; + linel++; + } while ((linel & 07) != 0 && bp < endp); + continue; + } + *bp++ = c; + linel++; + } + *bp++ = '\0'; + return cpriv->cji_buff; +} + +void +ctl_rewindcf(struct cjobinfo *cjinf) +{ + struct cjprivate *cpriv; + + cpriv = (struct cjprivate *)cjinf; + /* XXX - should add safety check on value for cjinf */ + + rewind(cpriv->cji_fstream); /* assume no errors... :-) */ +} Index: common_source/lp.h =================================================================== RCS file: /home/ncvs/src/usr.sbin/lpr/common_source/lp.h,v retrieving revision 1.17 diff -u -r1.17 lp.h --- common_source/lp.h 2001/06/15 22:03:02 1.17 +++ common_source/lp.h 2001/06/28 00:22:01 @@ -267,6 +267,7 @@ char *pcaperr(int _error); void prank(int _n); void process(const struct printer *_pp, char *_file); +void ctl_renametf(const char *_ptrname, const char *_tfname); void rmjob(const char *_printer); void rmremote(const struct printer *_pp); void setprintcap(char *_newfile); Index: lpd/recvjob.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/lpr/lpd/recvjob.c,v retrieving revision 1.20 diff -u -r1.20 recvjob.c --- lpd/recvjob.c 2001/06/15 22:03:04 1.20 +++ lpd/recvjob.c 2001/06/28 00:22:01 @@ -203,9 +203,8 @@ rcleanup(0); continue; } - if (link(tfname, cp) < 0) - frecverr("%s: %m", tfname); - (void) unlink(tfname); + /* XXX - no error indication, thus no abort on error */ + ctl_renametf(pp->printer, tfname); tfname[0] = '\0'; cfcnt++; continue; -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 18:26:50 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 937B837B401 for ; Wed, 27 Jun 2001 18:26:44 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 392973E2F; Wed, 27 Jun 2001 18:26:44 -0700 (PDT) To: Bruce Evans Cc: audit@FreeBSD.ORG Subject: Re: Patch to fix `pstat -tn` In-Reply-To: ; from bde@zeta.org.au on "Sun, 17 Jun 2001 20:01:36 +1000 (EST)" Date: Wed, 27 Jun 2001 18:26:44 -0700 From: Dima Dorfman Message-Id: <20010628012644.392973E2F@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 Bruce Evans writes: > On Sat, 16 Jun 2001, Dima Dorfman wrote: > > > The attached patch fixes `pstat -tn` to do what the man page says it > > should do, rather than just print '0'. I'm not sure when this was > > broken (or if it ever worked at all), but the fix is relatively > > simple. Please review. > > Lots was broken when pstat was converted to use the kern.ttys sysctl. > pstat -nt still works for ttys not returned by this sysctl. OTOH, > pstat -t is more broken for these ttys. [ snip descriptions of other cases where pstat -tn does the wrong thing ] > > > Index: pstat.c > > =================================================================== > > RCS file: /home/ncvs/src/usr.sbin/pstat/pstat.c,v > > retrieving revision 1.58 > > diff -u -c -r1.58 pstat.c > > *** pstat.c 2001/06/17 02:01:43 1.58 > > --- pstat.c 2001/06/17 02:10:19 > > *************** > > *** 854,864 **** > > int i, j; > > pid_t pgid; > > char *name, state[20]; > > > > if (usenumflag || tp->t_dev == 0 || > > ! (name = devname(tp->t_dev, S_IFCHR)) == NULL) > > ! (void)printf("%7d ", line); > > ! else > > (void)printf("%7s ", name); > > (void)printf("%2d %3d ", tp->t_rawq.c_cc, tp->t_canq.c_cc); > > (void)printf("%3d %5d %5d %4d %3d %7d ", tp->t_outq.c_cc, > > --- 854,869 ---- > > int i, j; > > pid_t pgid; > > char *name, state[20]; > > + char *tb; > > > > if (usenumflag || tp->t_dev == 0 || > > ! (name = devname(tp->t_dev, S_IFCHR)) == NULL) { > > ! i = asprintf(&tb, "%d,%d", major(tp->t_dev), minor(tp->t_dev)); > > ! if (i == -1) > > ! err(1, "asprintf"); > > ! (void)printf("%7s ", tb); > > ! free(tb); > > ! } else > > (void)printf("%7s ", name); > > (void)printf("%2d %3d ", tp->t_rawq.c_cc, tp->t_canq.c_cc); > > (void)printf("%3d %5d %5d %4d %3d %7d ", tp->t_outq.c_cc, > > I think the correct fix is just to pass the correct value for `line' > to ttyprt(). This is already done in the non-broken case (calls from > ttytype()). This is not so easy for the calls from ttymode(), since > the sysctl has lost the natural boundaries between the drivers. It seems that doing this would at least involve changing the sysctl, and I'm not sure how to do it even then. I think printing the major/minor number, as documented, is at the very least better than what we have now. The attached patch does essentially the same thing as the old one, but addressed your comments about consistency and asprintf. Suggestions? Dima Dorfman dima@unixfreak.org > > I don't like the patch for other reasons. Using asprintf() is overkill, > and the format is inconsistent. All other places in pstat.c use > " %2d,%-2d". This at least lines up the major/minor split point (the > comma) for small major/minor numbers. It misprints negative minor > numbers, but not as horribly as devname(). Large and negative minor > numbers should be printed in hex format, something like ls(1) does it. > > Note that when the major and/or minor numbers are large, all the formats > may take more than 7 characters and asprintf()'ing first doesn't help > much (unless %7.7s format is used to truncate the names). > > Bruce > Index: pstat.c =================================================================== RCS file: /stl/src/FreeBSD/src/usr.sbin/pstat/pstat.c,v retrieving revision 1.58 diff -u -r1.58 pstat.c --- pstat.c 2001/06/17 02:01:43 1.58 +++ pstat.c 2001/06/28 01:25:45 @@ -856,9 +856,10 @@ char *name, state[20]; if (usenumflag || tp->t_dev == 0 || - (name = devname(tp->t_dev, S_IFCHR)) == NULL) - (void)printf("%7d ", line); - else + (name = devname(tp->t_dev, S_IFCHR)) == NULL) { + (void)printf(" %2d,%-2d", + major(tp->t_dev), minor(tp->t_dev)); + } else (void)printf("%7s ", name); (void)printf("%2d %3d ", tp->t_rawq.c_cc, tp->t_canq.c_cc); (void)printf("%3d %5d %5d %4d %3d %7d ", tp->t_outq.c_cc, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 23: 0:36 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 20FBE37B403; Wed, 27 Jun 2001 23:00:20 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id C14C13E32; Wed, 27 Jun 2001 23:00:19 -0700 (PDT) To: audit@freebsd.org Cc: peter@freebsd.org Subject: config(8) 'include' patch Date: Wed, 27 Jun 2001 23:00:19 -0700 From: Dima Dorfman Message-Id: <20010628060019.C14C13E32@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 The attached patch, mostly ported from OpenBSD, adds an 'include' directive to config(8). As discussed on -hackers, this can be used to split up kernel config files into a machine-dependent and machine-independent parts. In relation to this, some people also asked for unoption/undevice directives; it looks like those would be easy to implement, but I'd like to commit this first since these changes ('include' vs. 'unoption') are technically unrelated. Please review and comment. Thanks, Dima Dorfman dima@unixfreak.org Index: config.h =================================================================== RCS file: /stl/src/FreeBSD/src/usr.sbin/config/config.h,v retrieving revision 1.48 diff -u -r1.48 config.h --- config.h 2001/02/28 02:55:15 1.48 +++ config.h 2001/06/28 05:51:11 @@ -142,6 +142,7 @@ extern char errbuf[80]; extern int yyline; +extern const char *yyfile; extern struct file_list *ftab; Index: config.y =================================================================== RCS file: /stl/src/FreeBSD/src/usr.sbin/config/config.y,v retrieving revision 1.54 diff -u -r1.54 config.y --- config.y 2001/02/22 04:00:29 1.54 +++ config.y 2001/06/28 05:51:11 @@ -17,6 +17,7 @@ %token OPTIONS %token MAKEOPTIONS %token SEMICOLON +%token INCLUDE %token ID %token NUMBER @@ -77,14 +78,15 @@ char *hints; int hintmode; int yyline; +const char *yyfile; struct file_list *ftab; char errbuf[80]; int maxusers; #define ns(s) strdup(s) +int include(const char *, int); +void yyerror(const char *s); -static void yyerror(const char *s); - static char * devopt(char *dev) { @@ -147,11 +149,14 @@ = { hints = $2; hintmode = 1; - }; + } | + INCLUDE ID + = { include($2, 0); }; System_spec: CONFIG System_id System_parameter_list - = { errx(1, "line %d: root/dump/swap specifications obsolete", yyline);} + = { errx(1, "%s:%d: root/dump/swap specifications obsolete", + yyfile, yyline);} | CONFIG System_id ; @@ -178,7 +183,8 @@ newopt(&opt, $1, NULL); if ((s = strchr($1, '='))) - errx(1, "line %d: The `=' in options should not be quoted", yyline); + errx(1, "%s:%d: The `=' in options should not be " + "quoted", yyfile, yyline); } | Save_id EQUALS Opt_value = { @@ -229,16 +235,17 @@ /* and the device part */ newdev($2, $3); if ($3 == 0) - errx(1, "line %d: devices with zero units are not likely to be correct", yyline); + errx(1, "%s:%d: devices with zero units are not " + "likely to be correct", yyfile, yyline); } ; %% -static void +void yyerror(const char *s) { - errx(1, "line %d: %s", yyline + 1, s); + errx(1, "%s:%d: %s", yyfile, yyline + 1, s); } /* Index: lang.l =================================================================== RCS file: /stl/src/FreeBSD/src/usr.sbin/config/lang.l,v retrieving revision 1.30 diff -u -r1.30 lang.l --- lang.l 2001/02/19 04:43:21 1.30 +++ lang.l 2001/06/28 05:51:11 @@ -35,6 +35,7 @@ * $FreeBSD: src/usr.sbin/config/lang.l,v 1.30 2001/02/19 04:43:21 peter Exp $ */ +#include #include #include #include "y.tab.h" @@ -43,6 +44,19 @@ #define YY_NO_UNPUT /* + * Data for returning to previous files from include files. + */ +struct incl { + struct incl *in_prev; /* previous includes in effect, if any */ + YY_BUFFER_STATE in_buf; /* previous lex state */ + const char *in_fname; /* previous file name */ + int in_lineno; /* previous line number */ + int in_ateof; /* token to insert at EOF */ +}; +static struct incl *inclp; +static const char *lastfile; + +/* * Key word table */ @@ -61,13 +75,17 @@ { "profile", PROFILE }, { "option", OPTIONS }, { "options", OPTIONS }, + { "include", INCLUDE }, { 0, 0 }, }; +static int endinclude(void); +int include(const char *, int); int kw_lookup(char *); int octal(char *); int hex(char *); +int yyerror(const char *); %} WORD [A-Za-z_][-A-Za-z_]* @@ -145,6 +163,16 @@ ";" { return SEMICOLON; } "," { return COMMA; } "=" { BEGIN TOEOL; return EQUALS; } +<> { + int tok; + + if (inclp == NULL) + return YY_NULL; + tok = endinclude(); + if (tok != 0) + return tok; + /* otherwise continue scanning */ + } . { return yytext[0]; } %% @@ -185,4 +213,61 @@ (void) sscanf(str+2, "%x", &num); return num; +} + + +/* + * Open the named file for inclusion at the current point. Returns 0 on + * success (file opened and previous state pushed), nonzero on failure + * (fopen failed, complaint made). The `ateof' parameter controls the + * token to be inserted at the end of the include file. If ateof == 0, + * then nothing is inserted. + */ +int +include(const char *fname, int ateof) +{ + FILE *fp; + struct incl *in; + + fp = fopen(fname, "r"); + if (fp == NULL) { + yyerror("cannot open file"); + return (-1); + } + in = malloc(sizeof(*in)); + assert(in != NULL); + in->in_prev = inclp; + in->in_buf = YY_CURRENT_BUFFER; + in->in_fname = yyfile; + in->in_lineno = yyline; + in->in_ateof = ateof; + inclp = in; + yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE)); + yyfile = fname; + yyline = 0; + return (0); +} + +/* + * Terminate the most recent inclusion. + */ +static int +endinclude() +{ + struct incl *in; + int ateof; + + in = inclp; + assert(in != NULL); + inclp = in->in_prev; + lastfile = yyfile; + yy_delete_buffer(YY_CURRENT_BUFFER); + (void)fclose(yyin); + yy_switch_to_buffer(in->in_buf); + yyfile = in->in_fname; + yyline = in->in_lineno; + ateof = in->in_ateof; + free(in); + + return (ateof); } Index: main.c =================================================================== RCS file: /stl/src/FreeBSD/src/usr.sbin/config/main.c,v retrieving revision 1.50 diff -u -r1.50 main.c --- main.c 2001/02/23 00:22:04 1.50 +++ main.c 2001/06/28 05:51:11 @@ -144,6 +144,7 @@ errx(2, "%s isn't a directory", p); dtab = NULL; + yyfile = *argv; if (yyparse()) exit(3); if (machinename == NULL) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Jun 27 23: 2:52 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 790F737B403; Wed, 27 Jun 2001 23:02:50 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.1) with ESMTP id f5S62jU00236; Thu, 28 Jun 2001 00:02:45 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106280602.f5S62jU00236@harmony.village.org> To: Dima Dorfman Subject: Re: config(8) 'include' patch Cc: audit@FreeBSD.ORG, peter@FreeBSD.ORG In-reply-to: Your message of "Wed, 27 Jun 2001 23:00:19 PDT." <20010628060019.C14C13E32@bazooka.unixfreak.org> References: <20010628060019.C14C13E32@bazooka.unixfreak.org> Date: Thu, 28 Jun 2001 00:02:45 -0600 From: Warner Losh 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 In message <20010628060019.C14C13E32@bazooka.unixfreak.org> Dima Dorfman writes: : The attached patch, mostly ported from OpenBSD, adds an 'include' : directive to config(8). As discussed on -hackers, this can be used to : split up kernel config files into a machine-dependent and : machine-independent parts. In relation to this, some people also : asked for unoption/undevice directives; it looks like those would be : easy to implement, but I'd like to commit this first since these : changes ('include' vs. 'unoption') are technically unrelated. Also, unoption/undevice, etc are new art, while include is prior art in NetBSD and OpenBSD for a long time. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 2:17: 7 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 BF35E37B403 for ; Thu, 28 Jun 2001 02:17:03 -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 NHPRV2GL; Thu, 28 Jun 2001 13:12:15 +0400 Received: (from yar@localhost) by comp.chem.msu.su (8.11.1/8.11.1) id f5S9Gr747727 for audit@freebsd.org; Thu, 28 Jun 2001 13:16:53 +0400 (MSD) (envelope-from yar) Date: Thu, 28 Jun 2001 13:16:53 +0400 From: Yar Tikhiy To: audit@freebsd.org Subject: mkdir(1) on "-p" Message-ID: <20010628131652.A46436@comp.chem.msu.su> 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 there, The FreeBSD mkdir(1) manpage appears not to say a single word on what happens if the "-p" option is specified to mkdir and a final directory exists. The fix follows. Please review it for possible grammar/style slips. -- Yar Index: mkdir.1 =================================================================== RCS file: /home/ncvs/src/bin/mkdir/mkdir.1,v retrieving revision 1.13 diff -u -r1.13 mkdir.1 --- mkdir.1 2000/11/20 11:39:38 1.13 +++ mkdir.1 2001/06/27 17:50:13 @@ -73,6 +73,8 @@ Create intermediate directories as required. If this option is not specified, the full path prefix of each operand must already exist. +On the other hand, with this option specified, no error will +be reported if a directory given as an operand already exists. Intermediate directories are created with permission bits of .Li rwxrwxrwx (\&0777) as modified by the current umask, plus write and search @@ -81,7 +83,8 @@ Be verbose when creating directories, listing them as they are created. .El .Pp -The user must have write permission in the parent directory. +The user must have write permission on the parent directory +if a directory needs to be created. .Sh DIAGNOSTICS The .Nm To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 14:52:55 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 5556C37B405; Thu, 28 Jun 2001 14:52:49 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 5D8A93E2F; Thu, 28 Jun 2001 14:52:48 -0700 (PDT) To: Yar Tikhiy Cc: audit@freebsd.org Subject: Re: mkdir(1) on "-p" In-Reply-To: <20010628131652.A46436@comp.chem.msu.su>; from yar@freebsd.org on "Thu, 28 Jun 2001 13:16:53 +0400" Date: Thu, 28 Jun 2001 14:52:48 -0700 From: Dima Dorfman Message-Id: <20010628215248.5D8A93E2F@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 Yar Tikhiy writes: > Hi there, > > The FreeBSD mkdir(1) manpage appears not to say a single word on > what happens if the "-p" option is specified to mkdir and a final > directory exists. The fix follows. Please review it for possible > grammar/style slips. > > -- > Yar > > Index: mkdir.1 > =================================================================== > RCS file: /home/ncvs/src/bin/mkdir/mkdir.1,v > retrieving revision 1.13 > diff -u -r1.13 mkdir.1 > --- mkdir.1 2000/11/20 11:39:38 1.13 > +++ mkdir.1 2001/06/27 17:50:13 > @@ -73,6 +73,8 @@ > Create intermediate directories as required. > If this option is not specified, the full path prefix of each > operand must already exist. > +On the other hand, with this option specified, no error will > +be reported if a directory given as an operand already exists. > Intermediate directories are created with permission bits of > .Li rwxrwxrwx (\&0777) > as modified by the current umask, plus write and search > @@ -81,7 +83,8 @@ > Be verbose when creating directories, listing them as they are created. > .El > .Pp > -The user must have write permission in the parent directory. > +The user must have write permission on the parent directory ^^^^ Perhaps "to" would be better? Other than that, looks okay. Dima Dorfman dima@unixfreak.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 15:16: 7 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 25D6037B407; Thu, 28 Jun 2001 15:15:33 -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.30 #1) id 15Fk4D-0002zV-00; Fri, 29 Jun 2001 00:15:17 +0200 From: Sheldon Hearn To: Dima Dorfman Cc: Yar Tikhiy , audit@freebsd.org Subject: Re: mkdir(1) on "-p" In-reply-to: Your message of "Thu, 28 Jun 2001 14:52:48 MST." <20010628215248.5D8A93E2F@bazooka.unixfreak.org> Date: Fri, 29 Jun 2001 00:15:17 +0200 Message-ID: <11500.993766517@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 Thu, 28 Jun 2001 14:52:48 MST, Dima Dorfman wrote: > > -The user must have write permission in the parent directory. > > +The user must have write permission on the parent directory > ^^^^ > Perhaps "to" would be better? Nothing wrong with on. Mind you, I think we can do without the second hunk altogether. :-) Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 15:48:19 2001 Delivered-To: freebsd-audit@freebsd.org Received: from iatl0x01.coxmail.com (iatl1x01.coxmail.com [206.157.231.23]) by hub.freebsd.org (Postfix) with ESMTP id 2223D37B401 for ; Thu, 28 Jun 2001 15:48:14 -0700 (PDT) (envelope-from mheffner@novacoxmail.com) Received: from enterprise.muriel.penguinpowered.com ([208.138.198.178]) by iatl0x01.coxmail.com (InterMail vK.4.03.02.00 201-232-124 license 85f4f10023be2bd3bce00b3a38363ea2) with ESMTP id <20010628224813.LHWZ1034.iatl0x01@enterprise.muriel.penguinpowered.com>; Thu, 28 Jun 2001 18:48:13 -0400 Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.5.0.FreeBSD:20010628184717:405=_"; micalg=pgp-md5; protocol="application/pgp-signature" In-Reply-To: Date: Thu, 28 Jun 2001 18:47:17 -0400 (EDT) Reply-To: Mike Heffner From: Mike Heffner To: Garance A Drosihn Subject: RE: Initial ctlinfo, for checking incoming jobs to lpd Cc: freebsd-audit@freebsd.org, freebsd-print@bostonradio.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 This message is in MIME format --_=XFMail.1.5.0.FreeBSD:20010628184717:405=_ Content-Type: text/plain; charset=us-ascii On 28-Jun-2001 Garance A Drosihn wrote: | The following patch would add a new source file to lpr/common_source, | called ctlinfo.c. While I have several plans for ctlinfo.c, this first | cut just replaces calls to link & unlink in lpd/recvjob.c with a call | to a new routine which does a whole bunch of work. I'm not too familiar with the code. It's looks pretty good altogether. Here's just a few little things I noticed: | + | +struct cjobinfo * style(9) bug, extra spaces before asterick | +ctl_readcf(const char *ptrname, const char *cfname) | +{ | + int id; | + char *lbuff; | + FILE *cfile; | + struct cjprivate *cpriv; | + size_t msize, sroom, sroom2; | + | + cfile = fopen(cfname, "r"); | + if (cfile == NULL) { | + syslog(LOG_ERR, "%s: ctl_readcf error open(%s): %s", | + ptrname, cfname, strerror(errno)); | + return NULL; | + } should be `return (NULL);' | + | + sroom = roundup(sizeof(struct cjprivate), 8); | + sroom2 = sroom + strlen(cfname) + 1; | + sroom2 = roundup(sroom2, 8); | + msize = sroom2 + CTI_LINEMAX; | + msize = roundup(msize, 8); | + cpriv = (struct cjprivate *)malloc(msize); | + if (cpriv == NULL) | + return NULL; | + memset(cpriv, 0, msize); | + | + cpriv->pub.cji_fname = (char *)(cpriv + sroom); | + strcpy(cpriv->pub.cji_fname, cfname); | + cpriv->cji_buff = (char *)(cpriv + sroom2); | + cpriv->cji_eobuff = (char *)(cpriv + msize - 1); | + | + cpriv->cji_fstream = cfile; | + | + /* | + * Copy job-attribute values from control file to the struct of | + * "public" information. In some cases, it is invalid for the | + * value to be a null-string, so that is ignored. | + */ | + while ((lbuff = ctl_getline(&(cpriv->pub)))) { should test against != NULL. [snip] | + /* | + * Some lpr implementations on PC's set a null-string for their | + * hostname. A MacOS 10 system which has not correctly setup | + * /etc/hostconfig will claim a hostname of 'localhost'. Anything | + * with blanks in it would be an invalid value for hostname. For | + * any of these invalid hostname values, replace the given value | + * with the name of the host that this job is coming from. | + */ | + nogood = 0; | + if (cjinf->cji_orighost == NULL) | + nogood = 1; | + else if (strcmp(cjinf->cji_orighost, ".na.") == NULL) | + nogood = 1; | + else if (strcmp(cjinf->cji_orighost, "localhost") == NULL) | + nogood = 1; strcmp() returns 0 for match [snip] | +++ common_source/lp.h 2001/06/28 00:22:01 | @@ -267,6 +267,7 @@ | char *pcaperr(int _error); | void prank(int _n); | void process(const struct printer *_pp, char *_file); | +void ctl_renametf(const char *_ptrname, const char *_tfname); This should line up. Later, Mike -- Mike Heffner Fredericksburg, VA --_=XFMail.1.5.0.FreeBSD:20010628184717:405=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7O7P0FokZQs3sv5kRAp1HAJ4hZek92fT5zdo+/sdeFRkPCSQLfwCgmGeQ 9GHuuyUMqoMDdmf8Y7HCAe8= =HU12 -----END PGP SIGNATURE----- --_=XFMail.1.5.0.FreeBSD:20010628184717:405=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 16:35:42 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 47F0937B40B for ; Thu, 28 Jun 2001 16:35:38 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f5SNZaM66834; Thu, 28 Jun 2001 19:35:37 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Thu, 28 Jun 2001 19:35:35 -0400 To: Mike Heffner From: Garance A Drosihn Subject: RE: Initial ctlinfo, for checking incoming jobs to lpd Cc: freebsd-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 Thanks for checking thru it. At 6:47 PM -0400 6/28/01, Mike Heffner wrote: >| + >| +struct cjobinfo * > >style(9) bug, extra spaces before asterick Heh. Took me awhile to find this. In the original source it's really a tab character, which only has to move over one spot so it looked like a blank. In the diff-output, it is much more obviously a tab. I have fixed it. >| + while ((lbuff = ctl_getline(&(cpriv->pub)))) { > >should test against != NULL. > >| + else if (strcmp(cjinf->cji_orighost, ".na.") == NULL) >| + nogood = 1; >| + else if (strcmp(cjinf->cji_orighost, "localhost") == NULL) >| + nogood = 1; > >strcmp() returns 0 for match Oops, I thought I had fixed those. I have fixed them now. >| +++ common_source/lp.h 2001/06/28 00:22:01 >| void prank(int _n); >| void process(const struct printer *_pp, char *_file); >| +void ctl_renametf(const char *_ptrname, const char *_tfname); > >This should line up. Odd. In my source file, it DOES line up. It's even got the right tab-space combination, so it isn't a mixup with tabs vs spaces. It seems to line up OK in the message as I sent it, too. I don't know what do say about this one. -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 16:43:15 2001 Delivered-To: freebsd-audit@freebsd.org Received: from kawoserv.kawo2.rwth-aachen.de (kawoserv.kawo2.RWTH-Aachen.DE [134.130.180.1]) by hub.freebsd.org (Postfix) with ESMTP id AAC0C37B40C for ; Thu, 28 Jun 2001 16:43:12 -0700 (PDT) (envelope-from alex@big.endian.de) Received: from zerogravity.kawo2.rwth-aachen.de (zerogravity.kawo2.rwth-aachen.de [134.130.181.28]) by kawoserv.kawo2.rwth-aachen.de (8.9.3/8.9.3) with ESMTP id BAA20440; Fri, 29 Jun 2001 01:43:11 +0200 Received: by zerogravity.kawo2.rwth-aachen.de (Postfix, from userid 1001) id C904014A8E; Fri, 29 Jun 2001 01:43:13 +0200 (CEST) Date: Fri, 29 Jun 2001 01:43:13 +0200 From: Alexander Langer To: Thomas Zenker Cc: audit@FreeBSD.ORG Subject: Re: bin/27029: strptime: %s formatting missing (patch) Message-ID: <20010629014313.A7351@zerogravity.kawo2.rwth-aachen.d> References: <200106250228.f5P2Sik45523@freefall.freebsd.org> <20010625082217.A21418@mezcal.tue.le> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010625082217.A21418@mezcal.tue.le>; from thz@Lennartz-electronic.de on Mon, Jun 25, 2001 at 08:22:17AM +0200 X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8 A8 E3 BA F3 4E 60 7D 7F X-PGP-at: finger alex@big.endian.de X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung. 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 Also sprach Thomas Zenker (thz@Lennartz-electronic.de): [... case 'Z':] Please keep the order. > } > } > break; > + case 's': > + { > + time_t t; > + const char *cp; > + t = strtol(buf, &cp, 10); Is time_t long again on all branches? I think David (obrien) backed it out on -STABLE, IIRC. Please don't forget to back-contribute (see header of strptime.c) Alex To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 16:57: 0 2001 Delivered-To: freebsd-audit@freebsd.org Received: from iatl0x01.coxmail.com (iatl1x01.coxmail.com [206.157.231.23]) by hub.freebsd.org (Postfix) with ESMTP id 78AB337B405 for ; Thu, 28 Jun 2001 16:56:56 -0700 (PDT) (envelope-from mheffner@novacoxmail.com) Received: from enterprise.muriel.penguinpowered.com ([208.138.198.178]) by iatl0x01.coxmail.com (InterMail vK.4.03.02.00 201-232-124 license 85f4f10023be2bd3bce00b3a38363ea2) with ESMTP id <20010628235655.LKVV1034.iatl0x01@enterprise.muriel.penguinpowered.com>; Thu, 28 Jun 2001 19:56:55 -0400 Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.5.0.FreeBSD:20010628195600:405=_"; micalg=pgp-md5; protocol="application/pgp-signature" In-Reply-To: Date: Thu, 28 Jun 2001 19:56:00 -0400 (EDT) Reply-To: Mike Heffner From: Mike Heffner To: Garance A Drosihn Subject: RE: Initial ctlinfo, for checking incoming jobs to lpd Cc: freebsd-audit@FreeBSD.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 This message is in MIME format --_=XFMail.1.5.0.FreeBSD:20010628195600:405=_ Content-Type: text/plain; charset=us-ascii On 28-Jun-2001 Garance A Drosihn wrote: | Thanks for checking thru it. | | At 6:47 PM -0400 6/28/01, Mike Heffner wrote: |>| + |>| +struct cjobinfo * |> |>style(9) bug, extra spaces before asterick | | Heh. Took me awhile to find this. In the original source it's | really a tab character, which only has to move over one spot so | it looked like a blank. In the diff-output, it is much more | obviously a tab. I have fixed it. Yep, sorry. My mail client seems to convert tabs to spaces. I actually meant to include the function name that was right after it. | |>| +++ common_source/lp.h 2001/06/28 00:22:01 |>| void prank(int _n); |>| void process(const struct printer *_pp, char *_file); |>| +void ctl_renametf(const char *_ptrname, const char *_tfname); |> |>This should line up. | | Odd. In my source file, it DOES line up. It's even got the right | tab-space combination, so it isn't a mixup with tabs vs spaces. It | seems to line up OK in the message as I sent it, too. I don't know | what do say about this one. Hrm, guess it was just a weird diff thing...FWIW, in the archive it appears to be missing a space too: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=202291+0+current/freebsd-audit Mike -- Mike Heffner Fredericksburg, VA --_=XFMail.1.5.0.FreeBSD:20010628195600:405=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7O8QPFokZQs3sv5kRAjbhAKCZITNJH5Jb34Ml2M3ZaIinqAjXxgCfRziI vL0JisBLG5lWtc7MAENesBw= =O5lm -----END PGP SIGNATURE----- --_=XFMail.1.5.0.FreeBSD:20010628195600:405=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 16:58:40 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 AC0CD37B40A for ; Thu, 28 Jun 2001 16:58:38 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 23EE83E2F; Thu, 28 Jun 2001 16:58:32 -0700 (PDT) To: Alexander Langer Cc: Thomas Zenker , audit@FreeBSD.ORG Subject: Re: bin/27029: strptime: %s formatting missing (patch) In-Reply-To: <20010629014313.A7351@zerogravity.kawo2.rwth-aachen.d>; from alex@big.endian.de on "Fri, 29 Jun 2001 01:43:13 +0200" Date: Thu, 28 Jun 2001 16:58:32 -0700 From: Dima Dorfman Message-Id: <20010628235832.23EE83E2F@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 Alexander Langer writes: > Also sprach Thomas Zenker (thz@Lennartz-electronic.de): > > [... case 'Z':] > Please keep the order. If you look at that switch, they're already so out of order that it isn't clear where this should go. > > > } > > } > > break; > > + case 's': > > + { > > + time_t t; > > + const char *cp; > > + t = strtol(buf, &cp, 10); > > Is time_t long again on all branches? > I think David (obrien) backed it out on -STABLE, IIRC. IIRC it's an int on most branches, but using strtol is still okay there. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 17:32:42 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 1ABC537B403 for ; Thu, 28 Jun 2001 17:32:40 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f5T0WcM48742; Thu, 28 Jun 2001 20:32:38 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Thu, 28 Jun 2001 20:32:35 -0400 To: Mike Heffner From: Garance A Drosihn Subject: RE: Initial ctlinfo, for checking incoming jobs to lpd Cc: freebsd-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:56 PM -0400 6/28/01, Mike Heffner wrote: >On 28-Jun-2001 Garance A Drosihn wrote: >|>| +++ common_source/lp.h 2001/06/28 00:22:01 >|>| void prank(int _n); >|>| void process(const struct printer *_pp, char *_file); >|>| +void ctl_renametf(const char *_ptrname, const char *_tfname); >|> >|>This should line up. >| >| Odd. In my source file, it DOES line up. It's even got the right >| tab-space combination, so it isn't a mixup with tabs vs spaces. It >| seems to line up OK in the message as I sent it, too. I don't know >| what do say about this one. > >Hrm, guess it was just a weird diff thing...FWIW, in the archive it >appears to be missing a space too: >http://docs.freebsd.org/cgi/getmsg.cgi?fetch=202291+0+current/freebsd-audit It looks like this is a problem with my (beta-version of) mail client. It seems that any line which starts with a blank gets an EXTRA blank tacked on in front of the line. You can see the same behavior up in the makefile change. For instance, in: LIB= lpr -SRCS= common.c displayq.c net.c printcap.c request.c rmjob.c \ the 'LIB=' starts in the same column as 'SRCS=' as I see it here, but you'll probably see the 'L' directly over the 'R'. I'll bug the email developers about that. Thanks. -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 19:34: 2 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 5668137B403 for ; Thu, 28 Jun 2001 19:33:58 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5T2lTs97893; Thu, 28 Jun 2001 22:47:29 -0400 (EDT) (envelope-from mike) Date: Thu, 28 Jun 2001 22:47:29 -0400 (EDT) Message-Id: <200106290247.f5T2lTs97893@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Cc: Dima Dorfman Subject: src/bin warns patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/bin.20010628.patch This patch needs to be tested on an Alpha before committing. This patch has also been tested with -fno-builtin. Best regards, Mike Barcroft ----------------------------------------------------------------------- bin.20010628.patch o Set WARNS?=2 on Makefiles that should have it. o Tested on i386; alpha might have additional warnings. Index: getfacl/Makefile =================================================================== RCS file: /home/ncvs/src/bin/getfacl/Makefile,v retrieving revision 1.4 diff -u -u -r1.4 Makefile --- getfacl/Makefile 2001/04/04 18:20:02 1.4 +++ getfacl/Makefile 2001/06/29 01:16:41 @@ -1,5 +1,6 @@ # $FreeBSD: src/bin/getfacl/Makefile,v 1.4 2001/04/04 18:20:02 tmm Exp $ PROG= getfacl +WARNS?= 2 .include Index: mkdir/Makefile =================================================================== RCS file: /home/ncvs/src/bin/mkdir/Makefile,v retrieving revision 1.5 diff -u -u -r1.5 Makefile --- mkdir/Makefile 1999/08/27 23:14:34 1.5 +++ mkdir/Makefile 2001/06/29 01:16:41 @@ -2,5 +2,6 @@ # $FreeBSD: src/bin/mkdir/Makefile,v 1.5 1999/08/27 23:14:34 peter Exp $ PROG= mkdir +WARNS?= 2 .include Index: mv/Makefile =================================================================== RCS file: /home/ncvs/src/bin/mv/Makefile,v retrieving revision 1.6 diff -u -u -r1.6 Makefile --- mv/Makefile 2000/01/01 15:40:40 1.6 +++ mv/Makefile 2001/06/29 01:16:41 @@ -2,5 +2,6 @@ # $FreeBSD: src/bin/mv/Makefile,v 1.6 2000/01/01 15:40:40 joe Exp $ PROG= mv +WARNS?= 2 .include Index: rm/Makefile =================================================================== RCS file: /home/ncvs/src/bin/rm/Makefile,v retrieving revision 1.13 diff -u -u -r1.13 Makefile --- rm/Makefile 2000/06/17 14:19:32 1.13 +++ rm/Makefile 2001/06/29 01:16:41 @@ -2,6 +2,7 @@ # $FreeBSD: src/bin/rm/Makefile,v 1.13 2000/06/17 14:19:32 joe Exp $ PROG= rm +WARNS?= 2 SRCS= rm.c LINKS= ${BINDIR}/rm ${BINDIR}/unlink To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 19:35:10 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 BF8C537B405 for ; Thu, 28 Jun 2001 19:35:04 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5T2maZ97897; Thu, 28 Jun 2001 22:48:36 -0400 (EDT) (envelope-from mike) Date: Thu, 28 Jun 2001 22:48:36 -0400 (EDT) Message-Id: <200106290248.f5T2maZ97897@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Cc: Dima Dorfman Subject: src/sbin warns patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/sbin.20010628.patch This patch needs to be tested on an Alpha before committing. This patch has also been tested with -fno-builtin. Best regards, Mike Barcroft ----------------------------------------------------------------------- sbin.20010628.patch o Set WARNS?=2 on Makefiles that should have it. o Tested on i386; alpha might have additional warnings. Index: clri/Makefile =================================================================== RCS file: /home/ncvs/src/sbin/clri/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- clri/Makefile 2001/03/26 14:32:58 1.4 +++ clri/Makefile 2001/06/29 02:03:23 @@ -2,6 +2,7 @@ # $FreeBSD: src/sbin/clri/Makefile,v 1.4 2001/03/26 14:32:58 ru Exp $ PROG= clri +WARNS?= 2 MAN= clri.8 .include Index: dumpfs/Makefile =================================================================== RCS file: /home/ncvs/src/sbin/dumpfs/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- dumpfs/Makefile 2001/03/26 14:33:00 1.4 +++ dumpfs/Makefile 2001/06/29 02:03:23 @@ -2,6 +2,7 @@ # $FreeBSD: src/sbin/dumpfs/Makefile,v 1.4 2001/03/26 14:33:00 ru Exp $ PROG= dumpfs +WARNS?= 2 MAN= dumpfs.8 .include Index: kldload/Makefile =================================================================== RCS file: /home/ncvs/src/sbin/kldload/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- kldload/Makefile 2001/05/18 13:41:26 1.7 +++ kldload/Makefile 2001/06/29 02:03:23 @@ -27,6 +27,7 @@ # PROG= kldload +WARNS?= 2 MAN= kldload.8 .include Index: kldstat/Makefile =================================================================== RCS file: /home/ncvs/src/sbin/kldstat/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- kldstat/Makefile 2001/05/18 13:41:26 1.7 +++ kldstat/Makefile 2001/06/29 02:03:23 @@ -27,6 +27,7 @@ # PROG= kldstat +WARNS?= 2 MAN= kldstat.8 .include Index: spppcontrol/Makefile =================================================================== RCS file: /home/ncvs/src/sbin/spppcontrol/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- spppcontrol/Makefile 2001/03/26 14:33:25 1.4 +++ spppcontrol/Makefile 2001/06/29 02:03:23 @@ -1,6 +1,7 @@ # $FreeBSD: src/sbin/spppcontrol/Makefile,v 1.4 2001/03/26 14:33:25 ru Exp $ PROG= spppcontrol +WARNS?= 2 MAN= spppcontrol.8 .include Index: swapon/Makefile =================================================================== RCS file: /home/ncvs/src/sbin/swapon/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- swapon/Makefile 2001/03/26 14:33:25 1.4 +++ swapon/Makefile 2001/06/29 02:03:23 @@ -2,6 +2,7 @@ # $FreeBSD: src/sbin/swapon/Makefile,v 1.4 2001/03/26 14:33:25 ru Exp $ PROG= swapon +WARNS?= 2 MAN= swapon.8 .include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 20:22: 4 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 13E1637B403 for ; Thu, 28 Jun 2001 20:22:01 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f5T3LxM46412; Thu, 28 Jun 2001 23:21:59 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Thu, 28 Jun 2001 23:21:56 -0400 To: Mike Heffner From: Garance A Drosihn Subject: RE: Initial ctlinfo, for checking incoming jobs to lpd Cc: freebsd-audit@FreeBSD.org, freebsd-print@bostonradio.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 6:47 PM -0400 6/28/01, Mike Heffner wrote: >On 28-Jun-2001 Garance A Drosihn wrote: >| The following patch would add a new source file to lpr/common_source, >| called ctlinfo.c. While I have several plans for ctlinfo.c, >| this first cut just replaces calls to link & unlink in >| lpd/recvjob.c with a call to a new routine which does a whole >| bunch of work. > >I'm not too familiar with the code. It's looks pretty good >altogether. Here's just a few little things I noticed: I have a slightly newer version of the patch available at: http://people.freebsd.org/~gad/lpr/ctlinfo.diff or ftp://freefour.acs.rpi.edu/pub/bsdlpr/ctlinfo.diff Changes: Adds $FreeBSD$ lines that I'll want when checking this in Creates a common_source/ctlinfo.h file with ctl-routines declarations and 'struct cjobinfo' in it. For initial debugging purposes, added a TRIGGERTEST_FNAME one can #define (and which is defined). All the fancy new code will only when receiving a job into a spool directory where that filename exists (it is defined to be 'LpdTestRenameTF'. When got to thinking about putting this into RPI's production lpd, I wanted to be able "ease into" using it on a per-printserver, per-queue basis... In that testing mode, also keep track of when we'd EVER actually expand tabs in a cf-file. I strongly suspect I'm going to redo that tab-expansion nonsense before I'm done. It's silly to be looking to expand tabs when many of the fields are filenames. There shouldn't be any tabs in those fields, and if there WERE any tabs then they would literally BE tabs, and should not be expanded into blanks. Note: in ctlinfo.c, the lines from '#include "ctlinfo.h"' to the definition of 'struct cjprivate' will move back down after the other includes. Those lines are just a weird spot for now so I know that the ctlinfo.h file is setup exactly right. -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 20:45: 5 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 7FFE437B417 for ; Thu, 28 Jun 2001 20:44:56 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5T3wSt97957; Thu, 28 Jun 2001 23:58:28 -0400 (EDT) (envelope-from mike) Date: Thu, 28 Jun 2001 23:58:28 -0400 (EDT) Message-Id: <200106290358.f5T3wSt97957@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/bin/chio patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/chio.20010628.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- chio.20010628.patch o Constify o Set WARNS?=2 Index: chio/Makefile =================================================================== RCS file: /home/ncvs/src/bin/chio/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- chio/Makefile 2001/05/18 13:41:20 1.7 +++ chio/Makefile 2001/06/29 02:46:46 @@ -2,6 +2,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= chio +WARNS?= 2 SRCS= chio.c .include Index: chio/chio.c =================================================================== RCS file: /home/ncvs/src/bin/chio/chio.c,v retrieving revision 1.17 diff -u -r1.17 chio.c --- chio/chio.c 2000/09/18 06:09:11 1.17 +++ chio/chio.c 2001/06/29 02:46:46 @@ -68,16 +68,16 @@ static void find_element __P((char *, u_int16_t *, u_int16_t *)); static struct changer_element_status *get_element_status __P((u_int16_t, u_int16_t)); -static int do_move __P((char *, int, char **)); -static int do_exchange __P((char *, int, char **)); -static int do_position __P((char *, int, char **)); -static int do_params __P((char *, int, char **)); -static int do_getpicker __P((char *, int, char **)); -static int do_setpicker __P((char *, int, char **)); -static int do_status __P((char *, int, char **)); -static int do_ielem __P((char *, int, char **)); -static int do_return __P((char *, int, char **)); -static int do_voltag __P((char *, int, char **)); +static int do_move __P((const char *, int, char **)); +static int do_exchange __P((const char *, int, char **)); +static int do_position __P((const char *, int, char **)); +static int do_params __P((const char *, int, char **)); +static int do_getpicker __P((const char *, int, char **)); +static int do_setpicker __P((const char *, int, char **)); +static int do_status __P((const char *, int, char **)); +static int do_ielem __P((const char *, int, char **)); +static int do_return __P((const char *, int, char **)); +static int do_voltag __P((const char *, int, char **)); #ifndef CHET_VT #define CHET_VT 10 /* Completely Arbitrary */ @@ -176,7 +176,7 @@ static int do_move(cname, argc, argv) - char *cname; + const char *cname; int argc; char **argv; { @@ -257,7 +257,7 @@ static int do_exchange(cname, argc, argv) - char *cname; + const char *cname; int argc; char **argv; { @@ -369,7 +369,7 @@ static int do_position(cname, argc, argv) - char *cname; + const char *cname; int argc; char **argv; { @@ -433,7 +433,7 @@ /* ARGSUSED */ static int do_params(cname, argc, argv) - char *cname; + const char *cname; int argc; char **argv; { @@ -479,7 +479,7 @@ /* ARGSUSED */ static int do_getpicker(cname, argc, argv) - char *cname; + const char *cname; int argc; char **argv; { @@ -509,7 +509,7 @@ static int do_setpicker(cname, argc, argv) - char *cname; + const char *cname; int argc; char **argv; { @@ -540,14 +540,14 @@ static int do_status(cname, argc, argv) - char *cname; + const char *cname; int argc; char **argv; { struct changer_params cp; struct changer_element_status_request cesr; int i, count, base, chet, schet, echet; - char *description; + const char *description; int pvoltag = 0; int avoltag = 0; int sense = 0; @@ -762,7 +762,7 @@ static int do_ielem(cname, argc, argv) - char *cname; + const char *cname; int argc; char **argv; { @@ -788,7 +788,7 @@ static int do_voltag(cname, argc, argv) - char *cname; + const char *cname; int argc; char **argv; { @@ -977,7 +977,7 @@ */ static int do_return(cname, argc, argv) - char *cname; + const char *cname; int argc; char **argv; { Index: chio/defs.h =================================================================== RCS file: /home/ncvs/src/bin/chio/defs.h,v retrieving revision 1.2 diff -u -r1.2 defs.h --- chio/defs.h 1999/08/27 23:13:35 1.2 +++ chio/defs.h 2001/06/29 02:46:46 @@ -33,18 +33,18 @@ */ struct element_type { - char *et_name; /* name; i.e. "picker, "slot", etc. */ + const char *et_name; /* name; i.e. "picker, "slot", etc. */ int et_type; /* type number */ }; struct changer_command { - char *cc_name; /* command name */ + const char *cc_name; /* command name */ /* command handler */ - int (*cc_handler) __P((char *, int, char **)); + int (*cc_handler) __P((const char *, int, char **)); }; struct special_word { - char *sw_name; /* special word */ + const char *sw_name; /* special word */ int sw_value; /* token value */ }; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 20:46: 8 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 1854C37B405 for ; Thu, 28 Jun 2001 20:46:05 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5T3xbF97961; Thu, 28 Jun 2001 23:59:37 -0400 (EDT) (envelope-from mike) Date: Thu, 28 Jun 2001 23:59:37 -0400 (EDT) Message-Id: <200106290359.f5T3xbF97961@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/bin/dd patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/dd.20010628.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- dd.20010628.patch o Mark unused variables o Set WARNS?=2 Index: dd/dd.c =================================================================== RCS file: /home/ncvs/src/bin/dd/dd.c,v retrieving revision 1.31 diff -u -r1.31 dd.c --- dd/dd.c 2000/10/10 01:48:22 1.31 +++ dd/dd.c 2001/06/29 02:55:29 @@ -87,7 +87,7 @@ int main(argc, argv) - int argc; + int argc __unused; char *argv[]; { (void)setlocale(LC_CTYPE, ""); Index: dd/misc.c =================================================================== RCS file: /home/ncvs/src/bin/dd/misc.c,v retrieving revision 1.21 diff -u -r1.21 misc.c --- dd/misc.c 2001/06/25 06:17:02 1.21 +++ dd/misc.c 2001/06/29 02:55:29 @@ -90,7 +90,7 @@ /* ARGSUSED */ void summaryx(notused) - int notused; + int notused __unused; { int save_errno = errno; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 21:14:41 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 81F5A37B406 for ; Thu, 28 Jun 2001 21:14:28 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5T4S0C97998; Fri, 29 Jun 2001 00:28:00 -0400 (EDT) (envelope-from mike) Date: Fri, 29 Jun 2001 00:28:00 -0400 (EDT) Message-Id: <200106290428.f5T4S0C97998@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/bin/ed patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/ed.20010628.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- ed.20010628.patch o Since the rcsids are generating warnings, switch to __RCSID(). o Add consts where appropriate. o Rename some variables that are shadowing global declarations. o Set WARNS?=2 Index: ed/Makefile =================================================================== RCS file: /home/ncvs/src/bin/ed/Makefile,v retrieving revision 1.18 diff -u -r1.18 Makefile --- ed/Makefile 2000/02/29 11:39:24 1.18 +++ ed/Makefile 2001/06/29 04:05:43 @@ -1,6 +1,7 @@ # $FreeBSD: src/bin/ed/Makefile,v 1.18 2000/02/29 11:39:24 markm Exp $ PROG= ed +WARNS?= 2 SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c LINKS= ${BINDIR}/ed ${BINDIR}/red MLINKS= ed.1 red.1 Index: ed/buf.c =================================================================== RCS file: /home/ncvs/src/bin/ed/buf.c,v retrieving revision 1.17 diff -u -r1.17 buf.c --- ed/buf.c 1999/08/27 23:14:12 1.17 +++ ed/buf.c 2001/06/29 04:05:43 @@ -24,15 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * @(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp */ #ifndef lint -#if 0 -static char * const rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp"; -#else -static char * const rcsid = - "$FreeBSD: src/bin/ed/buf.c,v 1.17 1999/08/27 23:14:12 peter Exp $"; -#endif +#include +__RCSID("$FreeBSD: src/bin/ed/buf.c,v 1.17 1999/08/27 23:14:12 peter Exp $"); #endif /* not lint */ #include Index: ed/cbc.c =================================================================== RCS file: /home/ncvs/src/bin/ed/cbc.c,v retrieving revision 1.13 diff -u -r1.13 cbc.c --- ed/cbc.c 2001/03/05 02:15:37 1.13 +++ ed/cbc.c 2001/06/29 04:05:43 @@ -35,15 +35,12 @@ * SUCH DAMAGE. * * from: @(#)bdes.c 5.5 (Berkeley) 6/27/91 + * @(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp */ #ifndef lint -#if 0 -static char * const rcsid = "@(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp"; -#else -static char * const rcsid = - "$FreeBSD: src/bin/ed/cbc.c,v 1.13 2001/03/05 02:15:37 kris Exp $"; -#endif +#include +__RCSID("$FreeBSD: src/bin/ed/cbc.c,v 1.13 2001/03/05 02:15:37 kris Exp $"); #endif /* not lint */ #include @@ -209,7 +206,7 @@ */ void des_error(s) - char *s; /* the message */ + const char *s; /* the message */ { (void)sprintf(errmsg, "%s", s ? s : strerror(errno)); } @@ -250,9 +247,9 @@ * convert the key to a bit pattern */ void -expand_des_key(obuf, ibuf) +expand_des_key(obuf, kbuf) char *obuf; /* bit pattern */ - char *ibuf; /* the key itself */ + char *kbuf; /* the key itself */ { register int i, j; /* counter in a for loop */ int nbuf[64]; /* used for hex/key translation */ @@ -260,13 +257,13 @@ /* * leading '0x' or '0X' == hex key */ - if (ibuf[0] == '0' && (ibuf[1] == 'x' || ibuf[1] == 'X')) { - ibuf = &ibuf[2]; + if (kbuf[0] == '0' && (kbuf[1] == 'x' || kbuf[1] == 'X')) { + kbuf = &kbuf[2]; /* * now translate it, bombing on any illegal hex digit */ - for (i = 0; ibuf[i] && i < 16; i++) - if ((nbuf[i] = hex_to_binary((int) ibuf[i], 16)) == -1) + for (i = 0; kbuf[i] && i < 16; i++) + if ((nbuf[i] = hex_to_binary((int) kbuf[i], 16)) == -1) des_error("bad hex digit in key"); while (i < 16) nbuf[i++] = 0; @@ -280,13 +277,13 @@ /* * leading '0b' or '0B' == binary key */ - if (ibuf[0] == '0' && (ibuf[1] == 'b' || ibuf[1] == 'B')) { - ibuf = &ibuf[2]; + if (kbuf[0] == '0' && (kbuf[1] == 'b' || kbuf[1] == 'B')) { + kbuf = &kbuf[2]; /* * now translate it, bombing on any illegal binary digit */ - for (i = 0; ibuf[i] && i < 16; i++) - if ((nbuf[i] = hex_to_binary((int) ibuf[i], 2)) == -1) + for (i = 0; kbuf[i] && i < 16; i++) + if ((nbuf[i] = hex_to_binary((int) kbuf[i], 2)) == -1) des_error("bad binary digit in key"); while (i < 64) nbuf[i++] = 0; @@ -300,7 +297,7 @@ /* * no special leader -- ASCII */ - (void)strncpy(obuf, ibuf, 8); + (void)strncpy(obuf, kbuf, 8); } /***************** @@ -391,7 +388,7 @@ char *msgbuf; /* I/O buffer */ FILE *fp; /* input file descriptor */ { - Desbuf ibuf; /* temp buffer for initialization vector */ + Desbuf tbuf; /* temp buffer for initialization vector */ register int n; /* number of bytes actually read */ register int c; /* used to test for EOF */ int inverse = 1; /* 0 to encrypt, 1 to decrypt */ @@ -400,11 +397,11 @@ /* * do the transformation */ - MEMCPY(BUFFER(ibuf), BUFFER(msgbuf), 8); + MEMCPY(BUFFER(tbuf), BUFFER(msgbuf), 8); DES_XFORM(UBUFFER(msgbuf)); for (c = 0; c < 8; c++) UCHAR(msgbuf, c) ^= UCHAR(ivec, c); - MEMCPY(BUFFER(ivec), BUFFER(ibuf), 8); + MEMCPY(BUFFER(ivec), BUFFER(tbuf), 8); /* * if the last one, handle it specially */ Index: ed/ed.h =================================================================== RCS file: /home/ncvs/src/bin/ed/ed.h,v retrieving revision 1.14 diff -u -r1.14 ed.h --- ed/ed.h 2001/05/29 18:03:13 1.14 +++ ed/ed.h 2001/06/29 04:05:44 @@ -200,7 +200,7 @@ int close_sbuf __P((void)); int copy_lines __P((long)); int delete_lines __P((long, long)); -void des_error __P((char *)); +void des_error __P((const char *)); int display_lines __P((long, long, int)); line_t *dup_line_node __P((line_t *)); int exec_command __P((void)); @@ -236,7 +236,7 @@ int join_lines __P((long, long)); int mark_line_node __P((line_t *, int)); int move_lines __P((long)); -line_t *next_active_node __P(()); +line_t *next_active_node __P((void)); long next_addr __P((void)); int open_sbuf __P((void)); char *parse_char_class __P((char *)); @@ -259,7 +259,7 @@ char *translit_text __P((char *, int, int, int)); void unmark_line_node __P((line_t *)); void unset_active_nodes __P((line_t *, line_t *)); -long write_file __P((char *, char *, long, long)); +long write_file __P((char *, const char *, long, long)); long write_stream __P((FILE *, long, long)); /* global buffers */ Index: ed/glbl.c =================================================================== RCS file: /home/ncvs/src/bin/ed/glbl.c,v retrieving revision 1.10 diff -u -r1.10 glbl.c --- ed/glbl.c 2000/10/16 07:06:35 1.10 +++ ed/glbl.c 2001/06/29 04:05:44 @@ -24,15 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * @(#)glob.c,v 1.1 1994/02/01 00:34:40 alm Exp */ #ifndef lint -#if 0 -static char * const rcsid = "@(#)glob.c,v 1.1 1994/02/01 00:34:40 alm Exp"; -#else -static char * const rcsid = - "$FreeBSD: src/bin/ed/glbl.c,v 1.10 2000/10/16 07:06:35 brian Exp $"; -#endif +#include +__RCSID("$FreeBSD: src/bin/ed/glbl.c,v 1.10 2000/10/16 07:06:35 brian Exp $"); #endif /* not lint */ #include @@ -210,7 +208,7 @@ /* next_active_node: return the next global-active line node */ line_t * -next_active_node() +next_active_node(void) { while (active_ptr < active_last && active_list[active_ptr] == NULL) active_ptr++; Index: ed/io.c =================================================================== RCS file: /home/ncvs/src/bin/ed/io.c,v retrieving revision 1.10 diff -u -r1.10 io.c --- ed/io.c 1999/08/27 23:14:14 1.10 +++ ed/io.c 2001/06/29 04:05:44 @@ -23,15 +23,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * @(#)io.c,v 1.1 1994/02/01 00:34:41 alm Exp */ #ifndef lint -#if 0 -static char * const rcsid = "@(#)io.c,v 1.1 1994/02/01 00:34:41 alm Exp"; -#else -static char * const rcsid = - "$FreeBSD: src/bin/ed/io.c,v 1.10 1999/08/27 23:14:14 peter Exp $"; -#endif +#include +__RCSID("$FreeBSD: src/bin/ed/io.c,v 1.10 1999/08/27 23:14:14 peter Exp $"); #endif /* not lint */ #include "ed.h" @@ -157,7 +155,7 @@ long write_file(fn, mode, n, m) char *fn; - char *mode; + const char *mode; long n; long m; { Index: ed/main.c =================================================================== RCS file: /home/ncvs/src/bin/ed/main.c,v retrieving revision 1.20 diff -u -r1.20 main.c --- ed/main.c 2001/06/28 22:06:27 1.20 +++ ed/main.c 2001/06/29 04:05:44 @@ -24,21 +24,15 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * @(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp */ -#ifndef lint -static char * const copyright = -"@(#) Copyright (c) 1993 Andrew Moore, Talke Studio. \n\ - All rights reserved.\n"; -#endif /* not lint */ - #ifndef lint -#if 0 -static char * const rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp"; -#else -static char * const rcsid = - "$FreeBSD: src/bin/ed/main.c,v 1.20 2001/06/28 22:06:27 dd Exp $"; -#endif +#include +__COPYRIGHT("@(#) Copyright (c) 1993 Andrew Moore, Talke Studio. \ +All rights reserved."); +__RCSID("$FreeBSD: src/bin/ed/main.c,v 1.20 2001/06/28 22:06:27 dd Exp $"); #endif /* not lint */ /* @@ -100,8 +94,8 @@ long current_addr; /* current address in editor buffer */ long addr_last; /* last address in editor buffer */ int lineno; /* script line number */ -char *prompt; /* command-line prompt */ -char *dps = "*"; /* default command-line prompt */ +const char *prompt; /* command-line prompt */ +const char *dps = "*"; /* default command-line prompt */ const char usage[] = "usage: %s [-] [-sx] [-p string] [name]\n"; @@ -1385,12 +1379,13 @@ { char *hup = NULL; /* hup filename */ char *s; + char ed_hup[] = "ed.hup"; int n; if (!sigactive) quit(1); sigflags &= ~(1 << (signo - 1)); - if (addr_last && write_file("ed.hup", "w", 1, addr_last) < 0 && + if (addr_last && write_file(ed_hup, "w", 1, addr_last) < 0 && (s = getenv("HOME")) != NULL && (n = strlen(s)) + 8 <= PATH_MAX && /* "ed.hup" + '/' */ (hup = (char *) malloc(n + 10)) != NULL) { Index: ed/re.c =================================================================== RCS file: /home/ncvs/src/bin/ed/re.c,v retrieving revision 1.16 diff -u -r1.16 re.c --- ed/re.c 2001/05/29 18:03:14 1.16 +++ ed/re.c 2001/06/29 04:05:44 @@ -24,15 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * @(#)re.c,v 1.6 1994/02/01 00:34:43 alm Exp */ #ifndef lint -#if 0 -static char * const rcsid = "@(#)re.c,v 1.6 1994/02/01 00:34:43 alm Exp"; -#else -static char * const rcsid = - "$FreeBSD: src/bin/ed/re.c,v 1.16 2001/05/29 18:03:14 imp Exp $"; -#endif +#include +__RCSID("$FreeBSD: src/bin/ed/re.c,v 1.16 2001/05/29 18:03:14 imp Exp $"); #endif /* not lint */ #include "ed.h" Index: ed/sub.c =================================================================== RCS file: /home/ncvs/src/bin/ed/sub.c,v retrieving revision 1.12 diff -u -r1.12 sub.c --- ed/sub.c 1999/08/27 23:14:15 1.12 +++ ed/sub.c 2001/06/29 04:05:45 @@ -24,15 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * @(#)sub.c,v 1.1 1994/02/01 00:34:44 alm Exp */ #ifndef lint -#if 0 -static char * const rcsid = "@(#)sub.c,v 1.1 1994/02/01 00:34:44 alm Exp"; -#else -static char * const rcsid = - "$FreeBSD: src/bin/ed/sub.c,v 1.12 1999/08/27 23:14:15 peter Exp $"; -#endif +#include +__RCSID("$FreeBSD: src/bin/ed/sub.c,v 1.12 1999/08/27 23:14:15 peter Exp $"); #endif /* not lint */ #include "ed.h" Index: ed/undo.c =================================================================== RCS file: /home/ncvs/src/bin/ed/undo.c,v retrieving revision 1.9 diff -u -r1.9 undo.c --- ed/undo.c 1999/08/27 23:14:15 1.9 +++ ed/undo.c 2001/06/29 04:05:45 @@ -23,15 +23,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * @(#)undo.c,v 1.1 1994/02/01 00:34:44 alm Exp */ #ifndef lint -#if 0 -static char * const rcsid = "@(#)undo.c,v 1.1 1994/02/01 00:34:44 alm Exp"; -#else -static char * const rcsid = - "$FreeBSD: src/bin/ed/undo.c,v 1.9 1999/08/27 23:14:15 peter Exp $"; -#endif +#include +__RCSID("$FreeBSD: src/bin/ed/undo.c,v 1.9 1999/08/27 23:14:15 peter Exp $"); #endif /* not lint */ #include "ed.h" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 28 21:24:46 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 BFDF237B40B for ; Thu, 28 Jun 2001 21:24:40 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5T4cCH98031; Fri, 29 Jun 2001 00:38:12 -0400 (EDT) (envelope-from mike) Date: Fri, 29 Jun 2001 00:38:12 -0400 (EDT) Message-Id: <200106290438.f5T4cCH98031@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/sbin/adjkerntz patch 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 would appreciate it if someone would review and commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/adjkerntz.20010629.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- adjkerntz.20010629.patch o Properly prototype fake() o Set WARNS?=2 Index: adjkerntz/Makefile =================================================================== RCS file: /home/ncvs/src/sbin/adjkerntz/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- adjkerntz/Makefile 2001/03/26 14:32:55 1.4 +++ adjkerntz/Makefile 2001/06/29 04:22:33 @@ -1,7 +1,7 @@ # $FreeBSD: src/sbin/adjkerntz/Makefile,v 1.4 2001/03/26 14:32:55 ru Exp $ PROG= adjkerntz +WARNS?= 2 MAN= adjkerntz.8 -CFLAGS+= -Wall .include Index: adjkerntz/adjkerntz.c =================================================================== RCS file: /home/ncvs/src/sbin/adjkerntz/adjkerntz.c,v retrieving revision 1.25 diff -u -r1.25 adjkerntz.c --- adjkerntz/adjkerntz.c 1999/08/28 00:12:14 1.25 +++ adjkerntz/adjkerntz.c 2001/06/29 04:22:33 @@ -65,9 +65,15 @@ #define REPORT_PERIOD (30*60) +static void fake __P((int)); static void usage __P((void)); -void fake() {} +static void +fake(unused) + int unused __unused; +{ + /* Do nothing. */ +} int main(argc, argv) int argc; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 29 3:49:54 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 7DD8337B405 for ; Fri, 29 Jun 2001 03:49:48 -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 NHPRVJQQ; Fri, 29 Jun 2001 14:44:27 +0400 Received: (from yar@localhost) by comp.chem.msu.su (8.11.1/8.11.1) id f5TAmiT83256; Fri, 29 Jun 2001 14:48:44 +0400 (MSD) (envelope-from yar) Date: Fri, 29 Jun 2001 14:48:44 +0400 From: Yar Tikhiy To: Sheldon Hearn Cc: Dima Dorfman , audit@FreeBSD.ORG Subject: Re: mkdir(1) on "-p" Message-ID: <20010629144844.A82130@comp.chem.msu.su> References: <20010628215248.5D8A93E2F@bazooka.unixfreak.org> <11500.993766517@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: <11500.993766517@axl.seasidesoftware.co.za>; from sheldonh@starjuice.net on Fri, Jun 29, 2001 at 12:15:17AM +0200 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, Jun 29, 2001 at 12:15:17AM +0200, Sheldon Hearn wrote: > > On Thu, 28 Jun 2001 14:52:48 MST, Dima Dorfman wrote: > > > > -The user must have write permission in the parent directory. > > > +The user must have write permission on the parent directory > > ^^^^ > > Perhaps "to" would be better? > > Nothing wrong with on. Mind you, I think we can do without the second > hunk altogether. :-) I agree that the second hunk isn't of too much importance, so let's drop it :-) BTW, most man pages tend to read "permission on file/directory". Is the "in" variant correct as well? -- Yar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 29 5:15:36 2001 Delivered-To: freebsd-audit@freebsd.org Received: from kawoserv.kawo2.rwth-aachen.de (kawoserv.kawo2.RWTH-Aachen.DE [134.130.180.1]) by hub.freebsd.org (Postfix) with ESMTP id D316537B408 for ; Fri, 29 Jun 2001 05:15:33 -0700 (PDT) (envelope-from alex@big.endian.de) Received: from zerogravity.kawo2.rwth-aachen.de (zerogravity.kawo2.rwth-aachen.de [134.130.181.28]) by kawoserv.kawo2.rwth-aachen.de (8.9.3/8.9.3) with ESMTP id OAA20185; Fri, 29 Jun 2001 14:15:29 +0200 Received: by zerogravity.kawo2.rwth-aachen.de (Postfix, from userid 1001) id 1969714AF5; Fri, 29 Jun 2001 14:15:30 +0200 (CEST) Date: Fri, 29 Jun 2001 14:15:30 +0200 From: Alexander Langer To: Dima Dorfman Cc: Thomas Zenker , audit@FreeBSD.ORG Subject: Re: bin/27029: strptime: %s formatting missing (patch) Message-ID: <20010629141530.A2414@zerogravity.kawo2.rwth-aachen.d> References: <20010629014313.A7351@zerogravity.kawo2.rwth-aachen.d> <20010628235832.23EE83E2F@bazooka.unixfreak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010628235832.23EE83E2F@bazooka.unixfreak.org>; from dima@unixfreak.org on Thu, Jun 28, 2001 at 04:58:32PM -0700 X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8 A8 E3 BA F3 4E 60 7D 7F X-PGP-at: finger alex@big.endian.de X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung. 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 Thus spake Dima Dorfman (dima@unixfreak.org): > > [... case 'Z':] > > Please keep the order. > If you look at that switch, they're already so out of order that it > isn't clear where this should go. Indeed. You can actually exactly see how it has grown - the first are in order, most are not. Style bug. Alex -- cat: /home/alex/.sig: No such file or directory To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 29 6:16:56 2001 Delivered-To: freebsd-audit@freebsd.org Received: from smtp.www-service.de (smtp.www-service.de [212.77.161.16]) by hub.freebsd.org (Postfix) with SMTP id 658CE37B408 for ; Fri, 29 Jun 2001 06:16:51 -0700 (PDT) (envelope-from thz@Lennartz-electronic.de) Received: (qmail 15341 invoked from network); 29 Jun 2001 13:16:48 -0000 Received: from pd9503398.dip.t-dialin.net (HELO fw.tue.le) (217.80.51.152) by smtp.www-service.de with SMTP; 29 Jun 2001 13:16:48 -0000 Received: from mezcal.tue.le (mezcal.tue.le [192.168.201.20]) by fw.tue.le (8.8.8/8.8.8) with ESMTP id PAA15766; Fri, 29 Jun 2001 15:16:19 +0200 (CEST) (envelope-from thz@mezcal.tue.le) Received: (from thz@localhost) by mezcal.tue.le (8.11.3/8.11.3) id f5TDGJI97769; Fri, 29 Jun 2001 15:16:19 +0200 (CEST) (envelope-from thz) Date: Fri, 29 Jun 2001 15:14:58 +0200 From: Thomas Zenker To: Alexander Langer Cc: Dima Dorfman , audit@FreeBSD.ORG Subject: Re: bin/27029: strptime: %s formatting missing (patch) Message-ID: <20010629151458.A97711@mezcal.tue.le> References: <20010629014313.A7351@zerogravity.kawo2.rwth-aachen.d> <20010628235832.23EE83E2F@bazooka.unixfreak.org> <20010629141530.A2414@zerogravity.kawo2.rwth-aachen.d> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010629141530.A2414@zerogravity.kawo2.rwth-aachen.d>; from alex@big.endian.de on Fri, Jun 29, 2001 at 02:15:30PM +0200 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, Jun 29, 2001 at 02:15:30PM +0200, Alexander Langer wrote: > Thus spake Dima Dorfman (dima@unixfreak.org): > > > > [... case 'Z':] > > > Please keep the order. > > If you look at that switch, they're already so out of order that it > > isn't clear where this should go. > > Indeed. You can actually exactly see how it has grown - the first are > in order, most are not. > > Style bug. I think the reason is another one: there are various switches like b,B and h, which don't help really in finding the correct order. Others seem to be grouped by function, not by alphabetical order. -- Thomas Zenker c/o Lennartz electronic GmbH Bismarckstrasse 136, D-72072 Tuebingen, Germany Phone: +49-(0)7071-93550 Email: thz@lennartz-electronic.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 29 8:26: 3 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 625BA37B408 for ; Fri, 29 Jun 2001 08:26:01 -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 BAA28439; Sat, 30 Jun 2001 01:25:31 +1000 Date: Sat, 30 Jun 2001 01:23:33 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Dima Dorfman Cc: Alexander Langer , Thomas Zenker , audit@FreeBSD.ORG Subject: Re: bin/27029: strptime: %s formatting missing (patch) In-Reply-To: <20010628235832.23EE83E2F@bazooka.unixfreak.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 On Thu, 28 Jun 2001, Dima Dorfman wrote: > Alexander Langer writes: > > Also sprach Thomas Zenker (thz@Lennartz-electronic.de): > > > + case 's': > > > + { > > > + time_t t; > > > + const char *cp; > > > + t = strtol(buf, &cp, 10); > > > > Is time_t long again on all branches? > > I think David (obrien) backed it out on -STABLE, IIRC. > > IIRC it's an int on most branches, but using strtol is still okay there. Except for the usual lack of error checking for strto*(). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 29 10:21: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 7505937B401; Fri, 29 Jun 2001 10:21:11 -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 f5THL5I65206; Sat, 30 Jun 2001 02:21:05 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: arch@freebsd.org Cc: audit@freebsd.org, athlete@kta.att.ne.jp, iwasaki@jp.freebsd.org Subject: Re: CFR: Crusoe LongRun Support In-Reply-To: <20010626114448O.iwasaki@jp.FreeBSD.org> References: <20010626114448O.iwasaki@jp.FreeBSD.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: <20010630022056B.iwasaki@jp.FreeBSD.org> Date: Sat, 30 Jun 2001 02:20:56 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 25 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'm going to commit the patches for Transmeta Crusoe LongRun Support. > This was originally created by HATTORI-san > http://home.att.ne.jp/delta/athlete/longrun/longrun.html > as a device driver, then I made cleanups and adding sysctl interface > support, like this. > > hw.crusoe.longrun: 2 > hw.crusoe.frequency: 600 > hw.crusoe.voltage: 1600 > hw.crusoe.percentage: 100 > > Only hw.crusoe.longrun is changeable, valid values are 0, 1, 2 and 3. > > The latest patches against sys/sys/i386/i386/identcpu.c at > http://people.freebsd.org/~iwasaki/apm/sys-longrun-20010626.diff > > I'd like to have the patches reviewed in terms of sysctl namespace, > security issues and other problems. Any suggestions or objections about this? I'll commit this 3 days later. Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 29 11:34:36 2001 Delivered-To: freebsd-audit@freebsd.org Received: from finch-post-11.mail.demon.net (finch-post-11.mail.demon.net [194.217.242.39]) by hub.freebsd.org (Postfix) with ESMTP id 6F33637B403; Fri, 29 Jun 2001 11:34:31 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by finch-post-11.mail.demon.net with esmtp (Exim 2.12 #1) id 15G366-000ERv-0B; Fri, 29 Jun 2001 18:34:30 +0000 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f5TIXE704473; Fri, 29 Jun 2001 19:33:14 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Fri, 29 Jun 2001 19:33:14 +0100 (BST) From: Doug Rabson To: Mitsuru IWASAKI Cc: , , Subject: Re: CFR: Crusoe LongRun Support In-Reply-To: <20010630022056B.iwasaki@jp.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 On Sat, 30 Jun 2001, Mitsuru IWASAKI wrote: > > > > I'd like to have the patches reviewed in terms of sysctl namespace, > > security issues and other problems. > > Any suggestions or objections about this? > I'll commit this 3 days later. I think you should probably commit it. I would really like to see a manpage committed at the same time which describes the implications of the various longrun values. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 29 12:20: 0 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 98DF737B403; Fri, 29 Jun 2001 12:19:54 -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/smtpfeed 1.12) with ESMTP/inet id f5TJJqI86261; Sat, 30 Jun 2001 04:19:53 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: dfr@nlsystems.com Cc: iwasaki@jp.FreeBSD.org, arch@freebsd.org, audit@freebsd.org, athlete@kta.att.ne.jp Subject: Re: CFR: Crusoe LongRun Support In-Reply-To: References: <20010630022056B.iwasaki@jp.FreeBSD.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: <20010630041951I.iwasaki@jp.FreeBSD.org> Date: Sat, 30 Jun 2001 04:19:51 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 22 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'd like to have the patches reviewed in terms of sysctl namespace, > > > security issues and other problems. > > > > Any suggestions or objections about this? > > I'll commit this 3 days later. > > I think you should probably commit it. I would really like to see a > manpage committed at the same time which describes the implications of the > various longrun values. OK, I'll do that based on Hattori-san's page on LongRun http://home.att.ne.jp/delta/athlete/longrun/longrun_e.html and add short descriptions at the last argument of sysctl_add_oid(). BTW, is sysctl(8) good place to be documented? I think we'd better to have another documentation system for the hypertrophied MIBs (like /boot/default/loader.conf for tunables, sys/i386/conf/NOTES for kernel config options). Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 29 12:29:30 2001 Delivered-To: freebsd-audit@freebsd.org Received: from finch-post-11.mail.demon.net (finch-post-11.mail.demon.net [194.217.242.39]) by hub.freebsd.org (Postfix) with ESMTP id 1ECC837B401; Fri, 29 Jun 2001 12:29:24 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by finch-post-11.mail.demon.net with esmtp (Exim 2.12 #1) id 15G3xC-000MNI-0B; Fri, 29 Jun 2001 19:29:23 +0000 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f5TJS7704682; Fri, 29 Jun 2001 20:28:07 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Fri, 29 Jun 2001 20:28:07 +0100 (BST) From: Doug Rabson To: Mitsuru IWASAKI Cc: , , Subject: Re: CFR: Crusoe LongRun Support In-Reply-To: <20010630041951I.iwasaki@jp.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 On Sat, 30 Jun 2001, Mitsuru IWASAKI wrote: > Hi, > > > > > I'd like to have the patches reviewed in terms of sysctl namespace, > > > > security issues and other problems. > > > > > > Any suggestions or objections about this? > > > I'll commit this 3 days later. > > > > I think you should probably commit it. I would really like to see a > > manpage committed at the same time which describes the implications of the > > various longrun values. > > OK, I'll do that based on Hattori-san's page on LongRun > http://home.att.ne.jp/delta/athlete/longrun/longrun_e.html > and add short descriptions at the last argument of sysctl_add_oid(). > > BTW, is sysctl(8) good place to be documented? I think we'd better to > have another documentation system for the hypertrophied MIBs (like > /boot/default/loader.conf for tunables, sys/i386/conf/NOTES for kernel > config options). I don't think that sysctl(8) is really the right place since there really isn't enough space for nontrivial documentation and documenting many things in a single place doesn't really scale that well. I would like to see something like longrun(4) which described the sysctls and indicated what each longrun level actually means. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 29 20:32:54 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 2B73A37B409 for ; Fri, 29 Jun 2001 20:32:51 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 576723E32; Fri, 29 Jun 2001 20:32:50 -0700 (PDT) To: Bruce Evans Cc: Alexander Langer , Thomas Zenker , audit@FreeBSD.ORG Subject: Re: bin/27029: strptime: %s formatting missing (patch) In-Reply-To: ; from bde@zeta.org.au on "Sat, 30 Jun 2001 01:23:33 +1000 (EST)" Date: Fri, 29 Jun 2001 20:32:50 -0700 From: Dima Dorfman Message-Id: <20010630033250.576723E32@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 Bruce Evans writes: > On Thu, 28 Jun 2001, Dima Dorfman wrote: > > Alexander Langer writes: > > > Also sprach Thomas Zenker (thz@Lennartz-electronic.de): > > > > + case 's': > > > > + { > > > > + time_t t; > > > > + const char *cp; > > > > + t = strtol(buf, &cp, 10); > > > > > > Is time_t long again on all branches? > > > I think David (obrien) backed it out on -STABLE, IIRC. > > > > IIRC it's an int on most branches, but using strtol is still okay there. > > Except for the usual lack of error checking for strto*(). The version I have locally (attached below), which is based on Thomas's patch, checks for overflow, but not for whether strtol consumed the entrie string. Unless you (Bruce) find something wrong with it I'd like to commit this in a few days. Known style bugs: - Declaration inside a block. - Block not indented. - No parenthesis with return. - Returning "0" but should be "NULL". ..all of which are there to maintain what little consistency there is in that file. Dima Dorfman dima@unixfreak.org Index: strptime.c =================================================================== RCS file: /stl/src/FreeBSD/src/lib/libc/stdtime/strptime.c,v retrieving revision 1.25 diff -u -r1.25 strptime.c --- strptime.c 2001/03/21 14:52:12 1.25 +++ strptime.c 2001/06/30 03:26:21 @@ -67,6 +67,8 @@ #include "namespace.h" #include #include +#include +#include #include #include #include "un-namespace.h" @@ -443,6 +445,20 @@ if (*buf != 0 && isspace((unsigned char)*buf)) while (*ptr != 0 && !isspace((unsigned char)*ptr)) ptr++; + break; + + case 's': + { + char *cp; + time_t t; + + t = strtol(buf, &cp, 10); + if (t == LONG_MAX) + return 0; + buf = cp; + gmtime_r(&t, tm); + got_GMT = 1; + } break; case 'Y': To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Jun 30 11:38:46 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 E091237B8C2; Sat, 30 Jun 2001 11:14:55 -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/smtpfeed 1.12) with ESMTP/inet id f5UIElI42332; Sun, 1 Jul 2001 03:14:47 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: dfr@nlsystems.com Cc: iwasaki@jp.FreeBSD.org, arch@freebsd.org, audit@freebsd.org, athlete@kta.att.ne.jp Subject: Re: CFR: Crusoe LongRun Support In-Reply-To: References: <20010630041951I.iwasaki@jp.FreeBSD.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: <20010701031447S.iwasaki@jp.FreeBSD.org> Date: Sun, 01 Jul 2001 03:14:47 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 80 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 would like to see something like longrun(4) which described the sysctls > and indicated what each longrun level actually means. OK, understood. I've written longrun(4) manpage. As always my English is poor, any feedback is welcome :-) Thanks .\" Copyright (c) 2001 Tamotsu HATTORI .\" Copyright (c) 2001 Mitsuru IWASAKI .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .Dd Jun 30, 2001 .Dt LONGRUN 4 i386 .Os .Sh NAME .Nm longrun .Nd Transmeta(TM) Crusoe(TM) LongRun(TM) support .Sh SYNOPSIS The following .Xr sysctl 8 MIBs are available: .Bl -tag -width "hw.crusoe.percentage integer no " -compact .It Sy "Name Type Changeable Description .It "hw.crusoe.longrun integer yes LongRun mode. .Bl -tag -width "0: minimum frequency mode" -compact .It "0: minimum frequency mode .It "1: power-saving mode .It "2: performance mode .It "3: maximum frequency mode .El .It "hw.crusoe.frequency integer no Current frequency (MHz). .It "hw.crusoe.voltage integer no Current voltage (mV). .It "hw.crusoe.percentage integer no Processing performance (%). .El .Pp .Sh EXAMPLES To get current status: .Bd -literal -offset indent % sysctl hw.crusoe .Ed .Pp To set LongRun mode to performance oriented variable frequency mode: .Bd -literal -offset indent # sysctl -w hw.crusoe.longrun=2 .Ed .Pp .Sh AUTHORS .An -nosplit LongRun support and this manual page were written by .An Tamotsu HATTORI Aq athlete@kta.att.ne.jp and .An Mitsuru IWASAKI Aq iwasaki@FreeBSD.org . .Sh HISTORY Transmeta(TM) Crusoe(TM) LongRun(TM) support first appeared in .Fx 5.0 . To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Jun 30 14:25:41 2001 Delivered-To: freebsd-audit@freebsd.org Received: from saturn.bsdhome.com (unknown [24.25.2.193]) by hub.freebsd.org (Postfix) with ESMTP id D931837B401; Sat, 30 Jun 2001 14:25:30 -0700 (PDT) (envelope-from bsd@bsdhome.com) Received: from neutrino.bsdhome.com (jupiter [192.168.220.13]) by saturn.bsdhome.com (8.11.3/8.11.3) with ESMTP id f5ULPRC09577; Sat, 30 Jun 2001 17:25:28 -0400 (EDT) Received: (from bsd@localhost) by neutrino.bsdhome.com (8.11.4/8.11.4) id f5ULPMu64819; Sat, 30 Jun 2001 17:25:22 -0400 (EDT) (envelope-from bsd) Date: Sat, 30 Jun 2001 17:25:22 -0400 From: Brian Dean To: freebsd-audit@freebsd.org Cc: freebsd-hackers@freebsd.org Subject: kernel ddb patch for setting hardware watchpoints Message-ID: <20010630172522.A64393@neutrino.bsdhome.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 Hi, Please look over the following patch to ddb. This patch adds the 'hwatch' and 'dhwatch' commands to set and delete hardware watchpoints. These commands allow one to utilize hardware watchpoints without having to modify the debug registers directly (which can be tricky). I modified the 'show watch' command to display information about hardware watchpoints as well. These commands result in no-ops for architectures that don't support them. I originally tried to overload the 'watch' and 'dwatch' command but their operation was sufficiently different that I decided it best to make a new command. For one thing, watchpoints are not actually installed until a 'continue' command is given which makes it impossible see the effects on the debug registers until after the next break or watchpoint has been hit. More serious, though, the 'watch' command really seems to be designed for watching addresses in user address space and not the kernel. To support the hwatch/dhwatch commands, I needed three machine dependent hooks from ddb: db_md_set_watchpoint() db_md_clr_watchpoint() db_md_list_watchpoints() These are all called from within ddb/db_watch.c and are defined in $arch/$arch/db_trace.c. The patch is located at: http://people.freebsd.org/~bsd/ddb/ddb.patch2 I've built an alpha kernel with the patch applied and it built ok. I don't have hardware to actually run it, though, but since this ends up as a no-op on alpha (and ia64), I suspect it is Ok (famous last words). I don't know where I can build this on an ia64 machine. Do we have a machine available for this kind of thing? Caveats: This patch won't do the right thing on SMP systems. The debug registers are set/cleared only for the CPU running ddb. Since the debug registers are a per-cpu thing, they won't be set for the other CPUs. I'll work on that next. See below for a sample session. Thanks, -Brian -- Brian Dean bsd@FreeBSD.org bsd@bsdhome.com Example session: login: FreeBSD/i386 (stage.bsdhome.com) (ttyd1) login: Debugger("manual escape to debugger") Stopped at Debugger+0x44: pushl %ebx db> show reg cs 0x8 ds 0x10 es 0xc9a80010 fs 0xc0300018 harvestring+0x2b38 ss 0x10 eax 0x26 ecx 0x2fd edx 0x2f9 ebx 0x202 esp 0xc9a8ded0 ebp 0xc9a8dedc esi 0xc0cff400 edi 0xc0d16800 eip 0xc0276974 Debugger+0x44 efl 0x46 dr0 0 dr1 0 dr2 0 dr3 0 dr4 0xffff0ff0 dr5 0x400 dr6 0xffff0ff0 dr7 0x400 Debugger+0x44: pushl %ebx db> hwatch 0xcaae6740,9 db> show watch No watchpoints set hardware watchpoints: watch status type len address ----- -------- ---------- --- ---------- 0 enabled write 4 0xcaae6740 1 enabled write 4 0xcaae6744 2 enabled write 1 0xcaae6748 3 disabled debug register values: dr0 0xcaae6740 dr1 0xcaae6744 dr2 0xcaae6748 dr3 0x00000000 dr4 0xffff0ff0 dr5 0x01dd042a dr6 0xffff0ff0 dr7 0x01dd042a db> cont Stopped at runq_add+0x41: movl 0x4(%edx),%eax db> dhwatch 0xcaae6740,9 db> show watch No watchpoints set hardware watchpoints: watch status type len address ----- -------- ---------- --- ---------- 0 disabled 1 disabled 2 disabled 3 disabled debug register values: dr0 0x00000000 dr1 0x00000000 dr2 0x00000000 dr3 0x00000000 dr4 0xffff0ff1 dr5 0x00000400 dr6 0xffff0ff1 dr7 0x00000400 db> cont FreeBSD/i386 (stage.bsdhome.com) (ttyd1) login: -- Brian Dean bsd@bsdhome.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message