From owner-freebsd-audit Sun Jun 17 2:18: 1 2001 Delivered-To: freebsd-audit@freebsd.org Received: from assaris.sics.se (h122n4fls32o892.telia.com [213.64.47.122]) by hub.freebsd.org (Postfix) with ESMTP id 83D0637B407; Sun, 17 Jun 2001 02:17:46 -0700 (PDT) (envelope-from assar@assaris.sics.se) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id LAA72266; Sun, 17 Jun 2001 11:17:51 +0200 (CEST) (envelope-from assar) To: freebsd-audit@freebsd.org, jlemon@freebsd.org Subject: GLOB_LIMIT vs GLOB_MAXPATH From: Assar Westerlund Date: 17 Jun 2001 11:17:45 +0200 Message-ID: <5ld783cvnq.fsf@assaris.sics.se> Lines: 10 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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 GLOB_MAXPATH flag to glob(3) does the same thing as the GLOB_LIMIT one in NetBSD and OpenBSD (except for the default limit). Since this is mostly used by ftpd and has been in the tree for a short amount of time, I think it makes sense to keep it compatible with the other BSDs. Enclosed is a patch that does this. Comments? /assar --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=fb.glob-limit.diff Index: lib/libc/gen/glob.3 =================================================================== RCS file: /home/ncvs/src/lib/libc/gen/glob.3,v retrieving revision 1.15 diff -u -w -r1.15 glob.3 --- lib/libc/gen/glob.3 2001/03/19 19:10:06 1.15 +++ lib/libc/gen/glob.3 2001/06/17 00:12:41 @@ -260,13 +260,14 @@ Expand patterns that start with .Ql ~ to user name home directories. -.It Dv GLOB_MAXPATH +.It Dv GLOB_LIMIT Limit the total number of returned pathnames to the value provided in -.Fa gl_matchc . +.Fa gl_matchc +(default ARG_MAX). If .Fn glob would match more pathnames, -.Dv GLOB_LIMIT +.Dv GLOB_LIMITHIT will be returned. .El .Pp @@ -384,9 +385,9 @@ was set or .Fa \*(lp*errfunc\*(rp\*(lp\*(rp returned non-zero. -.It Dv GLOB_LIMIT +.It Dv GLOB_LIMITHIT The flag -.Dv GLOB_MAXPATH +.Dv GLOB_LIMIT was provided, and the specified limit passed to .Fn glob in Index: lib/libc/gen/glob.c =================================================================== RCS file: /home/ncvs/src/lib/libc/gen/glob.c,v retrieving revision 1.17 diff -u -w -r1.17 glob.c --- lib/libc/gen/glob.c 2001/03/28 23:55:51 1.17 +++ lib/libc/gen/glob.c 2001/06/17 00:12:49 @@ -170,9 +170,11 @@ if (!(flags & GLOB_DOOFFS)) pglob->gl_offs = 0; } - if (flags & GLOB_MAXPATH) + if (flags & GLOB_LIMIT) { limit = pglob->gl_matchc; - else + if (limit == 0) + limit = ARG_MAX; + } else limit = 0; pglob->gl_flags = flags & ~GLOB_MAGCHAR; pglob->gl_errfunc = errfunc; @@ -688,7 +690,7 @@ const Char *p; if (*limit && pglob->gl_pathc > *limit) - return (GLOB_LIMIT); + return (GLOB_LIMITHIT); newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); pathv = pglob->gl_pathv ? Index: libexec/ftpd/ftpcmd.y =================================================================== RCS file: /home/ncvs/src/libexec/ftpd/ftpcmd.y,v retrieving revision 1.26 diff -u -w -r1.26 ftpcmd.y --- libexec/ftpd/ftpcmd.y 2001/04/28 07:55:19 1.26 +++ libexec/ftpd/ftpcmd.y 2001/06/17 00:15:15 @@ -947,7 +947,7 @@ GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE; memset(&gl, 0, sizeof(gl)); - flags |= GLOB_MAXPATH; + flags |= GLOB_LIMIT; gl.gl_matchc = MAXGLOBARGS; if (glob($1, flags, NULL, &gl) || gl.gl_pathc == 0) { Index: libexec/ftpd/ftpd.c =================================================================== RCS file: /home/ncvs/src/libexec/ftpd/ftpd.c,v retrieving revision 1.77 diff -u -w -r1.77 ftpd.c --- libexec/ftpd/ftpd.c 2001/06/13 00:06:42 1.77 +++ libexec/ftpd/ftpd.c 2001/06/17 00:15:16 @@ -2670,7 +2670,7 @@ memset(&gl, 0, sizeof(gl)); gl.gl_matchc = MAXGLOBARGS; - flags |= GLOB_MAXPATH; + flags |= GLOB_LIMIT; freeglob = 1; if (glob(whichf, flags, 0, &gl)) { reply(550, "not found"); Index: libexec/ftpd/popen.c =================================================================== RCS file: /home/ncvs/src/libexec/ftpd/popen.c,v retrieving revision 1.20 diff -u -w -r1.20 popen.c --- libexec/ftpd/popen.c 2001/03/19 19:11:00 1.20 +++ libexec/ftpd/popen.c 2001/06/17 00:15:16 @@ -108,7 +108,7 @@ memset(&gl, 0, sizeof(gl)); gl.gl_matchc = MAXGLOBARGS; - flags |= GLOB_MAXPATH; + flags |= GLOB_LIMIT; if (glob(argv[argc], flags, NULL, &gl)) gargv[gargc++] = strdup(argv[argc]); else Index: include/glob.h =================================================================== RCS file: /home/ncvs/src/include/glob.h,v retrieving revision 1.4 diff -u -w -r1.4 glob.h --- include/glob.h 2001/03/19 19:10:06 1.4 +++ include/glob.h 2001/06/17 00:15:30 @@ -77,11 +77,11 @@ #define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */ #define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ #define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ -#define GLOB_MAXPATH 0x1000 /* limit number of returned paths */ +#define GLOB_LIMIT 0x1000 /* limit number of returned paths */ #define GLOB_NOSPACE (-1) /* Malloc call failed. */ #define GLOB_ABEND (-2) /* Unignored error. */ -#define GLOB_LIMIT (-3) /* Path limit was hit. */ +#define GLOB_LIMITHIT (-3) /* Path limit was hit. */ __BEGIN_DECLS int glob __P((const char *, int, int (*)(const char *, int), glob_t *)); --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 17 2:21:55 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (diskworld.nanolink.com [195.24.48.189]) by hub.freebsd.org (Postfix) with SMTP id 1B96737B409 for ; Sun, 17 Jun 2001 02:21:46 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 2104 invoked by uid 1000); 17 Jun 2001 09:20:17 -0000 Date: Sun, 17 Jun 2001 12:20:17 +0300 From: Peter Pentchev To: Assar Westerlund Cc: freebsd-audit@freebsd.org, jlemon@freebsd.org Subject: Re: GLOB_LIMIT vs GLOB_MAXPATH Message-ID: <20010617122017.F777@ringworld.oblivion.bg> Mail-Followup-To: Assar Westerlund , freebsd-audit@freebsd.org, jlemon@freebsd.org References: <5ld783cvnq.fsf@assaris.sics.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <5ld783cvnq.fsf@assaris.sics.se>; from assar@freebsd.org on Sun, Jun 17, 2001 at 11:17:45AM +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 Sun, Jun 17, 2001 at 11:17:45AM +0200, Assar Westerlund wrote: > The GLOB_MAXPATH flag to glob(3) does the same thing as the GLOB_LIMIT > one in NetBSD and OpenBSD (except for the default limit). Since this > is mostly used by ftpd and has been in the tree for a short amount of > time, I think it makes sense to keep it compatible with the other > BSDs. Enclosed is a patch that does this. Comments? Compatibility is good, but.. I wonder if this would require revision of the glob(3) advisory.. And I wonder if this would qualify as an API change on the -stable branch, which seems to be frowned upon by some, or if it wouldn't be MFC'd, which would cause an API incompatibility between -stable and -current :) Other than that, I think it would be nice to stay compatible with the other BSD's.. G'luck, Peter -- This sentence every third, but it still comprehensible. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 17 2:30:17 2001 Delivered-To: freebsd-audit@freebsd.org Received: from assaris.sics.se (h122n4fls32o892.telia.com [213.64.47.122]) by hub.freebsd.org (Postfix) with ESMTP id DB01C37B401; Sun, 17 Jun 2001 02:30:13 -0700 (PDT) (envelope-from assar@assaris.sics.se) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id LAA72326; Sun, 17 Jun 2001 11:30:18 +0200 (CEST) (envelope-from assar) From: Assar Westerlund To: Peter Pentchev Cc: freebsd-audit@freebsd.org, jlemon@freebsd.org Subject: Re: GLOB_LIMIT vs GLOB_MAXPATH References: <5ld783cvnq.fsf@assaris.sics.se> <20010617122017.F777@ringworld.oblivion.bg> Date: 17 Jun 2001 11:30:18 +0200 In-Reply-To: Peter Pentchev's message of "Sun, 17 Jun 2001 12:20:17 +0300" Message-ID: <5l66dvcv2t.fsf@assaris.sics.se> Lines: 18 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 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 Peter Pentchev writes: > I wonder if this would require revision of the glob(3) advisory.. I don't see why. It says that 4.3 and above doesn't have the problem and that continues to be the case. The patches apply to older versoins. > And I wonder if this would qualify as an API change on the -stable > branch, which seems to be frowned upon by some, or if it wouldn't > be MFC'd, which would cause an API incompatibility between -stable > and -current :) Well, compatibility between -current and -stable should be a goal I think, hence if this goes in it should also be MFC:ed. I agree that it changes the API and I wish I had found this issue before 4.3 but I didn't. Either you can argue for nobody (except me/us :-) using this API or just leave the GLOB_MAXPATH for backwards compatibility. /assar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 17 3: 3:42 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 D153B37B405 for ; Sun, 17 Jun 2001 03:03:32 -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 UAA14006; Sun, 17 Jun 2001 20:03:23 +1000 Date: Sun, 17 Jun 2001 20:01:36 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Dima Dorfman Cc: audit@FreeBSD.ORG Subject: Re: Patch to fix `pstat -tn` In-Reply-To: <20010617021208.63AF83E28@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 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. Example of pstat -nt output: > LINE RAW CAN OUT IHIWT ILOWT OHWT LWT COL STATE SESS PGID DISC > 0 0 0 0 512 448 2052 256 59 OCc c128be00 2651 term > 0 0 0 0 512 448 2052 256 58 OCc c1283380 2203 term > 0 0 0 0 512 448 2052 256 0 OCc c11fe8c0 5934 term ^ The bug being discussed (all lines 0). > ... > 0 0 0 0 0 0 0 0 0 - 0 0 term > 0 0 0 0 512 448 2052 256 7 OCc c11d0440 378 term > 32 cy lines > LINE RAW CAN OUT IHIWT ILOWT OHWT LWT COL STATE SESS PGID DISC > 0 0 0 0 512 448 1296 256 0 - 0 0 term > 1 0 0 0 512 448 1296 256 0 - 0 0 term > 2 0 0 0 512 448 1296 256 0 - 0 0 term ^ The line number is printed correctly for the cy driver, since the cy driver doesn't support kern.ttys yet. The line number is apparently supposed to be just the ordinal number of the device, starting at 0 for each driver (see the code). This is not quite as described in the man page, but just as useful in this context. Note that the driver name is printed in a header line for non-broken cases, so the major number is less useful than in other contexts. Many more bugs are visible in the corresponding pstat -t output: > LINE RAW CAN OUT IHIWT ILOWT OHWT LWT COL STATE SESS PGID DISC > ttyp2 0 0 0 512 448 2052 256 59 OCc c128be00 2651 term > ttyp1 0 0 0 512 448 2052 256 58 OCc c1283380 2203 term > ttyp0 0 0 0 512 448 2052 256 0 OCc c11fe8c0 5985 term Bug: no header for the pty lines. Bug: pty lines are inversely ordered. > ttyv7 0 0 0 512 448 2052 256 7 OCc c11d0080 385 term > ttyv6 0 0 0 512 448 2052 256 7 OCc c11d0040 384 term > ttyv5 0 0 0 512 448 2052 256 7 OCc c11d0880 383 term > ttyv4 0 0 0 512 448 2052 256 7 OCc c11d0200 382 term > ttyv3 0 0 0 512 448 2052 256 7 OCc c11d02c0 381 term > ttyv2 0 0 0 512 448 2052 256 7 OCc c11d0840 380 term > ttyv1 0 0 0 512 448 2052 256 7 OCc c11d0340 379 term Bugs: similarly for the most sc lines. > ttyd0 0 0 0 11520 10080 4104 256 0 - 0 0 term > ttyd1 0 0 0 512 448 1296 256 0 - 0 0 term Bugs: similarly for the all sio lines. > consolectl 0 0 0 512 448 1296 256 0 OCc 0 0 term Bug: this sc line is not with the other sc lines. Bug: "consolectl" is too verbose for a tty name. Verbose break tables like this. Bug?: "consolectl" is not a normal tty (?), but we have allocated normal buffers for its i/o. > 0 0 0 0 0 0 0 0 0 - 0 0 term Bug: this line is too broken to even have a name. > ttyv0 0 0 0 512 448 2052 256 7 OCc c11d0440 378 term Bug: this sc line is more unsorted than the others. > 32 cy lines > LINE RAW CAN OUT IHIWT ILOWT OHWT LWT COL STATE SESS PGID DISC > #C:27:0x-105637 0 0 0 512 448 1296 256 0 - 0 0 term > #C:20:0x-105637 0 0 0 512 448 1296 256 0 - 0 0 term The names here are determined by devname(3), so bugs in devname(3) are inherited: Bug: devname() can't always find the device number in the database or in the kernel. (The above output is wihout devfs.) Bug: when devname() can't find the device number, it misprints minor numbers that aren't larger than 255 with format 0x%d. This is especially messy for negative minor numbers (see above), and the 0x prefix is nonsense. > ... > #C:169:0x-10563 0 0 0 512 448 1296 256 0 - 0 0 term > #C:162:0x-10563 0 0 0 512 448 1296 256 0 - 0 0 term > 16 0 0 0 0 0 0 0 0 - 0 0 term > ... > 31 0 0 0 0 0 0 0 0 - 0 0 term > 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. 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 17 4:43:52 2001 Delivered-To: freebsd-audit@freebsd.org Received: from assaris.sics.se (h122n4fls32o892.telia.com [213.64.47.122]) by hub.freebsd.org (Postfix) with ESMTP id 337FF37B40F for ; Sun, 17 Jun 2001 04:41:41 -0700 (PDT) (envelope-from assar@assaris.sics.se) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id NAA72753; Sun, 17 Jun 2001 13:41:46 +0200 (CEST) (envelope-from assar) To: freebsd-audit@freebsd.org Subject: duplicate copies of emalloc to libutil? From: Assar Westerlund Date: 17 Jun 2001 13:41:44 +0200 Message-ID: <5ld783bafb.fsf@assaris.sics.se> Lines: 6 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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 --=-=-= Any comments? /assar --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=fbsd.diff Index: lib/libutil/Makefile =================================================================== RCS file: /home/ncvs/src/lib/libutil/Makefile,v retrieving revision 1.41 diff -u -w -r1.41 Makefile --- lib/libutil/Makefile 2001/05/18 13:41:23 1.41 +++ lib/libutil/Makefile 2001/06/17 10:35:27 @@ -6,7 +6,8 @@ SHLIB_MINOR= 0 CFLAGS+=-Wall -DLIBC_SCCS -I${.CURDIR} CFLAGS+=-DINET6 -SRCS= _secure_path.c auth.c extattr.c fparseln.c login.c login_auth.c \ +SRCS= _secure_path.c auth.c ecalloc.c emalloc.c erealloc.c estrdup.c \ + extattr.c fparseln.c login.c login_auth.c \ login_cap.c login_class.c login_crypt.c login_ok.c login_times.c \ login_tty.c logout.c logwtmp.c property.c pty.c realhostname.c stub.c \ trimdomain.c uucplock.c @@ -17,6 +18,7 @@ _secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \ realhostname_sa.3 trimdomain.3 fparseln.3 MAN+= login.conf.5 auth.conf.5 +MAN+= emalloc.3 MLINKS+= property.3 properties_read.3 property.3 properties_free.3 MLINKS+= property.3 property_find.3 MLINKS+= auth.3 auth_getval.3 @@ -38,5 +40,6 @@ MLINKS+=login_auth.3 auth_checknologin.3 login_auth.3 auth_cat.3 MLINKS+=uucplock.3 uu_lock.3 uucplock.3 uu_lock_txfr.3 \ uucplock.3 uu_unlock.3 uucplock.3 uu_lockerr.3 +MLINKS+=emalloc.3 ecalloc.3 erealloc.3 estrdup.3 .include Index: lib/libutil/libutil.h =================================================================== RCS file: /home/ncvs/src/lib/libutil/libutil.h,v retrieving revision 1.32 diff -u -w -r1.32 libutil.h --- lib/libutil/libutil.h 2001/03/22 04:05:40 1.32 +++ lib/libutil/libutil.h 2001/06/17 10:35:27 @@ -76,6 +76,10 @@ #ifdef _STDIO_H_ /* avoid adding new includes */ char *fparseln __P((FILE *, size_t *, size_t *, const char[3], int)); #endif +void *emalloc (size_t); +void *ecalloc (size_t, size_t); +void *erealloc (void *, size_t); +char *estrdup (const char *); __END_DECLS #define UU_LOCK_INUSE (1) Index: sbin/fsck/Makefile =================================================================== RCS file: /home/ncvs/src/sbin/fsck/Makefile,v retrieving revision 1.9 diff -u -w -r1.9 Makefile --- sbin/fsck/Makefile 2001/03/26 14:33:01 1.9 +++ sbin/fsck/Makefile 2001/06/17 10:35:29 @@ -5,4 +5,7 @@ SRCS= fsck.c fsutil.c preen.c MAN= fsck.8 +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: sbin/fsck/fsutil.c =================================================================== RCS file: /home/ncvs/src/sbin/fsck/fsutil.c,v retrieving revision 1.2 diff -u -w -r1.2 fsutil.c --- sbin/fsck/fsutil.c 2001/04/25 07:18:22 1.2 +++ sbin/fsck/fsutil.c 2001/06/17 10:35:33 @@ -56,6 +56,7 @@ #include #include #include +#include #include "fsutil.h" @@ -364,43 +365,3 @@ return (origname); } #endif - - -void * -emalloc(s) - size_t s; -{ - void *p; - - p = malloc(s); - if (p == NULL) - err(1, "malloc failed"); - return (p); -} - - -void * -erealloc(p, s) - void *p; - size_t s; -{ - void *q; - - q = realloc(p, s); - if (q == NULL) - err(1, "realloc failed"); - return (q); -} - - -char * -estrdup(s) - const char *s; -{ - char *p; - - p = strdup(s); - if (p == NULL) - err(1, "strdup failed"); - return (p); -} Index: usr.bin/column/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/column/Makefile,v retrieving revision 1.2 diff -u -w -r1.2 Makefile --- usr.bin/column/Makefile 1998/12/06 22:58:18 1.2 +++ usr.bin/column/Makefile 2001/06/17 10:35:42 @@ -3,4 +3,7 @@ PROG= column CFLAGS+=-Wall +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/column/column.c =================================================================== RCS file: /home/ncvs/src/usr.bin/column/column.c,v retrieving revision 1.5 diff -u -w -r1.5 column.c --- usr.bin/column/column.c 2001/04/03 18:03:29 1.5 +++ usr.bin/column/column.c 2001/06/17 10:35:42 @@ -53,11 +53,11 @@ #include #include #include +#include #define TAB 8 void c_columnate __P((void)); -void *emalloc __P((int)); void input __P((FILE *)); void maketbl __P((void)); void print __P((void)); @@ -216,9 +216,9 @@ TBL *tbl; char **cols; - t = tbl = emalloc(entries * sizeof(TBL)); - cols = emalloc((maxcols = DEFCOLS) * sizeof(char *)); - lens = emalloc(maxcols * sizeof(int)); + t = tbl = ecalloc(entries * sizeof(TBL)); + cols = ecalloc((maxcols = DEFCOLS) * sizeof(char *)); + lens = ecalloc(maxcols * sizeof(int)); for (cnt = 0, lp = list; cnt < entries; ++cnt, ++lp, ++t) { for (coloff = 0, p = *lp; (cols[coloff] = strtok(p, separator)); p = NULL) @@ -232,8 +232,8 @@ 0, DEFCOLS * sizeof(int)); maxcols += DEFCOLS; } - t->list = emalloc(coloff * sizeof(char *)); - t->len = emalloc(coloff * sizeof(int)); + t->list = ecalloc(coloff * sizeof(char *)); + t->len = ecalloc(coloff * sizeof(int)); for (t->cols = coloff; --coloff >= 0;) { t->list[coloff] = cols[coloff]; t->len[coloff] = strlen(cols[coloff]); @@ -261,7 +261,7 @@ char *p, buf[MAXLINELEN]; if (!list) - list = emalloc((maxentry = DEFNUM) * sizeof(char *)); + list = ecalloc((maxentry = DEFNUM) * sizeof(char *)); while (fgets(buf, MAXLINELEN, fp)) { for (p = buf; *p && isspace(*p); ++p); if (!*p) @@ -283,18 +283,6 @@ } list[entries++] = strdup(buf); } -} - -void * -emalloc(size) - int size; -{ - char *p; - - if (!(p = malloc(size))) - err(1, NULL); - memset(p, 0, size); - return (p); } void Index: usr.bin/find/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/find/Makefile,v retrieving revision 1.11 diff -u -w -r1.11 Makefile --- usr.bin/find/Makefile 2001/05/03 18:05:31 1.11 +++ usr.bin/find/Makefile 2001/06/17 10:35:46 @@ -8,4 +8,7 @@ CFLAGS+= -I${.CURDIR}/../../gnu/usr.bin/cvs/lib -DHAVE_CONFIG_H .PATH: ${.CURDIR}/../../contrib/cvs/lib +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/find/extern.h =================================================================== RCS file: /home/ncvs/src/usr.bin/find/extern.h,v retrieving revision 1.13 diff -u -w -r1.13 extern.h --- usr.bin/find/extern.h 2001/05/03 18:05:33 1.13 +++ usr.bin/find/extern.h 2001/06/17 10:35:46 @@ -37,7 +37,6 @@ #include void brace_subst __P((char *, char **, char *, int)); -void *emalloc __P((unsigned int)); PLAN *find_create __P((char ***)); int find_execute __P((PLAN *, char **)); PLAN *find_formplan __P((char **)); Index: usr.bin/find/function.c =================================================================== RCS file: /home/ncvs/src/usr.bin/find/function.c,v retrieving revision 1.30 diff -u -w -r1.30 function.c --- usr.bin/find/function.c 2001/05/03 18:05:34 1.30 +++ usr.bin/find/function.c 2001/06/17 10:35:46 @@ -62,6 +62,7 @@ #include #include #include +#include #include "find.h" Index: usr.bin/find/misc.c =================================================================== RCS file: /home/ncvs/src/usr.bin/find/misc.c,v retrieving revision 1.3 diff -u -w -r1.3 misc.c --- usr.bin/find/misc.c 2000/06/12 11:12:41 1.3 +++ usr.bin/find/misc.c 2001/06/17 10:35:46 @@ -115,18 +115,3 @@ } return (first == 'y'); } - -/* - * emalloc -- - * malloc with error checking. - */ -void * -emalloc(len) - u_int len; -{ - void *p; - - if ((p = malloc(len)) == NULL) - err(1, NULL); - return (p); -} Index: usr.bin/hexdump/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/hexdump/Makefile,v retrieving revision 1.4 diff -u -w -r1.4 Makefile --- usr.bin/hexdump/Makefile 2001/03/27 10:51:45 1.4 +++ usr.bin/hexdump/Makefile 2001/06/17 10:35:48 @@ -8,4 +8,7 @@ LINKS= ${BINDIR}/hexdump ${BINDIR}/od LINKS+= ${BINDIR}/hexdump ${BINDIR}/hd +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/hexdump/display.c =================================================================== RCS file: /home/ncvs/src/usr.bin/hexdump/display.c,v retrieving revision 1.6 diff -u -w -r1.6 display.c --- usr.bin/hexdump/display.c 2000/07/10 09:07:04 1.6 +++ usr.bin/hexdump/display.c 2001/06/17 10:35:48 @@ -48,6 +48,7 @@ #include #include #include +#include #include "hexdump.h" enum _vflag vflag = FIRST; @@ -238,8 +239,8 @@ u_char *tmpp; if (!curp) { - curp = emalloc(blocksize); - savp = emalloc(blocksize); + curp = ecalloc(blocksize); + savp = ecalloc(blocksize); } else { tmpp = curp; curp = savp; @@ -365,22 +366,4 @@ address += cnt; skip -= cnt; } -} - -void * -emalloc(size) - int size; -{ - void *p; - - if ((p = malloc((u_int)size)) == NULL) - nomem(); - bzero(p, size); - return(p); -} - -void -nomem() -{ - err(1, NULL); } Index: usr.bin/make/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/make/Makefile,v retrieving revision 1.19 diff -u -w -r1.19 Makefile --- usr.bin/make/Makefile 2001/05/18 09:05:56 1.19 +++ usr.bin/make/Makefile 2001/06/17 10:35:52 @@ -30,4 +30,7 @@ .error "MAKE_SHELL must be set to one of \"csh\", \"sh\" or \"ksh\"." .endif +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/make/main.c =================================================================== RCS file: /home/ncvs/src/usr.bin/make/main.c,v retrieving revision 1.49 diff -u -w -r1.49 main.c --- usr.bin/make/main.c 2001/04/25 14:44:41 1.49 +++ usr.bin/make/main.c 2001/06/17 10:35:52 @@ -1242,60 +1242,6 @@ } /* - * emalloc -- - * malloc, but die on error. - */ -void * -emalloc(len) - size_t len; -{ - void *p; - - if ((p = malloc(len)) == NULL) - enomem(); - return(p); -} - -/* - * estrdup -- - * strdup, but die on error. - */ -char * -estrdup(str) - const char *str; -{ - char *p; - - if ((p = strdup(str)) == NULL) - enomem(); - return(p); -} - -/* - * erealloc -- - * realloc, but die on error. - */ -void * -erealloc(ptr, size) - void *ptr; - size_t size; -{ - if ((ptr = realloc(ptr, size)) == NULL) - enomem(); - return(ptr); -} - -/* - * enomem -- - * die when out of memory. - */ -void -enomem() -{ - err(2, NULL); -} - -/* * enunlink -- * Remove a file carefully, avoiding directories. */ Index: usr.bin/make/make.h =================================================================== RCS file: /home/ncvs/src/usr.bin/make/make.h,v retrieving revision 1.15 diff -u -w -r1.15 make.h --- usr.bin/make/make.h 2001/01/21 08:24:41 1.15 +++ usr.bin/make/make.h 2001/06/17 10:35:53 @@ -76,6 +76,7 @@ #include #include #endif +#include #include "sprite.h" #include "lst.h" #include "config.h" Index: usr.bin/nm/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/nm/Makefile,v retrieving revision 1.4 diff -u -w -r1.4 Makefile --- usr.bin/nm/Makefile 2001/03/27 10:51:53 1.4 +++ usr.bin/nm/Makefile 2001/06/17 10:35:53 @@ -5,4 +5,7 @@ BINDIR= /usr/libexec/aout MAN= nm.1aout +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/nm/nm.c =================================================================== RCS file: /home/ncvs/src/usr.bin/nm/nm.c,v retrieving revision 1.15 diff -u -w -r1.15 nm.c --- usr.bin/nm/nm.c 2001/02/06 11:21:21 1.15 +++ usr.bin/nm/nm.c 2001/06/17 10:35:53 @@ -60,6 +60,7 @@ #include #include #include +#include int ignore_bad_archive_entries = 1; int print_only_external_symbols; @@ -79,7 +80,6 @@ #define SYMBOL_TYPE(x) ((x) & (N_TYPE | N_STAB)) #define SYMBOL_BIND(x) (((x) >> 4) & 0xf) -void *emalloc(); static void usage __P(( void )); int process_file __P(( char * )); int show_archive __P(( char *, FILE * )); @@ -652,18 +652,6 @@ return(fname(a0, b0)); return(a->n_value > b->n_value ? 1 : -1); } -} - -void * -emalloc(size) - size_t size; -{ - char *p; - - /* NOSTRICT */ - if ( (p = malloc(size)) ) - return(p); - err(1, NULL); } static void Index: usr.bin/ranlib/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/ranlib/Makefile,v retrieving revision 1.8 diff -u -w -r1.8 Makefile --- usr.bin/ranlib/Makefile 2001/03/27 10:52:05 1.8 +++ usr.bin/ranlib/Makefile 2001/06/17 10:35:53 @@ -8,4 +8,7 @@ BINDIR= /usr/libexec/aout VPATH= ${.CURDIR}/../ar +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/ranlib/build.c =================================================================== RCS file: /home/ncvs/src/usr.bin/ranlib/build.c,v retrieving revision 1.7 diff -u -w -r1.7 build.c --- usr.bin/ranlib/build.c 1999/08/28 01:05:01 1.7 +++ usr.bin/ranlib/build.c 2001/06/17 10:35:53 @@ -54,6 +54,7 @@ #include #include #include +#include #include "archive.h" @@ -143,7 +144,6 @@ struct nlist nl; off_t r_off, w_off; long strsize; - void *emalloc(); /* Get current offsets for original and tmp files. */ r_off = lseek(rfd, (off_t)0, SEEK_CUR); Index: usr.bin/ranlib/misc.c =================================================================== RCS file: /home/ncvs/src/usr.bin/ranlib/misc.c,v retrieving revision 1.5 diff -u -w -r1.5 misc.c --- usr.bin/ranlib/misc.c 1999/08/28 01:05:02 1.5 +++ usr.bin/ranlib/misc.c 2001/06/17 10:35:53 @@ -79,17 +79,6 @@ return(fd); } -void * -emalloc(len) - int len; -{ - void *p; - - if ((p = malloc((u_int)len)) == NULL) - error(archive); - return(p); -} - char * rname(path) char *path; --- /dev/null Sun Jun 17 13:11:36 2001 +++ lib/libutil/ecalloc.c Sun Jun 17 12:51:10 2001 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2001 Assar Westerlund + * 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$ + */ + +#include +#include + +#include +#include "libutil.h" + +/* + * Like calloc but never fails. + */ + +void * +ecalloc (size_t number, size_t size) +{ + void *tmp = calloc (number, size); + + if (tmp == NULL && number * size != 0) + errx (1, "calloc %lu failed", (unsigned long)number * size); + return tmp; +} --- /dev/null Sun Jun 17 13:11:36 2001 +++ lib/libutil/emalloc.c Sun Jun 17 12:51:20 2001 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2001 Assar Westerlund + * 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$ + */ + +#include +#include + +#include +#include "libutil.h" + +/* + * Like malloc but never fails. + */ + +void * +emalloc (size_t sz) +{ + void *tmp = malloc (sz); + + if (tmp == NULL && sz != 0) + errx (1, "malloc %lu failed", (unsigned long)sz); + return tmp; +} --- /dev/null Sun Jun 17 13:11:36 2001 +++ lib/libutil/estrdup.c Sun Jun 17 13:09:27 2001 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2001 Assar Westerlund + * 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$ + */ + +#include +#include +#include + +#include +#include "libutil.h" + +/* + * Like strdup but never fails. + */ + +char * +estrdup (const char *str) +{ + void *tmp = strdup(str); + + if (tmp == NULL) + errx (1, "strdup"); + return tmp; +} --- /dev/null Sun Jun 17 13:11:36 2001 +++ lib/libutil/erealloc.c Sun Jun 17 12:51:14 2001 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2001 Assar Westerlund + * 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$ + */ + +#include +#include + +#include +#include "libutil.h" + +/* + * Like realloc but never fails. + */ + +void * +erealloc (void *ptr, size_t sz) +{ + void *tmp = realloc (ptr, sz); + + if (tmp == NULL && sz != 0) + errx (1, "realloc %lu failed", (unsigned long)sz); + return tmp; +} --- /dev/null Sun Jun 17 13:11:36 2001 +++ lib/libutil/emalloc.3 Sun Jun 17 12:51:33 2001 @@ -0,0 +1,64 @@ +.\" Copyright (c) 2001 Assar Westerlund +.\" 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 June 17, 2001 +.Os +.Dt EMALLOC 3 +.Sh NAME +.Nm emalloc , ecalloc , erealloc , estrdup +.Nd non-failing memory allocation functions +.Sh LIBRARY +.Lb libutil +.Sh SYNOPSIS +.Fd #include +.Fd #include +.Ft void * +.Fn emalloc "size_t size" +.Ft void * +.Fn ecalloc "size_t number" "size_t size" +.Ft void * +.Fn erealloc "void *ptr" "size_t size" +.Ft char * +.Fn estrdup "const char *str" +.Sh DESCRIPTION +These functions work as +.Fn malloc , +.Fn calloc , +.Fn realloc , +and +.Fn strdup , +except that they never return +.Dv NULL , +but instead call +.Fn errx +to abort the program if memory allocation fails. +.Sh SEE ALSO +.Xr malloc 3 , +.Xr calloc 3 , +.Xr realloc 3 , +.Xr strdup 3 , +.Xr errx 3 --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 17 7:28:55 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 1D45D37B401; Sun, 17 Jun 2001 07:28:51 -0700 (PDT) (envelope-from jlemon@flugsvamp.com) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id f5HESH045428; Sun, 17 Jun 2001 09:28:17 -0500 (CDT) (envelope-from jlemon) Date: Sun, 17 Jun 2001 09:28:17 -0500 From: Jonathan Lemon To: Assar Westerlund Cc: freebsd-audit@freebsd.org, jlemon@freebsd.org Subject: Re: GLOB_LIMIT vs GLOB_MAXPATH Message-ID: <20010617092817.M68883@prism.flugsvamp.com> References: <5ld783cvnq.fsf@assaris.sics.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <5ld783cvnq.fsf@assaris.sics.se> 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 Sun, Jun 17, 2001 at 11:17:45AM +0200, Assar Westerlund wrote: > The GLOB_MAXPATH flag to glob(3) does the same thing as the GLOB_LIMIT > one in NetBSD and OpenBSD (except for the default limit). Since this > is mostly used by ftpd and has been in the tree for a short amount of > time, I think it makes sense to keep it compatible with the other > BSDs. Enclosed is a patch that does this. Comments? I don't really care about the name. However, I'm not sure if they are the same thing; GLOB_MAXPATH limits the number of returned paths that glob(3) will return. Does GLOB_LIMIT do the same, or does it limit the number of *bytes* that are returned? If GLOB_LIMIT is a count of pathnames, then I have no objections to the change, otherwise things should stay the same. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 17 17:58: 7 2001 Delivered-To: freebsd-audit@freebsd.org Received: from assaris.sics.se (dhcp-221-128.pdc.kth.se [130.237.221.128]) by hub.freebsd.org (Postfix) with ESMTP id 4F9A137B405; Sun, 17 Jun 2001 17:58:01 -0700 (PDT) (envelope-from assar@assaris.sics.se) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id CAA38434; Mon, 18 Jun 2001 02:58:00 +0200 (CEST) (envelope-from assar) From: Assar Westerlund To: Jonathan Lemon Cc: freebsd-audit@freebsd.org, jlemon@freebsd.org Subject: Re: GLOB_LIMIT vs GLOB_MAXPATH References: <5ld783cvnq.fsf@assaris.sics.se> <20010617092817.M68883@prism.flugsvamp.com> Date: 18 Jun 2001 02:57:57 +0200 In-Reply-To: Jonathan Lemon's message of "Sun, 17 Jun 2001 09:28:17 -0500" Message-ID: <5llmmqtxii.fsf@assaris.sics.se> Lines: 16 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 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 Jonathan Lemon writes: > I don't really care about the name. However, I'm not sure if they > are the same thing; GLOB_MAXPATH limits the number of returned paths > that glob(3) will return. Does GLOB_LIMIT do the same, or does it > limit the number of *bytes* that are returned? GLOB_LIMIT in NetBSD and OpenBSD limits the number of matches or returned paths, so I think they are the same thing. The difference is that in NetBSD/OpenBSD the limit is fixed and hence there is no way (as in FreeBSD) to set the limit at `n' matches. Hence my patch setting limit to a default value if `gl_matchc == 0'. The other issue is if we should leave GLOB_MAXPATH as an alias. After all, this functionality was included in 4.3. /assar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Jun 17 18:22:16 2001 Delivered-To: freebsd-audit@freebsd.org Received: from assaris.sics.se (dhcp-221-128.pdc.kth.se [130.237.221.128]) by hub.freebsd.org (Postfix) with ESMTP id DE84D37B401 for ; Sun, 17 Jun 2001 18:21:15 -0700 (PDT) (envelope-from assar@assaris.sics.se) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id DAA38508; Mon, 18 Jun 2001 03:21:21 +0200 (CEST) (envelope-from assar) From: Assar Westerlund To: freebsd-audit@freebsd.org Subject: Re: duplicate copies of emalloc to libutil? References: <5ld783bafb.fsf@assaris.sics.se> Date: 18 Jun 2001 03:21:20 +0200 In-Reply-To: Assar Westerlund's message of "17 Jun 2001 13:41:44 +0200" Message-ID: <5ld782twfj.fsf@assaris.sics.se> Lines: 8 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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 wrote: > Any comments? New and improved patch below. /assar --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=fbsd.diff Index: lib/libutil/Makefile =================================================================== RCS file: /home/ncvs/src/lib/libutil/Makefile,v retrieving revision 1.41 diff -u -w -r1.41 Makefile --- lib/libutil/Makefile 2001/05/18 13:41:23 1.41 +++ lib/libutil/Makefile 2001/06/18 01:02:32 @@ -6,7 +6,8 @@ SHLIB_MINOR= 0 CFLAGS+=-Wall -DLIBC_SCCS -I${.CURDIR} CFLAGS+=-DINET6 -SRCS= _secure_path.c auth.c extattr.c fparseln.c login.c login_auth.c \ +SRCS= _secure_path.c auth.c ecalloc.c emalloc.c erealloc.c estrdup.c \ + extattr.c fparseln.c login.c login_auth.c \ login_cap.c login_class.c login_crypt.c login_ok.c login_times.c \ login_tty.c logout.c logwtmp.c property.c pty.c realhostname.c stub.c \ trimdomain.c uucplock.c @@ -17,6 +18,7 @@ _secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \ realhostname_sa.3 trimdomain.3 fparseln.3 MAN+= login.conf.5 auth.conf.5 +MAN+= emalloc.3 MLINKS+= property.3 properties_read.3 property.3 properties_free.3 MLINKS+= property.3 property_find.3 MLINKS+= auth.3 auth_getval.3 @@ -38,5 +40,6 @@ MLINKS+=login_auth.3 auth_checknologin.3 login_auth.3 auth_cat.3 MLINKS+=uucplock.3 uu_lock.3 uucplock.3 uu_lock_txfr.3 \ uucplock.3 uu_unlock.3 uucplock.3 uu_lockerr.3 +MLINKS+=emalloc.3 ecalloc.3 erealloc.3 estrdup.3 .include Index: lib/libutil/libutil.h =================================================================== RCS file: /home/ncvs/src/lib/libutil/libutil.h,v retrieving revision 1.32 diff -u -w -r1.32 libutil.h --- lib/libutil/libutil.h 2001/03/22 04:05:40 1.32 +++ lib/libutil/libutil.h 2001/06/18 01:02:32 @@ -76,6 +76,10 @@ #ifdef _STDIO_H_ /* avoid adding new includes */ char *fparseln __P((FILE *, size_t *, size_t *, const char[3], int)); #endif +void *emalloc (size_t); +void *ecalloc (size_t, size_t); +void *erealloc (void *, size_t); +char *estrdup (const char *); __END_DECLS #define UU_LOCK_INUSE (1) Index: sbin/fsck/Makefile =================================================================== RCS file: /home/ncvs/src/sbin/fsck/Makefile,v retrieving revision 1.9 diff -u -w -r1.9 Makefile --- sbin/fsck/Makefile 2001/03/26 14:33:01 1.9 +++ sbin/fsck/Makefile 2001/06/18 01:02:33 @@ -5,4 +5,7 @@ SRCS= fsck.c fsutil.c preen.c MAN= fsck.8 +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: sbin/fsck/fsutil.c =================================================================== RCS file: /home/ncvs/src/sbin/fsck/fsutil.c,v retrieving revision 1.2 diff -u -w -r1.2 fsutil.c --- sbin/fsck/fsutil.c 2001/04/25 07:18:22 1.2 +++ sbin/fsck/fsutil.c 2001/06/18 01:02:40 @@ -56,6 +56,7 @@ #include #include #include +#include #include "fsutil.h" @@ -364,43 +365,3 @@ return (origname); } #endif - - -void * -emalloc(s) - size_t s; -{ - void *p; - - p = malloc(s); - if (p == NULL) - err(1, "malloc failed"); - return (p); -} - - -void * -erealloc(p, s) - void *p; - size_t s; -{ - void *q; - - q = realloc(p, s); - if (q == NULL) - err(1, "realloc failed"); - return (q); -} - - -char * -estrdup(s) - const char *s; -{ - char *p; - - p = strdup(s); - if (p == NULL) - err(1, "strdup failed"); - return (p); -} Index: usr.bin/column/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/column/Makefile,v retrieving revision 1.2 diff -u -w -r1.2 Makefile --- usr.bin/column/Makefile 1998/12/06 22:58:18 1.2 +++ usr.bin/column/Makefile 2001/06/18 01:02:59 @@ -3,4 +3,7 @@ PROG= column CFLAGS+=-Wall +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/column/column.c =================================================================== RCS file: /home/ncvs/src/usr.bin/column/column.c,v retrieving revision 1.5 diff -u -w -r1.5 column.c --- usr.bin/column/column.c 2001/04/03 18:03:29 1.5 +++ usr.bin/column/column.c 2001/06/18 01:02:59 @@ -53,11 +53,11 @@ #include #include #include +#include #define TAB 8 void c_columnate __P((void)); -void *emalloc __P((int)); void input __P((FILE *)); void maketbl __P((void)); void print __P((void)); @@ -216,9 +216,9 @@ TBL *tbl; char **cols; - t = tbl = emalloc(entries * sizeof(TBL)); - cols = emalloc((maxcols = DEFCOLS) * sizeof(char *)); - lens = emalloc(maxcols * sizeof(int)); + t = tbl = ecalloc(entries, sizeof(TBL)); + cols = ecalloc((maxcols = DEFCOLS), sizeof(char *)); + lens = ecalloc(maxcols, sizeof(int)); for (cnt = 0, lp = list; cnt < entries; ++cnt, ++lp, ++t) { for (coloff = 0, p = *lp; (cols[coloff] = strtok(p, separator)); p = NULL) @@ -232,8 +232,8 @@ 0, DEFCOLS * sizeof(int)); maxcols += DEFCOLS; } - t->list = emalloc(coloff * sizeof(char *)); - t->len = emalloc(coloff * sizeof(int)); + t->list = ecalloc(coloff, sizeof(char *)); + t->len = ecalloc(coloff, sizeof(int)); for (t->cols = coloff; --coloff >= 0;) { t->list[coloff] = cols[coloff]; t->len[coloff] = strlen(cols[coloff]); @@ -261,7 +261,7 @@ char *p, buf[MAXLINELEN]; if (!list) - list = emalloc((maxentry = DEFNUM) * sizeof(char *)); + list = ecalloc((maxentry = DEFNUM), sizeof(char *)); while (fgets(buf, MAXLINELEN, fp)) { for (p = buf; *p && isspace(*p); ++p); if (!*p) @@ -283,18 +283,6 @@ } list[entries++] = strdup(buf); } -} - -void * -emalloc(size) - int size; -{ - char *p; - - if (!(p = malloc(size))) - err(1, NULL); - memset(p, 0, size); - return (p); } void Index: usr.bin/find/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/find/Makefile,v retrieving revision 1.11 diff -u -w -r1.11 Makefile --- usr.bin/find/Makefile 2001/05/03 18:05:31 1.11 +++ usr.bin/find/Makefile 2001/06/18 01:03:00 @@ -8,4 +8,7 @@ CFLAGS+= -I${.CURDIR}/../../gnu/usr.bin/cvs/lib -DHAVE_CONFIG_H .PATH: ${.CURDIR}/../../contrib/cvs/lib +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/find/extern.h =================================================================== RCS file: /home/ncvs/src/usr.bin/find/extern.h,v retrieving revision 1.13 diff -u -w -r1.13 extern.h --- usr.bin/find/extern.h 2001/05/03 18:05:33 1.13 +++ usr.bin/find/extern.h 2001/06/18 01:03:00 @@ -37,7 +37,6 @@ #include void brace_subst __P((char *, char **, char *, int)); -void *emalloc __P((unsigned int)); PLAN *find_create __P((char ***)); int find_execute __P((PLAN *, char **)); PLAN *find_formplan __P((char **)); Index: usr.bin/find/function.c =================================================================== RCS file: /home/ncvs/src/usr.bin/find/function.c,v retrieving revision 1.30 diff -u -w -r1.30 function.c --- usr.bin/find/function.c 2001/05/03 18:05:34 1.30 +++ usr.bin/find/function.c 2001/06/18 01:03:00 @@ -62,6 +62,7 @@ #include #include #include +#include #include "find.h" Index: usr.bin/find/misc.c =================================================================== RCS file: /home/ncvs/src/usr.bin/find/misc.c,v retrieving revision 1.3 diff -u -w -r1.3 misc.c --- usr.bin/find/misc.c 2000/06/12 11:12:41 1.3 +++ usr.bin/find/misc.c 2001/06/18 01:03:00 @@ -115,18 +115,3 @@ } return (first == 'y'); } - -/* - * emalloc -- - * malloc with error checking. - */ -void * -emalloc(len) - u_int len; -{ - void *p; - - if ((p = malloc(len)) == NULL) - err(1, NULL); - return (p); -} Index: usr.bin/hexdump/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/hexdump/Makefile,v retrieving revision 1.4 diff -u -w -r1.4 Makefile --- usr.bin/hexdump/Makefile 2001/03/27 10:51:45 1.4 +++ usr.bin/hexdump/Makefile 2001/06/18 01:03:01 @@ -8,4 +8,7 @@ LINKS= ${BINDIR}/hexdump ${BINDIR}/od LINKS+= ${BINDIR}/hexdump ${BINDIR}/hd +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/hexdump/display.c =================================================================== RCS file: /home/ncvs/src/usr.bin/hexdump/display.c,v retrieving revision 1.6 diff -u -w -r1.6 display.c --- usr.bin/hexdump/display.c 2000/07/10 09:07:04 1.6 +++ usr.bin/hexdump/display.c 2001/06/18 01:03:01 @@ -48,6 +48,7 @@ #include #include #include +#include #include "hexdump.h" enum _vflag vflag = FIRST; @@ -238,8 +239,8 @@ u_char *tmpp; if (!curp) { - curp = emalloc(blocksize); - savp = emalloc(blocksize); + curp = ecalloc(blocksize, 1); + savp = ecalloc(blocksize, 1); } else { tmpp = curp; curp = savp; @@ -365,22 +366,4 @@ address += cnt; skip -= cnt; } -} - -void * -emalloc(size) - int size; -{ - void *p; - - if ((p = malloc((u_int)size)) == NULL) - nomem(); - bzero(p, size); - return(p); -} - -void -nomem() -{ - err(1, NULL); } Index: usr.bin/hexdump/hexdump.h =================================================================== RCS file: /home/ncvs/src/usr.bin/hexdump/hexdump.h,v retrieving revision 1.2 diff -u -w -r1.2 hexdump.h --- usr.bin/hexdump/hexdump.h 1997/07/10 06:48:18 1.2 +++ usr.bin/hexdump/hexdump.h 2001/06/18 01:03:01 @@ -85,12 +85,10 @@ void conv_u __P((PR *, u_char *)); void display __P((void)); void doskip __P((char *, int)); -void *emalloc __P((int)); void escape __P((char *)); u_char *get __P((void)); void newsyntax __P((int, char ***)); int next __P((char **)); -void nomem __P((void)); void oldsyntax __P((int, char ***)); void rewrite __P((FS *)); int size __P((FS *)); Index: usr.bin/hexdump/parse.c =================================================================== RCS file: /home/ncvs/src/usr.bin/hexdump/parse.c,v retrieving revision 1.4 diff -u -w -r1.4 parse.c --- usr.bin/hexdump/parse.c 1999/08/28 01:02:03 1.4 +++ usr.bin/hexdump/parse.c 2001/06/18 01:03:02 @@ -140,8 +140,7 @@ for (savep = ++p; *p != '"';) if (*p++ == 0) badfmt(fmt); - if (!(tfu->fmt = malloc(p - savep + 1))) - nomem(); + tfu->fmt = emalloc(p - savep + 1); (void) strncpy(tfu->fmt, savep, p - savep); tfu->fmt[p - savep] = '\0'; escape(tfu->fmt); Index: usr.bin/make/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/make/Makefile,v retrieving revision 1.19 diff -u -w -r1.19 Makefile --- usr.bin/make/Makefile 2001/05/18 09:05:56 1.19 +++ usr.bin/make/Makefile 2001/06/18 01:03:07 @@ -30,4 +30,7 @@ .error "MAKE_SHELL must be set to one of \"csh\", \"sh\" or \"ksh\"." .endif +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/make/main.c =================================================================== RCS file: /home/ncvs/src/usr.bin/make/main.c,v retrieving revision 1.49 diff -u -w -r1.49 main.c --- usr.bin/make/main.c 2001/04/25 14:44:41 1.49 +++ usr.bin/make/main.c 2001/06/18 01:03:07 @@ -1242,60 +1242,6 @@ } /* - * emalloc -- - * malloc, but die on error. - */ -void * -emalloc(len) - size_t len; -{ - void *p; - - if ((p = malloc(len)) == NULL) - enomem(); - return(p); -} - -/* - * estrdup -- - * strdup, but die on error. - */ -char * -estrdup(str) - const char *str; -{ - char *p; - - if ((p = strdup(str)) == NULL) - enomem(); - return(p); -} - -/* - * erealloc -- - * realloc, but die on error. - */ -void * -erealloc(ptr, size) - void *ptr; - size_t size; -{ - if ((ptr = realloc(ptr, size)) == NULL) - enomem(); - return(ptr); -} - -/* - * enomem -- - * die when out of memory. - */ -void -enomem() -{ - err(2, NULL); -} - -/* * enunlink -- * Remove a file carefully, avoiding directories. */ Index: usr.bin/make/make.h =================================================================== RCS file: /home/ncvs/src/usr.bin/make/make.h,v retrieving revision 1.15 diff -u -w -r1.15 make.h --- usr.bin/make/make.h 2001/01/21 08:24:41 1.15 +++ usr.bin/make/make.h 2001/06/18 01:03:07 @@ -76,6 +76,7 @@ #include #include #endif +#include #include "sprite.h" #include "lst.h" #include "config.h" Index: usr.bin/make/nonints.h =================================================================== RCS file: /home/ncvs/src/usr.bin/make/nonints.h,v retrieving revision 1.9 diff -u -w -r1.9 nonints.h --- usr.bin/make/nonints.h 2000/12/02 20:24:38 1.9 +++ usr.bin/make/nonints.h 2001/06/18 01:03:07 @@ -71,13 +71,9 @@ void DieHorribly __P((void)); int PrintAddr __P((void *, void *)); void Finish __P((int)); -char *estrdup __P((const char *)); -void *emalloc __P((size_t)); /* efree(x) works when x==NULL. STDC behavior, may need some different * definition for cross-builds on deficient systems */ #define efree free -void *erealloc __P((void *, size_t)); -void enomem __P((void)); int eunlink __P((const char *)); /* parse.c */ Index: usr.bin/nm/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/nm/Makefile,v retrieving revision 1.4 diff -u -w -r1.4 Makefile --- usr.bin/nm/Makefile 2001/03/27 10:51:53 1.4 +++ usr.bin/nm/Makefile 2001/06/18 01:03:10 @@ -5,4 +5,7 @@ BINDIR= /usr/libexec/aout MAN= nm.1aout +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/nm/nm.c =================================================================== RCS file: /home/ncvs/src/usr.bin/nm/nm.c,v retrieving revision 1.15 diff -u -w -r1.15 nm.c --- usr.bin/nm/nm.c 2001/02/06 11:21:21 1.15 +++ usr.bin/nm/nm.c 2001/06/18 01:03:10 @@ -60,6 +60,7 @@ #include #include #include +#include int ignore_bad_archive_entries = 1; int print_only_external_symbols; @@ -79,7 +80,6 @@ #define SYMBOL_TYPE(x) ((x) & (N_TYPE | N_STAB)) #define SYMBOL_BIND(x) (((x) >> 4) & 0xf) -void *emalloc(); static void usage __P(( void )); int process_file __P(( char * )); int show_archive __P(( char *, FILE * )); @@ -652,18 +652,6 @@ return(fname(a0, b0)); return(a->n_value > b->n_value ? 1 : -1); } -} - -void * -emalloc(size) - size_t size; -{ - char *p; - - /* NOSTRICT */ - if ( (p = malloc(size)) ) - return(p); - err(1, NULL); } static void Index: usr.bin/ranlib/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/ranlib/Makefile,v retrieving revision 1.8 diff -u -w -r1.8 Makefile --- usr.bin/ranlib/Makefile 2001/03/27 10:52:05 1.8 +++ usr.bin/ranlib/Makefile 2001/06/18 01:03:10 @@ -8,4 +8,7 @@ BINDIR= /usr/libexec/aout VPATH= ${.CURDIR}/../ar +DPADD= ${LIBUTIL} +LDADD= -lutil + .include Index: usr.bin/ranlib/build.c =================================================================== RCS file: /home/ncvs/src/usr.bin/ranlib/build.c,v retrieving revision 1.7 diff -u -w -r1.7 build.c --- usr.bin/ranlib/build.c 1999/08/28 01:05:01 1.7 +++ usr.bin/ranlib/build.c 2001/06/18 01:03:10 @@ -54,6 +54,7 @@ #include #include #include +#include #include "archive.h" @@ -143,7 +144,6 @@ struct nlist nl; off_t r_off, w_off; long strsize; - void *emalloc(); /* Get current offsets for original and tmp files. */ r_off = lseek(rfd, (off_t)0, SEEK_CUR); Index: usr.bin/ranlib/misc.c =================================================================== RCS file: /home/ncvs/src/usr.bin/ranlib/misc.c,v retrieving revision 1.5 diff -u -w -r1.5 misc.c --- usr.bin/ranlib/misc.c 1999/08/28 01:05:02 1.5 +++ usr.bin/ranlib/misc.c 2001/06/18 01:03:10 @@ -79,17 +79,6 @@ return(fd); } -void * -emalloc(len) - int len; -{ - void *p; - - if ((p = malloc((u_int)len)) == NULL) - error(archive); - return(p); -} - char * rname(path) char *path; --- /dev/null Mon Jun 18 02:00:57 2001 +++ lib/libutil/ecalloc.c Sun Jun 17 14:55:39 2001 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2001 Assar Westerlund + * 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$ + */ + +#include +#include + +#include +#include "libutil.h" + +/* + * Like calloc but never fails. + */ + +void * +ecalloc(size_t number, size_t size) +{ + void *tmp = calloc(number, size); + + if (tmp == NULL && number * size != 0) + errx(1, "calloc %lu failed", (unsigned long)number * size); + return tmp; +} --- /dev/null Mon Jun 18 02:00:57 2001 +++ lib/libutil/emalloc.c Sun Jun 17 14:55:18 2001 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2001 Assar Westerlund + * 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$ + */ + +#include +#include + +#include +#include "libutil.h" + +/* + * Like malloc but never fails. + */ + +void * +emalloc(size_t sz) +{ + void *tmp = malloc(sz); + + if (tmp == NULL && sz != 0) + errx(1, "malloc %lu failed", (unsigned long)sz); + return tmp; +} --- /dev/null Mon Jun 18 02:00:57 2001 +++ lib/libutil/estrdup.c Sun Jun 17 14:55:52 2001 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2001 Assar Westerlund + * 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$ + */ + +#include +#include +#include + +#include +#include "libutil.h" + +/* + * Like strdup but never fails. + */ + +char * +estrdup(const char *str) +{ + void *tmp = strdup(str); + + if (tmp == NULL) + errx(1, "strdup"); + return tmp; +} --- /dev/null Mon Jun 18 02:00:57 2001 +++ lib/libutil/erealloc.c Sun Jun 17 14:55:30 2001 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2001 Assar Westerlund + * 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$ + */ + +#include +#include + +#include +#include "libutil.h" + +/* + * Like realloc but never fails. + */ + +void * +erealloc(void *ptr, size_t sz) +{ + void *tmp = realloc(ptr, sz); + + if (tmp == NULL && sz != 0) + errx(1, "realloc %lu failed", (unsigned long)sz); + return tmp; +} --- /dev/null Mon Jun 18 02:00:57 2001 +++ lib/libutil/emalloc.3 Sun Jun 17 12:51:33 2001 @@ -0,0 +1,64 @@ +.\" Copyright (c) 2001 Assar Westerlund +.\" 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 June 17, 2001 +.Os +.Dt EMALLOC 3 +.Sh NAME +.Nm emalloc , ecalloc , erealloc , estrdup +.Nd non-failing memory allocation functions +.Sh LIBRARY +.Lb libutil +.Sh SYNOPSIS +.Fd #include +.Fd #include +.Ft void * +.Fn emalloc "size_t size" +.Ft void * +.Fn ecalloc "size_t number" "size_t size" +.Ft void * +.Fn erealloc "void *ptr" "size_t size" +.Ft char * +.Fn estrdup "const char *str" +.Sh DESCRIPTION +These functions work as +.Fn malloc , +.Fn calloc , +.Fn realloc , +and +.Fn strdup , +except that they never return +.Dv NULL , +but instead call +.Fn errx +to abort the program if memory allocation fails. +.Sh SEE ALSO +.Xr malloc 3 , +.Xr calloc 3 , +.Xr realloc 3 , +.Xr strdup 3 , +.Xr errx 3 --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 18 5:17:27 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 A9B7337B401; Mon, 18 Jun 2001 05:15:16 -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 f5ICEeX96556; Mon, 18 Jun 2001 15:14:40 +0300 (EEST) (envelope-from ru) Date: Mon, 18 Jun 2001 15:13:24 +0300 From: Ruslan Ermilov To: Peter Pentchev Cc: audit@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path Message-ID: <20010618151324.A94281@sunbay.com> Mail-Followup-To: Peter Pentchev , audit@FreeBSD.ORG, arch@FreeBSD.ORG References: <20010615150639.D94445@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: <20010615150639.D94445@ringworld.oblivion.bg>; from roam@orbitel.bg on Fri, Jun 15, 2001 at 03:06:39PM +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 Fri, Jun 15, 2001 at 03:06:39PM +0300, Peter Pentchev wrote: [...] > XMAN8= kldpath.8 > s/MAN8/MAN/ > X.Os FreeBSD > Leave the .Os empty, it's now handled automatically. > X.It Fl S Ar name > XSpecify the sysctl name to use instead of the default > X.Sy kern.module_path . > s/Sy/Va/ > X.Sh SEE ALSO > X.Xr kldload 2 , > X.Xr kldload 8 , > X.Xr sysctl 8 . > Remove the final "dot". > XThe > X.Nm > Xcommand first appeared in > You should decide: "command" or "utility"? :-) Excuse me, but what's wrong with sysctl(8) editing kern.module_path? 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 Mon Jun 18 5:20: 7 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 BD0E137B408 for ; Mon, 18 Jun 2001 05:20:00 -0700 (PDT) (envelope-from roam@ringworld.nanolink.com) Received: (qmail 24935 invoked by uid 1000); 18 Jun 2001 12:18:31 -0000 Date: Mon, 18 Jun 2001 15:18:31 +0300 From: Peter Pentchev To: audit@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path Message-ID: <20010618151831.J1713@ringworld.oblivion.bg> Mail-Followup-To: audit@FreeBSD.ORG, arch@FreeBSD.ORG References: <20010615150639.D94445@ringworld.oblivion.bg> <20010618151324.A94281@sunbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010618151324.A94281@sunbay.com>; from ru@FreeBSD.ORG on Mon, Jun 18, 2001 at 03:13:24PM +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 Mon, Jun 18, 2001 at 03:13:24PM +0300, Ruslan Ermilov wrote: > > Excuse me, but what's wrong with sysctl(8) editing kern.module_path? Well, as I noted at the start of the message, this is a scripts-friendly utility - it allows adding/removing/inserting individual paths without the need to parse the whole. Thanks for the mdoc fixes! G'luck, Peter -- You have, of course, just begun reading the sentence that you have just finished reading. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 18 11:34:24 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 D2A6C37B401; Mon, 18 Jun 2001 11:34:17 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id UAA50811; Mon, 18 Jun 2001 20:34:15 +0200 (CEST) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Kris Kennaway Cc: audit@freebsd.org Subject: Re: cvs commit: src/usr.sbin/rarpd Makefile rarpd.8 rarpd.c References: <200106180648.f5I6mXw73601@freefall.freebsd.org> <74656.992853414@axl.seasidesoftware.co.za> <20010618092759.C9834@xor.obsecurity.org> From: Dag-Erling Smorgrav Date: 18 Jun 2001 20:34:15 +0200 In-Reply-To: <20010618092759.C9834@xor.obsecurity.org> Message-ID: Lines: 12 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 Kris Kennaway writes: > -audit has turned into the defacto code review mailing list, though it > was originalliy intended only for security audits. Is it really > necessary to send patches to two mailing lists? How about setting up a -review list for general code review, and trying to keep -audit more or less focused on reviews and audits of security-sensitive code? 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 Mon Jun 18 12:17: 3 2001 Delivered-To: freebsd-audit@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id B14CA37B403 for ; Mon, 18 Jun 2001 12:17:00 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id PAA59054; Mon, 18 Jun 2001 15:16:54 -0400 (EDT) (envelope-from wollman) Date: Mon, 18 Jun 2001 15:16:54 -0400 (EDT) From: Garrett Wollman Message-Id: <200106181916.PAA59054@khavrinen.lcs.mit.edu> To: Dag-Erling Smorgrav Cc: audit@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/rarpd Makefile rarpd.8 rarpd.c In-Reply-To: References: <200106180648.f5I6mXw73601@freefall.freebsd.org> <74656.992853414@axl.seasidesoftware.co.za> <20010618092759.C9834@xor.obsecurity.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 < said: > How about setting up a -review list for general code review, and > trying to keep -audit more or less focused on reviews and audits of > security-sensitive code? More unfocused mailing-lists are rarely helpful. Better to post requests for review where the knowledgeable (or affected) people are known to be hanging out. This might be on -net, -bugs, -current, -fs, or any number of other lists, depending on the nature of the change. In other words, it's reasonable to expect developers to be able to use their heads and think for a moment about who will be affected by a change. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 18 17:19:45 2001 Delivered-To: freebsd-audit@freebsd.org Received: from point.osg.gov.bc.ca (point.osg.gov.bc.ca [142.32.102.44]) by hub.freebsd.org (Postfix) with ESMTP id 75E6137B401; Mon, 18 Jun 2001 17:19:40 -0700 (PDT) (envelope-from Cy.Schubert@uumail.gov.bc.ca) Received: (from daemon@localhost) by point.osg.gov.bc.ca (8.8.7/8.8.8) id RAA21612; Mon, 18 Jun 2001 17:19:36 -0700 Received: from passer.osg.gov.bc.ca(142.32.110.29) via SMTP by point.osg.gov.bc.ca, id smtpda21610; Mon Jun 18 17:19:20 2001 Received: (from uucp@localhost) by passer.osg.gov.bc.ca (8.11.4/8.9.1) id f5J0JET63799; Mon, 18 Jun 2001 17:19:14 -0700 (PDT) Received: from UNKNOWN(10.1.2.1), claiming to be "cwsys.cwsent.com" via SMTP by passer9.cwsent.com, id smtpdf63797; Mon Jun 18 17:18:33 2001 Received: (from uucp@localhost) by cwsys.cwsent.com (8.11.4/8.9.1) id f5J0H8R17337; Mon, 18 Jun 2001 17:17:08 -0700 (PDT) Message-Id: <200106190017.f5J0H8R17337@cwsys.cwsent.com> Received: from localhost.cwsent.com(127.0.0.1), claiming to be "cwsys" via SMTP by localhost.cwsent.com, id smtpdR17333; Mon Jun 18 17:16:46 2001 X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 Reply-To: Cy Schubert - ITSD Open Systems Group From: Cy Schubert - ITSD Open Systems Group X-Sender: schubert To: Peter Pentchev Cc: audit@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path In-reply-to: Your message of "Mon, 18 Jun 2001 15:18:31 +0300." <20010618151831.J1713@ringworld.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 18 Jun 2001 17:16:46 -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 In message <20010618151831.J1713@ringworld.oblivion.bg>, Peter Pentchev writes: > On Mon, Jun 18, 2001 at 03:13:24PM +0300, Ruslan Ermilov wrote: > > > > Excuse me, but what's wrong with sysctl(8) editing kern.module_path? > > Well, as I noted at the start of the message, this is a scripts-friendly > utility - it allows adding/removing/inserting individual paths without > the need to parse the whole. But it could be a script friendly Perl script that calls sysctl. Right? Regards, Phone: (250)387-8437 Cy Schubert Fax: (250)387-5766 Team Leader, Sun/Alpha Team Internet: Cy.Schubert@osg.gov.bc.ca Open Systems Group, ITSD, ISTA Province of BC To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Jun 18 17:53:50 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 6043537B401 for ; Mon, 18 Jun 2001 17:53:26 -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 f5J0rPx60162; Mon, 18 Jun 2001 20:53:25 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: Date: Mon, 18 Jun 2001 20:53:23 -0400 To: freebsd-print@bostonradio.org From: Garance A Drosihn Subject: Patch: smarter 'lpc clean', new 'lpc tclean' 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 Main goals of this update to lpc (part of lpr & friends): 1) make 'lpc clean' somewhat safer 2) add an 'lpc tclean', which allows one to see what files would be removed *if* an 'lpc clean' is done. Note that 'lpc tclean' is not a privileged command, since it won't actually remove anything. 3) have 'lpc clean' and 'lpc tclean' also look for core files in spool directories. 4) make 'lpc clean' somewhat prettier and more informative. 5) get rid of some more compile-type warnings when BDECFLAGS is used (mainly by fixing up cmdtab.c). 6) as part of creating 'lpc clean' from 'lpc tclean', make it possible for "generic printer" routines to have an initialization routine which can set initial values of global variables, or even do some processing of command-line options. It can also set a "wrap-up" routine, which could be used to print summary information. This is cross-posted to freebsd-audit since the 'lpc' command is setgid daemon. (and at least at RPI, it's often run via 'sudo'). It wouldn't hurt to be a little extra paranoid while eyeing these changes... I haven't done any man-page changes yet. Some discussion: 'lpc' assumes that any control file (cfA*) will have the same hostname embedded in the filename as is embedded in the matching datafile names. This is often, but not always true. It is not true if lpd receives a job via an IP address where that IP address does not have the same hostname as what the original lpr-host uses for it's hostname. (think hosts with multiple ethernet cards, for instance). In those situations, it is possible for 'clean' to remove perfectly-valid jobs which are waiting in some queue. This adds an extra safety check, in that all files to be removed will also have to be at least one hour old. You're still able to remove perfectly-valid jobs, at least you'll only remove jobs which have been stuck in the queue for an hour. (I might increase this to two or four hours...). I hope to *really* fix this problem with other changes, sometime in "the indefinite future". More importantly, this patch provides the new 'lpc tclean' command, which will tell the user what files WOULD be removed if an 'lpc clean' command were done. Also, sometimes print-filters (or lpd itself) will die, and leave behind a multi-megabyte core file in some spool directory. As long as 'lpc clean' is looking at all files in all spool directories, have it also look for these core files. The 'lpc clean' commands also now print out a summary line saying how many queues were checked, how many files were removed (or "would be" removed, for tclean), and how much disk space is involved. For the benefit of those who have many print queues, 'lpc clean all' will only print out the names of print queues where some interesting files were found, instead of printing out a header-line for every queue in your printcap file. I'm thinking it would be good to move all the routines associated with 'clean' and 'tclean' into a separate source file. I could do that as part of this change if people thought it were reasonable, or I could do it as some later, separate update. I'd also like to move 'status'-related routines into a separate source file, and maybe the 'generic()' itself into a separate file. I'd probably leave all other currently-existing routines in lpc/cmds.c, but I also have at least one more new command in mind, and it seems like somewhere along the line cmds.c would be better if broken up. I guess the clever option-parsing ability for generic-printer commands seems a little odd, but it's meant to allow for a lot of flexibility without having to rewrite all the generic routines at the same time. At RPI, 'lpc status' also has some option-processing changes, and it's put to much more interesting use in that case. This patch has no source-files in common with my pending patch to lpd, so the patches can be committed to current in any order. That's probably more detail than anyone wanted... In any case, here's the patch: Index: lpc/cmds.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/lpr/lpc/cmds.c,v retrieving revision 1.16 diff -u -r1.16 cmds.c --- lpc/cmds.c 2001/06/12 16:38:17 1.16 +++ lpc/cmds.c 2001/06/19 00:17:58 @@ -79,22 +79,78 @@ static int touch(struct jobqueue *_jq); static void unlinkf(char *_name); static void upstat(struct printer *_pp, const char *_msg); +static void wrapup_clean(int _laststatus); /* * generic framework for commands which operate on all or a specified * set of printers */ +enum qsel_val { /* how a given ptr was selected */ + QSEL_UNKNOWN = -1, /* ... not selected yet */ + QSEL_BYNAME = 0, /* ... user specifed it by name */ + QSEL_ALL = 1 /* ... user wants "all" printers */ + /* (with more to come) */ +}; + +static enum qsel_val generic_qselect; /* indicates how ptr was selected */ +static int generic_initerr; /* result of initrtn processing */ +static char *generic_nullarg; +static void (*generic_wrapup)(int _last_status); /* perform rtn wrap-up */ + void -generic(void (*specificrtn)(struct printer *_pp), int argc, char *argv[]) +generic(void (*specificrtn)(struct printer *_pp), + void (*initrtn)(int _argc, char *_argv[]), int argc, char *argv[]) { - int cmdstatus, more; - struct printer myprinter, *pp = &myprinter; + int cmdstatus, more, targc; + struct printer myprinter, *pp; + char **targv; if (argc == 1) { printf("Usage: %s {all | printer ...}\n", argv[0]); return; } - if (argc == 2 && strcmp(argv[1], "all") == 0) { + + /* + * The initialization routine for a command might set a generic + * "wrapup" routine, which should be called after processing all + * the printers in the command. This might print summary info. + * + * Note that the initialization routine may also parse (and + * nullify) some of the parameters given on the command, leaving + * only the parameters which have to do with printer names. + */ + pp = &myprinter; + generic_wrapup = NULL; + generic_qselect = QSEL_UNKNOWN; + cmdstatus = 0; + /* this just needs to be a distinct value of type 'char *' */ + if (generic_nullarg == NULL) + generic_nullarg = strdup(""); + + /* call initialization routine, if there is one for this cmd */ + if (initrtn != NULL) { + generic_initerr = 0; + (*initrtn)(argc, argv); + if (generic_initerr) + return; + /* skip any initial arguments null-ified by initrtn */ + targc = argc; + targv = argv; + while (--targc) { + if (targv[1] != generic_nullarg) + break; + ++targv; + } + if (targv != argv) { + targv[0] = argv[0]; /* copy the command-name */ + argv = targv; + argc = targc + 1; + } + } + + if (generic_qselect == QSEL_UNKNOWN && argc == 2 && strcmp(argv[1], + "all") == 0) { + generic_qselect = QSEL_ALL; more = firstprinter(pp, &cmdstatus); if (cmdstatus) goto looperr; @@ -115,10 +171,14 @@ } } while (more && cmdstatus); } - return; + goto wrapup; } + + generic_qselect = QSEL_BYNAME; /* specifically-named ptrs */ while (--argc) { ++argv; + if (*argv == generic_nullarg) + continue; init_printer(pp); cmdstatus = getprintcap(*argv, pp); switch (cmdstatus) { @@ -136,6 +196,12 @@ } (*specificrtn)(pp); } + +wrapup: + if (generic_wrapup) { + (*generic_wrapup)(cmdstatus); + } + } /* @@ -236,14 +302,34 @@ (void) close(fd); } +/* + * "global" variables for all the routines related to 'clean' and 'tclean' + */ +static time_t cln_now; /* current time */ +static double cln_minage; /* minimum age before file is removed */ +static long cln_sizecnt; /* amount of space freed up */ +static int cln_debug; /* print extra debugging msgs */ +static int cln_filecnt; /* number of files destroyed */ +static int cln_foundcore; /* found a core file! */ +static int cln_queuecnt; /* number of queues checked */ +static int cln_testonly; /* remove-files vs just-print-info */ + static int doselect(struct dirent *d) { int c = d->d_name[0]; if ((c == 't' || c == 'c' || c == 'd') && d->d_name[1] == 'f') - return(1); - return(0); + return 1; + if (c == 'c') { + if (!strcmp(d->d_name, "core")) + cln_foundcore = 1; + } + if (c == 'e') { + if (!strncmp(d->d_name, "errs.", 5)) + return 1; + } + return 0; } /* @@ -276,15 +362,66 @@ * Or, perhaps: * Remove incomplete jobs from spooling area. */ + +void +init_clean(int argc, char *argv[]) +{ + + /* init some fields before 'clean' is called for each queue */ + cln_queuecnt = 0; + cln_now = time(NULL); + cln_minage = 3600.0; /* only delete files >1h old */ + cln_filecnt = 0; + cln_sizecnt = 0; + cln_debug = 0; + cln_testonly = 0; + generic_wrapup = &wrapup_clean; + + /* see if there are any options specified before the ptr list */ + while (--argc) { + ++argv; + if (**argv != '-') + break; + if (strcmp(*argv, "-d") == 0) { + /* just an example of an option... */ + cln_debug = 1; + *argv = generic_nullarg; /* "erase" it */ + } else { + printf("Invalid option '%s'\n", *argv); + generic_initerr = 1; + } + } + + return; +} + void -clean(struct printer *pp) +init_tclean(int argc, char *argv[]) { - register int i, n; - register char *cp, *cp1, *lp; + + /* only difference between 'clean' and 'tclean' is one value */ + /* (...and the fact that 'clean' is priv and 'tclean' is not) */ + init_clean(argc, argv); + cln_testonly = 1; + + return; +} + +void +clean_q(struct printer *pp) +{ + char *cp, *cp1, *lp; struct dirent **queue; - int nitems; + size_t linerem; + int didhead, i, n, nitems; - printf("%s:\n", pp->printer); + cln_queuecnt++; + + didhead = 0; + if (generic_qselect == QSEL_BYNAME) { + printf("%s:\n", pp->printer); + didhead = 1; + } lp = line; cp = pp->spool_dir; @@ -293,20 +430,45 @@ break; } lp[-1] = '/'; + linerem = sizeof(line) - (lp - line); + cln_foundcore = 0; seteuid(euid); nitems = scandir(pp->spool_dir, &queue, doselect, sortq); seteuid(uid); if (nitems < 0) { + if (!didhead) { + printf("%s:\n", pp->printer); + didhead = 1; + } printf("\tcannot examine spool directory\n"); return; } + if (cln_foundcore) { + if (!didhead) { + printf("%s:\n", pp->printer); + didhead = 1; + } + printf("\t** found a core file in %s !\n", pp->spool_dir); + } if (nitems == 0) return; + if (!didhead) + printf("%s:\n", pp->printer); i = 0; do { cp = queue[i]->d_name; if (*cp == 'c') { + /* + * A control file. Look for matching data-files. + */ + /* XXX + * Note the logic here assumes that the hostname + * part of cf-filenames match the hostname part + * in df-filenames, and that is not necessarily + * true (eg: for multi-homed hosts). This needs + * some further thought... + */ n = 0; while (i + 1 < nitems) { cp1 = queue[i + 1]->d_name; @@ -316,32 +478,104 @@ n++; } if (n == 0) { - strncpy(lp, cp, sizeof(line) - strlen(line) - 1); - line[sizeof(line) - 1] = '\0'; + if (strlen(cp) >= linerem) + goto lineoflo; + strlcpy(lp, cp, linerem); unlinkf(line); } + } else if (*cp == 'e') { + /* + * Must be an errrs or email temp file. + */ + if (strlen(cp) >= linerem) + goto lineoflo; + strlcpy(lp, cp, linerem); + unlinkf(line); } else { /* * Must be a df with no cf (otherwise, it would have * been skipped above) or a tf file (which can always - * be removed). + * be removed if it's old enough). */ - strncpy(lp, cp, sizeof(line) - strlen(line) - 1); - line[sizeof(line) - 1] = '\0'; + /* XXX + * Note that this code really should check to see if + * a df file is a symbolic link to some other file, + * and if '-r' was specified on the lpr command for + * it. Of course, it's currently impossible to find + * out about any '-r' now that the cf file is gone... + */ + if (strlen(cp) >= linerem) + goto lineoflo; + strlcpy(lp, cp, linerem); unlinkf(line); } } while (++i < nitems); + return; + +lineoflo: + printf("\t** internal error: 'line' buffer overflow!"); + return; } + +static void +wrapup_clean(int laststatus __unused) +{ + + printf("Checked %d queues, and ", cln_queuecnt); + if (cln_filecnt < 1) { + printf("no cruft was found\n"); + return; + } + if (cln_testonly) { + printf("would have "); + } + printf("removed %d files (%ld bytes).\n", cln_filecnt, cln_sizecnt); +} static void unlinkf(char *name) { + struct stat stbuf; + double agemod, agestat; + int res; + + /* XXX + * Probably should use lstat instead of stat, but that opens up + * the issue of what SHOULD be done when removing a df* file + * which is a symbolic link... + */ seteuid(euid); - if (unlink(name) < 0) - printf("\tcannot remove %s\n", name); - else - printf("\tremoved %s\n", name); + res = stat(name, &stbuf); seteuid(uid); + if (res < 0) { + printf("\terror return from stat(%s):\n", name); + printf("\t %s\n", strerror(errno)); + return; + } + + agemod = difftime(cln_now, stbuf.st_mtime); + agestat = difftime(cln_now, stbuf.st_ctime); + if (cln_debug) { + printf("\t\t modify age=%g secs, stat age=%g secs\n", + agemod, agestat); + } + if ((agemod <= cln_minage) && (agestat <= cln_minage)) + return; + + cln_filecnt++; + cln_sizecnt += stbuf.st_size; + + if (cln_testonly) { + printf("\twould remove %s\n", name); + } else { + seteuid(euid); + res = unlink(name); + seteuid(uid); + if (res < 0) + printf("\tcannot remove %s (!)\n", name); + else + printf("\tremoved %s\n", name); + } } /* Index: lpc/cmdtab.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/lpr/lpc/cmdtab.c,v retrieving revision 1.3 diff -u -r1.3 cmdtab.c --- lpc/cmdtab.c 1999/08/28 01:16:51 1.3 +++ lpc/cmdtab.c 2001/06/19 00:17:58 @@ -58,26 +58,30 @@ char starthelp[] = "enable printing and start a spooling daemon"; char statushelp[] = "show status of daemon and queue"; char stophelp[] = "stop a spooling daemon after current job completes and disable printing"; +char tcleanhelp[] = "test to see what files a clean cmd would remove"; char topqhelp[] = "put job at top of printer queue"; char uphelp[] = "enable everything and restart spooling daemon"; +#define PR 1 /* a privileged command */ + struct cmd cmdtab[] = { - { "abort", aborthelp, 0, 1, doabort }, - { "clean", cleanhelp, 0, 1, clean }, - { "enable", enablehelp, 0, 1, enable }, - { "exit", quithelp, quit, 0 }, - { "disable", disablehelp, 0, 1, disable }, - { "down", downhelp, down, 1 }, - { "help", helphelp, help, 0 }, - { "quit", quithelp, quit, 0 }, - { "restart", restarthelp, 0, 0, restart }, - { "start", starthelp, 0, 1, startcmd }, - { "status", statushelp, 0, 0, status }, - { "stop", stophelp, 0, 1, stop }, - { "topq", topqhelp, topq, 1 }, - { "up", uphelp, 0, 1, up }, - { "?", helphelp, help, 0 }, - { 0 }, + { "abort", aborthelp, PR, 0, doabort }, + { "clean", cleanhelp, PR, init_clean, clean_q }, + { "enable", enablehelp, PR, 0, enable }, + { "exit", quithelp, 0, quit, 0 }, + { "disable", disablehelp, PR, 0, disable }, + { "down", downhelp, PR, down, 0 }, + { "help", helphelp, 0, help, 0 }, + { "quit", quithelp, 0, quit, 0 }, + { "restart", restarthelp, 0, 0, restart }, + { "start", starthelp, PR, 0, startcmd }, + { "status", statushelp, 0, 0, status }, + { "stop", stophelp, PR, 0, stop }, + { "tclean", tcleanhelp, 0, init_tclean, clean_q }, + { "topq", topqhelp, PR, topq, 0 }, + { "up", uphelp, PR, 0, up }, + { "?", helphelp, 0, help, 0 }, + { 0, 0, 0, 0, 0}, }; int NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]); Index: lpc/extern.h =================================================================== RCS file: /home/ncvs/src/usr.sbin/lpr/lpc/extern.h,v retrieving revision 1.4 diff -u -r1.4 extern.h --- lpc/extern.h 2001/06/12 16:38:17 1.4 +++ lpc/extern.h 2001/06/19 00:17:58 @@ -42,14 +42,17 @@ __BEGIN_DECLS -void clean(struct printer *_pp); +void clean_q(struct printer *_pp); void disable(struct printer *_pp); void doabort(struct printer *_pp); void down(int _argc, char *_argv[]); void enable(struct printer *_pp); -void generic(void (*_specificrtn)(struct printer *_pp), int _argc, - char *_argv[]); +void generic(void (*_specificrtn)(struct printer *_pp), + void (*_initcmd)(int _argc, char *_argv[]), + int _argc, char *_argv[]); void help(int _argc, char *_argv[]); +void init_clean(int _argc, char *_argv[]); +void init_tclean(int _argc, char *_argv[]); void quit(int _argc, char *_argv[]); void restart(struct printer *_pp); void startcmd(struct printer *_pp); Index: lpc/lpc.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/lpr/lpc/lpc.c,v retrieving revision 1.18 diff -u -r1.18 lpc.c --- lpc/lpc.c 2001/06/15 16:28:35 1.18 +++ lpc/lpc.c 2001/06/19 00:17:58 @@ -115,7 +115,7 @@ exit(1); } if (c->c_generic != 0) - generic(c->c_generic, argc, argv); + generic(c->c_generic, c->c_handler, argc, argv); else (*c->c_handler)(argc, argv); exit(0); @@ -200,8 +200,16 @@ printf("?Privileged command\n"); continue; } + + /* + * Two different commands might have the same generic rtn + * (eg: "clean" and "tclean"), and just use different + * handler routines for distinct command-setup. The handler + * routine might also be set on a generic routine for + * initial parameter processing. + */ if (c->c_generic != 0) - generic(c->c_generic, margc, margv); + generic(c->c_generic, c->c_handler, margc, margv); else (*c->c_handler)(margc, margv); } Index: lpc/lpc.h =================================================================== RCS file: /home/ncvs/src/usr.sbin/lpr/lpc/lpc.h,v retrieving revision 1.3 diff -u -r1.3 lpc.h --- lpc/lpc.h 2001/06/12 16:38:17 1.3 +++ lpc/lpc.h 2001/06/19 00:17:58 @@ -36,15 +36,17 @@ */ /* - * Line printer control program. + * Line Printer Control (lpc) program. */ struct printer; struct cmd { const char *c_name; /* command name */ const char *c_help; /* help message */ - /* routine to do the work */ + const int c_priv; /* privileged command */ + /* routine to do all the work for plain cmds, or + * initialization work for generic-printer cmds: */ void (*c_handler)(int, char *[]); - int c_priv; /* privileged command */ - void (*c_generic)(struct printer *); /* generic command */ + /* routine to do the work for generic-printer cmds: */ + void (*c_generic)(struct printer *); }; -- 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 Mon Jun 18 18:10:55 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 0478C37B401 for ; Mon, 18 Jun 2001 18:10:53 -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 f5J1Aox132760; Mon, 18 Jun 2001 21:10:50 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Mon, 18 Jun 2001 21:10:49 -0400 To: freebsd-print@bostonradio.org From: Garance A Drosihn Subject: Re: Patch: smarter 'lpc clean', new 'lpc tclean' 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 8:53 PM -0400 6/18/01, Garance A Drosihn wrote: > [...] You're still able to >remove perfectly-valid jobs, at least you'll only remove jobs which >have been stuck in the queue for an hour. (I might increase this >to two or four hours...). I hope to *really* fix this problem with >other changes, sometime in "the indefinite future". > I guess the clever option-parsing ability for generic-printer >commands seems a little odd, but it's meant to allow for a lot of >flexibility without having to rewrite all the generic routines at >the same time. I should mention that what always intended to do is have the default period be something like four or eight hours, and then have another option so the user of 'lpc' could request a different safety margin. At RPI 'lpc cleans' are run every day, so it's important to minimize the danger of blindly running it. [I don't want to do that in this update, but it's what I meant to do in RPI's version. It'd be easy enough to add in some later update, once a plausible syntax is picked. Maybe just 'lpc clean -h 2 ...'] Also, apologies if that message was a bit long. I had lost track of how large the patch had become... -- 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 19 3:17:33 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 8BC9B37B403 for ; Tue, 19 Jun 2001 03:17:30 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 39895 invoked by uid 1000); 19 Jun 2001 10:16:01 -0000 Date: Tue, 19 Jun 2001 13:16:01 +0300 From: Peter Pentchev To: Cy Schubert - ITSD Open Systems Group Cc: audit@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path Message-ID: <20010619131601.A39467@ringworld.oblivion.bg> Mail-Followup-To: Cy Schubert - ITSD Open Systems Group , audit@FreeBSD.ORG, arch@FreeBSD.ORG References: <20010618151831.J1713@ringworld.oblivion.bg> <200106190017.f5J0H8R17337@cwsys.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200106190017.f5J0H8R17337@cwsys.cwsent.com>; from Cy.Schubert@uumail.gov.bc.ca on Mon, Jun 18, 2001 at 05:16:46PM -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 Mon, Jun 18, 2001 at 05:16:46PM -0700, Cy Schubert - ITSD Open Systems Group wrote: > In message <20010618151831.J1713@ringworld.oblivion.bg>, Peter Pentchev > writes: > > On Mon, Jun 18, 2001 at 03:13:24PM +0300, Ruslan Ermilov wrote: > > > > > > Excuse me, but what's wrong with sysctl(8) editing kern.module_path? > > > > Well, as I noted at the start of the message, this is a scripts-friendly > > utility - it allows adding/removing/inserting individual paths without > > the need to parse the whole. > > But it could be a script friendly Perl script that calls sysctl. Right? Not really; not if it's in /sbin, not if it's used at startup time. Perl might not be available early in the boot process. Well, ok, so the modules path does not really need not be changed so early, but why not give admins the chance to create bullet-shaped holes in their lower appendages, if they should so desire.. G'luck, Peter -- This sentence contradicts itself - or rather - well, no, actually it doesn't! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 19 11:10: 0 2001 Delivered-To: freebsd-audit@freebsd.org Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id 5611137B406; Tue, 19 Jun 2001 11:09:54 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.244.104.1.Dial1.SanJose1.Level3.net [209.244.104.1]) by falcon.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id LAA27797; Tue, 19 Jun 2001 11:09:51 -0700 (PDT) Message-ID: <3B2F958E.BC556A1E@mindspring.com> Date: Tue, 19 Jun 2001 11:10:22 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: John Baldwin Cc: Peter Pentchev , arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path References: 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 John Baldwin wrote: > To me, it seems more sensible to use the same interface that > ldconfig uses. Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! ldconfig is a serious pain in the ass, ever since the "fix" that made it not look in the linkage or configured directories on a lookup miss. This is particularly aggregious if you have a "/opt" or some other place where you prefer to install your ports or locally developed software. Having to reboot to make things work really, really sucks -- and that is often necessary if you build code from the net, which FreeBSD has mistakenly included as part os the base system monolith. OpenSSL, OpenSSH, and the resolver library are three examples that leap lithely to mind. It is a serious pain that the default compilation options enable the machine specific optimizations and higher compile levels in the Linux OpenSSL, rendering it 2-3 time faster than the FreeBSD version, depending on hardware. I _do not want_ the FreeBSD version of this library when I'm linking my stuff. Likewise, the lack of a parallel, asynchronous resolver is a serious deficit in FreeBSD, which is the result of jamming the recolver into libc "because libresolv is how SVR4 and Linux do it, and it would be a pain to go through and change the network using ports to include the library linkage for the one time it would be necessary". UGH. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 19 11:42:20 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 3958A37B401 for ; Tue, 19 Jun 2001 11:42:13 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 5337 invoked by uid 1000); 19 Jun 2001 18:40:41 -0000 Date: Tue, 19 Jun 2001 21:40:41 +0300 From: Peter Pentchev To: Terry Lambert Cc: John Baldwin , arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path Message-ID: <20010619214041.E3535@ringworld.oblivion.bg> Mail-Followup-To: Terry Lambert , John Baldwin , arch@FreeBSD.ORG, audit@FreeBSD.ORG References: <3B2F958E.BC556A1E@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3B2F958E.BC556A1E@mindspring.com>; from tlambert2@mindspring.com on Tue, Jun 19, 2001 at 11:10:22AM -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 19, 2001 at 11:10:22AM -0700, Terry Lambert wrote: > John Baldwin wrote: > > To me, it seems more sensible to use the same interface that > > ldconfig uses. > > Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! > > ldconfig is a serious pain in the ass, ever since the "fix" > that made it not look in the linkage or configured directories > on a lookup miss. > > This is particularly aggregious if you have a "/opt" or some > other place where you prefer to install your ports or locally > developed software. Uh.. Terry.. have you even looked to check what this new kldconfig thing is supposed to do? :) kldconfig(8) does not traverse any directories; it just modifies a list of paths. As other posters in this thread have made me believe, it doesn't even need to check for the existence of the paths. The only kind of path traversing in the KLD case is done at module-load time, by the linker_search_path() function in sys/kern/kern_linker.c, invoked by kldload() syscall defined in the same file. It is there that any kind of checks should be made (currently none, though I plan on addressing this soon, in a very-very-very simple way, if Robert Watson doesn't do his MAC thing first :). kldconfig(8) just reads a sysctl value, parses it into a list of paths, parses some user-specified options, adds or removes paths as appropriate, and sets the sysctl value back. G'luck, Peter -- This sentence is false. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 19 11:52:38 2001 Delivered-To: freebsd-audit@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 39D8137B409; Tue, 19 Jun 2001 11:52:33 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.3/8.11.2) with ESMTP id f5JIqQ113690; Tue, 19 Jun 2001 11:52:26 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3B2F958E.BC556A1E@mindspring.com> Date: Tue, 19 Jun 2001 11:09:44 -0700 (PDT) From: John Baldwin To: Terry Lambert Subject: Re: new kldpath(8): display/modify the module search path Cc: audit@FreeBSD.org, arch@FreeBSD.org, Peter Pentchev 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 19-Jun-01 Terry Lambert wrote: > John Baldwin wrote: >> To me, it seems more sensible to use the same interface that >> ldconfig uses. > > Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! Terry, I mean interface in terms of having the command switches be the same. I.e., dont' have -r do a rescan for one but remove a path for the other. This has nothing to do with your difficulties with certain libraries. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 19 12: 5:23 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id 18E4837B403; Tue, 19 Jun 2001 12:05:17 -0700 (PDT) (envelope-from nate@yogotech.com) Received: from nomad.yogotech.com (nomad.yogotech.com [206.127.123.131]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id NAA20484; Tue, 19 Jun 2001 13:05:12 -0600 (MDT) (envelope-from nate@nomad.yogotech.com) Received: (from nate@localhost) by nomad.yogotech.com (8.8.8/8.8.8) id NAA16251; Tue, 19 Jun 2001 13:05:09 -0600 (MDT) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15151.41572.721434.703837@nomad.yogotech.com> Date: Tue, 19 Jun 2001 13:05:08 -0600 (MDT) To: tlambert2@mindspring.com Cc: John Baldwin , Peter Pentchev , arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path In-Reply-To: <3B2F958E.BC556A1E@mindspring.com> References: <3B2F958E.BC556A1E@mindspring.com> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) 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 > > To me, it seems more sensible to use the same interface that > > ldconfig uses. > > Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! > > ldconfig is a serious pain in the ass, ever since the "fix" > that made it not look in the linkage or configured directories > on a lookup miss. > > This is particularly aggregious if you have a "/opt" or some > other place where you prefer to install your ports or locally > developed software. > > Having to reboot to make things work really, really sucks -- > and that is often necessary if you build code from the net, > which FreeBSD has mistakenly included as part os the base > system monolith. OpenSSL, OpenSSH, and the resolver library > are three examples that leap lithely to mind. Terry, it's simple to not have to reboot. Many ports already do this, but a 'ldconfig -R' tells it to re-scan the known directories to pickup new entries, which can be done at any time (as root of course). Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 19 12:20:18 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 0050C37B403 for ; Tue, 19 Jun 2001 12:20:11 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 5819 invoked by uid 1000); 19 Jun 2001 19:18:40 -0000 Date: Tue, 19 Jun 2001 22:18:40 +0300 From: Peter Pentchev To: arch@FreeBSD.org Cc: audit@FreeBSD.org Subject: Re: new kldpath(8): display/modify the module search path Message-ID: <20010619221840.C5573@ringworld.oblivion.bg> Mail-Followup-To: arch@FreeBSD.org, audit@FreeBSD.org References: <3B2F958E.BC556A1E@mindspring.com> <20010619214041.E3535@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: <20010619214041.E3535@ringworld.oblivion.bg>; from roam@orbitel.bg on Tue, Jun 19, 2001 at 09:40:41PM +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 Tue, Jun 19, 2001 at 09:40:41PM +0300, Peter Pentchev wrote: > On Tue, Jun 19, 2001 at 11:10:22AM -0700, Terry Lambert wrote: > > John Baldwin wrote: > > > To me, it seems more sensible to use the same interface that > > > ldconfig uses. > > > > Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! > > > > ldconfig is a serious pain in the ass, ever since the "fix" > > that made it not look in the linkage or configured directories > > on a lookup miss. > > > > This is particularly aggregious if you have a "/opt" or some > > other place where you prefer to install your ports or locally > > developed software. > > Uh.. Terry.. have you even looked to check what this new > kldconfig thing is supposed to do? :) > > kldconfig(8) does not traverse any directories; it just modifies > a list of paths. As other posters in this thread have made me > believe, it doesn't even need to check for the existence of the paths. And for those who still haven't seen it, and would want to review another version (basically kldconfig-01 with ru's mdoc fixes), here's the new one: http://people.FreeBSD.org/~roam/devel/sys/kldconfig/kldconfig-02.tar.gz The index of http://people.FreeBSD.org/~roam/devel/sys/kldconfig/ has a brief history and links to this and the previous versions :) G'luck, Peter -- When you are not looking at it, this sentence is in Spanish. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 19 23:26:28 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harrier.mail.pas.earthlink.net (harrier.mail.pas.earthlink.net [207.217.121.12]) by hub.freebsd.org (Postfix) with ESMTP id 4229637B406; Tue, 19 Jun 2001 23:26:21 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.247.138.115.Dial1.SanJose1.Level3.net [209.247.138.115]) by harrier.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id XAA14036; Tue, 19 Jun 2001 23:24:55 -0700 (PDT) Message-ID: <3B3041D7.28CB375E@mindspring.com> Date: Tue, 19 Jun 2001 23:25:27 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Nate Williams Cc: John Baldwin , Peter Pentchev , arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path References: <3B2F958E.BC556A1E@mindspring.com> <15151.41572.721434.703837@nomad.yogotech.com> 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 Nate Williams wrote: > > Having to reboot to make things work really, really sucks -- > > and that is often necessary if you build code from the net, > > which FreeBSD has mistakenly included as part os the base > > system monolith. OpenSSL, OpenSSH, and the resolver library > > are three examples that leap lithely to mind. > > Terry, it's simple to not have to reboot. Many ports already > do this, but a 'ldconfig -R' tells it to re-scan the known > directories to pickup new entries, which can be done at any > time (as root of course). It was pointed out that the code just sets a path (or adds to one, which makes the most sense in the case of multiple rc.d's). I still have a small problem with the path setting automating load of things installed in /usr/local (e.g. the vmware modules), since there isn't a "rebuild requirement" for the modules which are not themselves built as part of the kernel build. I also have a slight problem with the module path being capable of being set to include some directory before /modules. What is the interaction with /etc/modules.old, when you are booting a /kernel.old? It seems to me that it would be very easy to boot a /kernel.old, and end up with mismatched modules from an rc file setting the path to /modules instead of /modules.old... This seems like something that should maybe be a sysctl, instead, and have a default behaviour of "append to path" in the rc file implementation, to ensure that the booted kernel and modules directory matched, no matter what kernel you booted. I might even go so far as to say that if a kernel other than /kernel was being booted, that it ought to become read-only, to prevent a mismatched module from being loaded unintentionally... -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 19 23:26:50 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harrier.mail.pas.earthlink.net (harrier.mail.pas.earthlink.net [207.217.121.12]) by hub.freebsd.org (Postfix) with ESMTP id BE6D137B406; Tue, 19 Jun 2001 23:26:44 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.247.138.115.Dial1.SanJose1.Level3.net [209.247.138.115]) by harrier.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id XAA19809; Tue, 19 Jun 2001 23:26:40 -0700 (PDT) Message-ID: <3B304241.DE787305@mindspring.com> Date: Tue, 19 Jun 2001 23:27:13 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Nate Williams Cc: John Baldwin , Peter Pentchev , arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path References: <3B2F958E.BC556A1E@mindspring.com> <15151.41572.721434.703837@nomad.yogotech.com> 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 Nate Williams wrote: > > Having to reboot to make things work really, really sucks -- > > and that is often necessary if you build code from the net, > > which FreeBSD has mistakenly included as part os the base > > system monolith. OpenSSL, OpenSSH, and the resolver library > > are three examples that leap lithely to mind. > > Terry, it's simple to not have to reboot. Many ports already > do this, but a 'ldconfig -R' tells it to re-scan the known > directories to pickup new entries, which can be done at any > time (as root of course). Didn't address this... This doesn't fix the "replace /lib with /lib.new" problem; think "mount(2)"... -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Jun 19 23:39:11 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 B266937B407 for ; Tue, 19 Jun 2001 23:39:02 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 4878 invoked by uid 1000); 20 Jun 2001 06:37:30 -0000 Date: Wed, 20 Jun 2001 09:37:30 +0300 From: Peter Pentchev To: Terry Lambert Cc: Nate Williams , John Baldwin , arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path Message-ID: <20010620093730.C558@ringworld.oblivion.bg> Mail-Followup-To: Terry Lambert , Nate Williams , John Baldwin , arch@FreeBSD.ORG, audit@FreeBSD.ORG References: <3B2F958E.BC556A1E@mindspring.com> <15151.41572.721434.703837@nomad.yogotech.com> <3B3041D7.28CB375E@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3B3041D7.28CB375E@mindspring.com>; from tlambert2@mindspring.com on Tue, Jun 19, 2001 at 11:25:27PM -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 19, 2001 at 11:25:27PM -0700, Terry Lambert wrote: > Nate Williams wrote: > > > Having to reboot to make things work really, really sucks -- > > > and that is often necessary if you build code from the net, > > > which FreeBSD has mistakenly included as part os the base > > > system monolith. OpenSSL, OpenSSH, and the resolver library > > > are three examples that leap lithely to mind. > > > > Terry, it's simple to not have to reboot. Many ports already > > do this, but a 'ldconfig -R' tells it to re-scan the known > > directories to pickup new entries, which can be done at any > > time (as root of course). > > It was pointed out that the code just sets a path (or adds > to one, which makes the most sense in the case of multiple > rc.d's). > > I still have a small problem with the path setting automating > load of things installed in /usr/local (e.g. the vmware > modules), since there isn't a "rebuild requirement" for the > modules which are not themselves built as part of the kernel > build. If you are not prepared to rebuild them automatically, don't autoload them. Just setting the path does NOT cause module autoloading, you have to explicitly invoke kldload() to load a module. If the module was loaded automatically before, it will be loaded automatically now, too, regardless of the path setting. > I also have a slight problem with the module path being > capable of being set to include some directory before > /modules. If you don't want to do this, don't do it. It's as simple as that. > What is the interaction with /etc/modules.old, when you are > booting a /kernel.old? > > It seems to me that it would be very easy to boot a /kernel.old, > and end up with mismatched modules from an rc file setting the > path to /modules instead of /modules.old... In -current, booting a /boot/kernel.old/ automatically sets the module search path to /boot/kernel.old/. There are no rc files involved, the default search path is set by the loader and the kernel themselves (look at sys/kern/kern_linker.c). > This seems like something that should maybe be a sysctl, > instead, and have a default behaviour of "append to path" > in the rc file implementation, to ensure that the booted > kernel and modules directory matched, no matter what > kernel you booted. It is a sysctl already, and the kernel does ensure the booted kernel and modules directory match. If you later call kldconfig(8) without a -m option, you shoot yourself in the foot. If you call ldconfig(8) without an -m option, you shoot yourself in the foot. > I might even go so far as to say that if a kernel other > than /kernel was being booted, that it ought to become > read-only, to prevent a mismatched module from being > loaded unintentionally... Hmm.. this, at last, is a really interesting idea that does deserve some thought :) However, it is a part of the next round of changes - the kernel linker itself validating the module search paths set by kldconfig(8), or (currently and since forever) by the sysctl. G'luck, Peter -- This would easier understand fewer had omitted. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 4:11:42 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [65.0.135.147]) by hub.freebsd.org (Postfix) with ESMTP id 9009037B406; Thu, 21 Jun 2001 04:11:37 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f5LBBbM14305; Thu, 21 Jun 2001 04:11:37 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 816E33808; Thu, 21 Jun 2001 04:11:37 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: tlambert2@mindspring.com Cc: John Baldwin , Peter Pentchev , arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path In-Reply-To: <3B2F958E.BC556A1E@mindspring.com> Date: Thu, 21 Jun 2001 04:11:37 -0700 From: Peter Wemm Message-Id: <20010621111137.816E33808@overcee.netplex.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 Terry Lambert wrote: > Likewise, the lack of a parallel, asynchronous resolver is a > serious deficit in FreeBSD, which is the result of jamming > the recolver into libc "because libresolv is how SVR4 and > Linux do it, and it would be a pain to go through and change > the network using ports to include the library linkage for > the one time it would be necessary". Full, complete patches to remove res_* from libc would be welcome. "Full" and "Complete" means the *entire* tree. For it to be useful it needs to be relative to -current. You probably need to do some tweaks to the ports *.mk files for ports that do a 'getXXXbyYYY()'. I await your submission. If not, then shut up. -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 4:15:18 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [65.0.135.147]) by hub.freebsd.org (Postfix) with ESMTP id 5A9D137B401; Thu, 21 Jun 2001 04:15:13 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f5LBFDM14326; Thu, 21 Jun 2001 04:15:13 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 355F93808; Thu, 21 Jun 2001 04:15:13 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: nate@yogotech.com (Nate Williams) Cc: tlambert2@mindspring.com, John Baldwin , Peter Pentchev , arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: new kldpath(8): display/modify the module search path In-Reply-To: <15151.41572.721434.703837@nomad.yogotech.com> Date: Thu, 21 Jun 2001 04:15:13 -0700 From: Peter Wemm Message-Id: <20010621111513.355F93808@overcee.netplex.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 Nate Williams wrote: > > > To me, it seems more sensible to use the same interface that > > > ldconfig uses. > > > > Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! > > > > ldconfig is a serious pain in the ass, ever since the "fix" > > that made it not look in the linkage or configured directories > > on a lookup miss. > > > > This is particularly aggregious if you have a "/opt" or some > > other place where you prefer to install your ports or locally > > developed software. > > > > Having to reboot to make things work really, really sucks -- > > and that is often necessary if you build code from the net, > > which FreeBSD has mistakenly included as part os the base > > system monolith. OpenSSL, OpenSSH, and the resolver library > > are three examples that leap lithely to mind. > > Terry, it's simple to not have to reboot. Many ports already do this, > but a 'ldconfig -R' tells it to re-scan the known directories to pickup > new entries, which can be done at any time (as root of course). For the record, this is for 2.2.x and earlier systems only. 3.0 and above does not 'scan' the directories with ldconfig and do not create a cache of any sort. ldconfig -R has done nothing since 3.0-RELEASE. Only 'ldconfig -aout -R' actually does something these days. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 4:19:52 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [65.0.135.147]) by hub.freebsd.org (Postfix) with ESMTP id EC9FD37B40A; Thu, 21 Jun 2001 04:19:47 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f5LBJlM14348; Thu, 21 Jun 2001 04:19:47 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id D8EE13808; Thu, 21 Jun 2001 04:19:47 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: John Baldwin Cc: Terry Lambert , audit@FreeBSD.ORG, arch@FreeBSD.ORG, Peter Pentchev Subject: Re: new kldpath(8): display/modify the module search path In-Reply-To: Date: Thu, 21 Jun 2001 04:19:47 -0700 From: Peter Wemm Message-Id: <20010621111947.D8EE13808@overcee.netplex.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 John Baldwin wrote: > > On 19-Jun-01 Terry Lambert wrote: > > John Baldwin wrote: > >> To me, it seems more sensible to use the same interface that > >> ldconfig uses. > > > > Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! > > Terry, I mean interface in terms of having the command switches be the same. > I.e., dont' have -r do a rescan for one but remove a path for the other. FWIW, the 'module name' to 'kld file' mapping work-in-progress would make good use of a kldconfig/kldpath/whatever interface. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 5:47: 8 2001 Delivered-To: freebsd-audit@freebsd.org Received: from Awfulhak.org (gw.Awfulhak.org [217.204.245.18]) by hub.freebsd.org (Postfix) with ESMTP id 3082F37B403; Thu, 21 Jun 2001 05:47:01 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.4/8.11.4) with ESMTP id f5LCkvi07562; Thu, 21 Jun 2001 13:46:57 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.4/8.11.4) with ESMTP id f5LCkuS02614; Thu, 21 Jun 2001 13:46:56 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200106211246.f5LCkuS02614@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Peter Wemm Cc: John Baldwin , Terry Lambert , audit@FreeBSD.ORG, arch@FreeBSD.ORG, Peter Pentchev , brian@Awfulhak.org Subject: Re: new kldpath(8): display/modify the module search path In-Reply-To: Message from Peter Wemm of "Thu, 21 Jun 2001 04:19:47 PDT." <20010621111947.D8EE13808@overcee.netplex.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 21 Jun 2001 13:46:56 +0100 From: Brian Somers 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 > John Baldwin wrote: > > > > On 19-Jun-01 Terry Lambert wrote: > > > John Baldwin wrote: > > >> To me, it seems more sensible to use the same interface that > > >> ldconfig uses. > > > > > > Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! > > > > Terry, I mean interface in terms of having the command switches be the same. > > I.e., dont' have -r do a rescan for one but remove a path for the other. > > FWIW, the 'module name' to 'kld file' mapping work-in-progress would make > good use of a kldconfig/kldpath/whatever interface. Hah ! Caught you ! I knew someone knew something about this ! Can you say anything about how this work is progressing and who is progressing it ? I recently committed a linker_reference_module() function to use from the digi driver (after getting no response to the question I sent to -arch on May 10), but didn't know if I was stepping on anyones toes.... > Cheers, > -Peter > -- > Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au > "All of this is for nothing if we don't go to the stars" - JMS/B5 -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 6: 8:51 2001 Delivered-To: freebsd-audit@freebsd.org Received: from columbus.cris.net (ns.cris.net [212.110.128.65]) by hub.freebsd.org (Postfix) with ESMTP id B7C5337B403; Thu, 21 Jun 2001 06:08:23 -0700 (PDT) (envelope-from phantom@phantom.cris.net) Received: from phantom.cris.net (phantom.cris.net [212.110.130.74]) by columbus.cris.net (8.9.3/8.9.3) with ESMTP id QAA56468; Thu, 21 Jun 2001 16:08:18 +0300 (EEST) Received: (from phantom@localhost) by phantom.cris.net (8.11.1/8.11.1) id f5LD8LM30387; Thu, 21 Jun 2001 16:08:21 +0300 (EEST) (envelope-from phantom) Date: Thu, 21 Jun 2001 16:08:21 +0300 From: Alexey Zelkin To: hackers@FreeBSD.org, audit@FreeBSD.org Cc: bde@FreeBSD.org, ache@FreeBSD.org Subject: whois(1) patch for review Message-ID: <20010621160821.A30249@phantom.cris.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Operating-System: FreeBSD 4.2-STABLE i386 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hi, I have made few modifications to whois(1) to shut up BDECFLAGS warnings, cleanup code, and add new features. Main aim of this patch is to add flexibility to people who want to point whois(1) to non-deault whois server, i.e. have to type "-h server name" many times. It adds new command line modifier "-c" to declare server code. Originally it was supposed to point to country's whois server, but with no modifications can be used for other areas. For example you can have following string in your whoisservers configuration file (system wide -- /usr/share/misc/whoiservers or personal ~/.whoisservers): local whois.mydomain.com To point whois(1) to this server now you need to use whois -h whois.mydaomin.com XYZ with patch whois -clocal XYZ It also supposed to be used for country's whois servers. For example with whoisservers. ... ru whois.ripn.net ua whois.net.ua ... whois -c ru freebsd.org.ru (use -- whois.ripn.net) whois -c ua freebsd.org.ua (use -- whois.net.ua) Resume: with this patch included to add new country's whois server we'll need to add only one string to text file, not to modify whois(1) code as it has been done by Andrey for '-R' and as some pending PR's proposed to do. PS: I also removed -R switch for whois(1) which was used to point to Russian whois server, since it is replaced with "-c ru" PPS: It's tested on STABLE, but I don't think that there can be problems with -current. PPPS: Patch is dirty threfore any ideas on its cleanup are welcome. Also additional idea on improving whois(1) flexibility are welcome! I hope to get some free time on this weekend and commit it if nobody has strong objections. http://phantom.cris.net/~phantom/whois_patch.tgz To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 6:27:26 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 14BFF37B401 for ; Thu, 21 Jun 2001 06:27:20 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 13955 invoked by uid 1000); 21 Jun 2001 13:25:46 -0000 Date: Thu, 21 Jun 2001 16:25:46 +0300 From: Peter Pentchev To: Alexey Zelkin Cc: hackers@FreeBSD.org, audit@FreeBSD.org, bde@FreeBSD.org, ache@FreeBSD.org Subject: Re: whois(1) patch for review Message-ID: <20010621162546.I772@ringworld.oblivion.bg> Mail-Followup-To: Alexey Zelkin , hackers@FreeBSD.org, audit@FreeBSD.org, bde@FreeBSD.org, ache@FreeBSD.org References: <20010621160821.A30249@phantom.cris.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010621160821.A30249@phantom.cris.net>; from phantom@FreeBSD.org.ua on Thu, Jun 21, 2001 at 04:08:21PM +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 Thu, Jun 21, 2001 at 04:08:21PM +0300, Alexey Zelkin wrote: > hi, > > I have made few modifications to whois(1) to shut up BDECFLAGS > warnings, cleanup code, and add new features. [snip] > > Resume: with this patch included to add new country's whois server > we'll need to add only one string to text file, not to modify > whois(1) code as it has been done by Andrey for '-R' and as > some pending PR's proposed to do. > > PS: I also removed -R switch for whois(1) which was used to point > to Russian whois server, since it is replaced with "-c ru" > > PPS: It's tested on STABLE, but I don't think that there can be problems > with -current. > > PPPS: Patch is dirty threfore any ideas on its cleanup are welcome. Also > additional idea on improving whois(1) flexibility are welcome! I hope to > get some free time on this weekend and commit it if nobody has strong > objections. > > http://phantom.cris.net/~phantom/whois_patch.tgz Wow. I think there's been a GREAT deal of duplication of effort over whois(1).. Have you looked at Mike Barcroft's patches, posted both as a PR and as a longish thread on -audit a couple of days ago, or at Joachim Strombergson's patches, posted as a longish thread on -audit a month or so ago? My understanding is that Mike Barcroft's patches remove the warnings, and Joachim Strombergson was working on the server list thing :) G'luck, Peter -- This sentence would be seven words long if it were six words shorter. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 6:55: 6 2001 Delivered-To: freebsd-audit@freebsd.org Received: from columbus.cris.net (ns.cris.net [212.110.128.65]) by hub.freebsd.org (Postfix) with ESMTP id 9B78137B401; Thu, 21 Jun 2001 06:54:47 -0700 (PDT) (envelope-from phantom@phantom.cris.net) Received: from phantom.cris.net (phantom.cris.net [212.110.130.74]) by columbus.cris.net (8.9.3/8.9.3) with ESMTP id QAA66004; Thu, 21 Jun 2001 16:54:44 +0300 (EEST) Received: (from phantom@localhost) by phantom.cris.net (8.11.1/8.11.1) id f5LDslw30778; Thu, 21 Jun 2001 16:54:48 +0300 (EEST) (envelope-from phantom) Date: Thu, 21 Jun 2001 16:54:47 +0300 From: Alexey Zelkin To: Alexey Zelkin , hackers@FreeBSD.org, audit@FreeBSD.org, bde@FreeBSD.org, ache@FreeBSD.org Subject: Re: whois(1) patch for review Message-ID: <20010621165447.A30719@phantom.cris.net> References: <20010621160821.A30249@phantom.cris.net> <20010621162546.I772@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: <20010621162546.I772@ringworld.oblivion.bg>; from roam@orbitel.bg on Thu, Jun 21, 2001 at 04:25:46PM +0300 X-Operating-System: FreeBSD 4.2-STABLE i386 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hi, On Thu, Jun 21, 2001 at 04:25:46PM +0300, Peter Pentchev wrote: > > I have made few modifications to whois(1) to shut up BDECFLAGS > > warnings, cleanup code, and add new features. > [snip] > > > > Resume: with this patch included to add new country's whois server > > we'll need to add only one string to text file, not to modify > > whois(1) code as it has been done by Andrey for '-R' and as > > some pending PR's proposed to do. > > > > PS: I also removed -R switch for whois(1) which was used to point > > to Russian whois server, since it is replaced with "-c ru" > > > > PPS: It's tested on STABLE, but I don't think that there can be problems > > with -current. > > > > PPPS: Patch is dirty threfore any ideas on its cleanup are welcome. Also > > additional idea on improving whois(1) flexibility are welcome! I hope to > > get some free time on this weekend and commit it if nobody has strong > > objections. > > > > http://phantom.cris.net/~phantom/whois_patch.tgz > > Wow. > > I think there's been a GREAT deal of duplication of effort over whois(1).. > > Have you looked at Mike Barcroft's patches, posted both as a PR and > as a longish thread on -audit a couple of days ago, or at Joachim > Strombergson's patches, posted as a longish thread on -audit a month > or so ago? > > My understanding is that Mike Barcroft's patches remove the warnings, > and Joachim Strombergson was working on the server list thing :) I did not follow things going on carefully for almost two months while I'd a deal with graduate project, but now since it's finished (Yay!!!) and I got some time I started to dig to old patches (made during last three months) and it's one of them. :) I'd incorporated few missing points from Mike's PR and have on hold Joachim's (I have plans and ideas to make it even more optimized). So, if people also started to work on this topic it shows its actuality, IMHO. :-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 7:39:12 2001 Delivered-To: freebsd-audit@freebsd.org Received: from buddha.automagic.org (buddha-nexxia.automagic.org [207.61.141.34]) by hub.freebsd.org (Postfix) with SMTP id 343DA37B408 for ; Thu, 21 Jun 2001 07:39:06 -0700 (PDT) (envelope-from jabley@buddha.automagic.org) Received: (qmail 571 invoked by uid 100); 21 Jun 2001 14:39:05 -0000 Date: Thu, 21 Jun 2001 10:39:05 -0400 From: Joe Abley To: Alexey Zelkin Cc: hackers@FreeBSD.org, audit@FreeBSD.org, bde@FreeBSD.org, ache@FreeBSD.org Subject: Re: whois(1) patch for review Message-ID: <20010621103904.M6104@buddha.home.automagic.org> References: <20010621160821.A30249@phantom.cris.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010621160821.A30249@phantom.cris.net>; from phantom@FreeBSD.org.ua on Thu, Jun 21, 2001 at 04:08:21PM +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 Thu, Jun 21, 2001 at 04:08:21PM +0300, Alexey Zelkin wrote: > It adds new command line modifier "-c" to declare server code. > Originally it was supposed to point to country's whois > server, but with no modifications can be used for other areas. > > For example you can have following string in your whoisservers > configuration file (system wide -- /usr/share/misc/whoiservers > or personal ~/.whoisservers): > > local whois.mydomain.com I wrote a patch for the openbsd whois client a year or so ago which used lookups under the whois-servers.net zone to locate appropriate whois servers for domain names. Looks like someone ported that to FreeBSD's client (the -Q option). Just thought I'd mention it, since your examples include: > It also supposed to be used for country's whois servers. For example > with whoisservers. > > ... > ru whois.ripn.net > ua whois.net.ua > ... > > whois -c ru freebsd.org.ru (use -- whois.ripn.net) whois -Q freebsd.org.ru > whois -c ua freebsd.org.ua (use -- whois.net.ua) whois -Q freebsd.org.ua > Resume: with this patch included to add new country's whois server > we'll need to add only one string to text file, not to modify > whois(1) code as it has been done by Andrey for '-R' and as > some pending PR's proposed to do. This list is already maintained in the whois-servers.net zone. Joe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 11:24:11 2001 Delivered-To: freebsd-audit@freebsd.org Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by hub.freebsd.org (Postfix) with ESMTP id 0D25537B401; Thu, 21 Jun 2001 11:24:06 -0700 (PDT) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.11.4/8.11.4) id f5LINhW23924; Thu, 21 Jun 2001 22:23:43 +0400 (MSD) (envelope-from ache) Date: Thu, 21 Jun 2001 22:23:43 +0400 From: "Andrey A. Chernov" To: Joe Abley Cc: Alexey Zelkin , hackers@FreeBSD.org, audit@FreeBSD.org, bde@FreeBSD.org Subject: Re: whois(1) patch for review Message-ID: <20010621222343.C23514@nagual.pp.ru> References: <20010621160821.A30249@phantom.cris.net> <20010621103904.M6104@buddha.home.automagic.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010621103904.M6104@buddha.home.automagic.org>; from jabley@automagic.org on Thu, Jun 21, 2001 at 10:39:05AM -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 Thu, Jun 21, 2001 at 10:39:05 -0400, Joe Abley wrote: > > > > whois -c ru freebsd.org.ru (use -- whois.ripn.net) > > whois -Q freebsd.org.ru > > > whois -c ua freebsd.org.ua (use -- whois.net.ua) > > whois -Q freebsd.org.ua > > > Resume: with this patch included to add new country's whois server > > we'll need to add only one string to text file, not to modify > > whois(1) code as it has been done by Andrey for '-R' and as > > some pending PR's proposed to do. > > This list is already maintained in the whois-servers.net zone. For domain names it works without '-Q' too. The main problem not with domain names wich have "." found via whois-servers.net, but for identificators or subnets without suffix, like: whois -c ru XXX-RIPN whois -c ru 123.123.123.123 -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 11:38:26 2001 Delivered-To: freebsd-audit@freebsd.org Received: from buddha.automagic.org (buddha-nexxia.automagic.org [207.61.141.34]) by hub.freebsd.org (Postfix) with SMTP id 7705B37B403 for ; Thu, 21 Jun 2001 11:38:20 -0700 (PDT) (envelope-from jabley@buddha.automagic.org) Received: (qmail 23689 invoked by uid 100); 21 Jun 2001 18:38:19 -0000 Date: Thu, 21 Jun 2001 14:38:18 -0400 From: Joe Abley To: "Andrey A. Chernov" Cc: Alexey Zelkin , hackers@FreeBSD.org, audit@FreeBSD.org, bde@FreeBSD.org Subject: Re: whois(1) patch for review Message-ID: <20010621143818.B13514@buddha.home.automagic.org> References: <20010621160821.A30249@phantom.cris.net> <20010621103904.M6104@buddha.home.automagic.org> <20010621222343.C23514@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010621222343.C23514@nagual.pp.ru>; from ache@nagual.pp.ru on Thu, Jun 21, 2001 at 10:23:43PM +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 Thu, Jun 21, 2001 at 10:23:43PM +0400, Andrey A. Chernov wrote: > On Thu, Jun 21, 2001 at 10:39:05 -0400, Joe Abley wrote: > > > > > > whois -c ru freebsd.org.ru (use -- whois.ripn.net) > > > > whois -Q freebsd.org.ru > > > > > whois -c ua freebsd.org.ua (use -- whois.net.ua) > > > > whois -Q freebsd.org.ua > > > > > Resume: with this patch included to add new country's whois server > > > we'll need to add only one string to text file, not to modify > > > whois(1) code as it has been done by Andrey for '-R' and as > > > some pending PR's proposed to do. > > > > This list is already maintained in the whois-servers.net zone. > > For domain names it works without '-Q' too. The main problem not with > domain names wich have "." found via whois-servers.net, but for > identificators or subnets without suffix, like: > > whois -c ru XXX-RIPN > whois -c ru 123.123.123.123 That seems entirely reasonable. I just wanted to point out that it wasn't necessary to maintain a big local list of whois servers for individual tlds in the case that you're looking up domains. Your patch certainly looks usable for other resources retrievable using whois. Joe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 12:50: 7 2001 Delivered-To: freebsd-audit@freebsd.org Received: from smtp05.primenet.com (smtp05.primenet.com [64.211.219.54]) by hub.freebsd.org (Postfix) with ESMTP id 8FB3537B401; Thu, 21 Jun 2001 12:50:00 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp05.primenet.com (8.9.3/8.9.3) id MAA15823; Thu, 21 Jun 2001 12:49:58 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp05.primenet.com, id smtpdAAArmay3E; Thu Jun 21 12:49:52 2001 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id MAA11812; Thu, 21 Jun 2001 12:52:15 -0700 (MST) From: Terry Lambert Message-Id: <200106211952.MAA11812@usr05.primenet.com> Subject: Re: new kldpath(8): display/modify the module search path To: peter@wemm.org Date: Thu, 21 Jun 2001 19:52:15 +0000 (GMT) Cc: arch@FreeBSD.ORG, audit@FreeBSD.ORG X-Mailer: ELM [version 2.5 PL2] 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 Peter Wemm wrote: ] > Likewise, the lack of a parallel, asynchronous resolver is a ] > serious deficit in FreeBSD, which is the result of jamming ] > the recolver into libc "because libresolv is how SVR4 and ] > Linux do it, and it would be a pain to go through and change ] > the network using ports to include the library linkage for ] > the one time it would be necessary". ] ] Full, complete patches to remove res_* from libc would be welcome. ] "Full" and "Complete" means the *entire* tree. For it to be useful ] it needs to be relative to -current. You probably need to do ] some tweaks to the ports *.mk files for ports that do a 'getXXXbyYYY()'. ] ] I await your submission. If not, then shut up. What an absolutely brilliant approach to solving the problem. I had only considered importing a libresolv into /usr/src/lib/libresolv, and then switching ports and programs over gradually, and then at the end, when everything worked, removing the old, lousy resolver code from libc so that the transition would have the least possible impact on everyone. Your idea of switching everything over all at once, and breaking the world and pissing everyone off to the point of the changes being reverted, and keeping the old, buggy resolver code in libc for all eternity is _clearly_ much, much, better. PS: The approach you first think of when you go to solve a problem is not always the best approach; other people may in fact have ideas which aren't stupid. PPS: I would not have been this rude in pointing out the errors in your assumptions, had you not been that rude about allowing anyone to even present the idea. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 12:56: 9 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.disney.com (mail.disney.com [204.128.192.15]) by hub.freebsd.org (Postfix) with ESMTP id ADD4537B401; Thu, 21 Jun 2001 12:56:04 -0700 (PDT) (envelope-from Jim.Pirzyk@disney.com) Received: from pain10.corp.disney.com (root@pain10.corp.disney.com [153.7.110.100]) by mail.disney.com (Switch-2.0.1/Switch-2.0.1) with SMTP id f5LJtII26384; Thu, 21 Jun 2001 12:55:18 -0700 (PDT) Received: from [172.30.50.86] by pain.corp.disney.com with ESMTP; Thu, 21 Jun 2001 12:56:50 -0700 Received: from mercury.fan.fa.disney.com (mercury.fan.fa.disney.com [153.7.119.1]) by louie.fa.disney.com (8.9.2/8.9.2) with ESMTP id MAA16915; Thu, 21 Jun 2001 12:55:57 -0700 (PDT) (envelope-from Jim.Pirzyk@disney.com) Received: from brother.fan.fa.disney.com by mercury.fan.fa.disney.com; Thu, 21 Jun 2001 12:55:57 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Jim Pirzyk Organization: Walt Disney Feature Animation To: Terry Lambert , peter@wemm.org Subject: new resolver libraries (Was: Re: new kldpath(8): display/modify the module search path) Date: Thu, 21 Jun 2001 12:55:57 -0700 X-Mailer: KMail [version 1.2] Cc: arch@FreeBSD.ORG, audit@FreeBSD.ORG References: <200106211952.MAA11812@usr05.primenet.com> In-Reply-To: <200106211952.MAA11812@usr05.primenet.com> MIME-Version: 1.0 Message-Id: <01062112555704.43555@brother> Content-Transfer-Encoding: 8bit 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 Thursday 21 June 2001 12:52 pm, Terry Lambert wrote: > Peter Wemm wrote: > ] > Likewise, the lack of a parallel, asynchronous resolver is a > ] > serious deficit in FreeBSD, which is the result of jamming > ] > the recolver into libc "because libresolv is how SVR4 and > ] > Linux do it, and it would be a pain to go through and change > ] > the network using ports to include the library linkage for > ] > the one time it would be necessary". > ] > ] Full, complete patches to remove res_* from libc would be welcome. > ] "Full" and "Complete" means the *entire* tree. For it to be useful > ] it needs to be relative to -current. You probably need to do > ] some tweaks to the ports *.mk files for ports that do a 'getXXXbyYYY()'. > ] > ] I await your submission. If not, then shut up. > > What an absolutely brilliant approach to solving the problem. > > I had only considered importing a libresolv into /usr/src/lib/libresolv, > and then switching ports and programs over gradually, and then at the > end, when everything worked, removing the old, lousy resolver code from > libc so that the transition would have the least possible impact on > everyone. So if the resolver is going to be replaced, please, please include the DNS sortlist code in the new resolver. I have seen cases were that has been broken (getaddrinfo(3)). It is an absoulte requirement for us to have this. - JimP -- --- @(#) $Id: dot.signature,v 1.10 2001/05/17 23:38:49 Jim.Pirzyk Exp $ __o Jim.Pirzyk@disney.com ------------- pirzyk@freebsd.org _'\<,_ Senior Systems Engineer, Walt Disney Feature Animation (*)/ (*) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 12:59:25 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 971F237B401; Thu, 21 Jun 2001 12:59:20 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id VAA66607; Thu, 21 Jun 2001 21:59:12 +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: Jim Pirzyk Cc: Terry Lambert , peter@wemm.org, arch@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: new resolver libraries (Was: Re: new kldpath(8): display/modify the module search path) References: <200106211952.MAA11812@usr05.primenet.com> <01062112555704.43555@brother> From: Dag-Erling Smorgrav Date: 21 Jun 2001 21:59:11 +0200 In-Reply-To: <01062112555704.43555@brother> Message-ID: Lines: 11 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Jim Pirzyk writes: > So if the resolver is going to be replaced, please, please include > the DNS sortlist code in the new resolver. I have seen cases were > that has been broken (getaddrinfo(3)). It is an absoulte requirement > for us to have this. Hey, Jim, you got commit privs for a *reason* ;) 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 Thu Jun 21 14:26:19 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 9460737B403; Thu, 21 Jun 2001 14:26:15 -0700 (PDT) (envelope-from mike@q9media.com) Received: from [192.168.1.10] (vega.tct.net [216.94.230.13]) by coffee.q9media.com (8.11.2/8.11.2) with ESMTP id f5LLcGL84097; Thu, 21 Jun 2001 17:38:18 -0400 (EDT) (envelope-from mike@q9media.com) User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Thu, 21 Jun 2001 17:25:55 -0400 Subject: Re: whois(1) patch for review From: Mike Barcroft To: Alexey Zelkin Cc: Peter Pentchev , , Message-ID: Mime-version: 1.0 Organization: q9 media 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 > I did not follow things going on carefully for almost two months while > I'd a deal with graduate project, but now since it's finished (Yay!!!) > and I got some time I started to dig to old patches (made during last > three months) and it's one of them. :) I'd incorporated few missing > points from Mike's PR and have on hold Joachim's (I have plans and ideas > to make it even more optimized). > > So, if people also started to work on this topic it shows its > actuality, IMHO. :-) Arg.. I wish you had contacted me before doing this work. From looking at your patch, your using an old copy of my work. The newest one is available at: http://testbed.q9media.net/freebsd/whois.patch and will be committed very-shortly-now(tm). Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 15: 1:44 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 EF12337B403 for ; Thu, 21 Jun 2001 15:01: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 f5LM1bH59408; Thu, 21 Jun 2001 18:01:37 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Thu, 21 Jun 2001 18:01:31 -0400 To: freebsd-print@bostonradio.org From: Garance A Drosihn Subject: Re: Patch: smarter 'lpc clean', new 'lpc tclean' 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 8:53 PM -0400 6/18/01, Garance A Drosihn wrote: >Main goals of this update to lpc (part of lpr & friends): > > 1) make 'lpc clean' somewhat safer > 2) add an 'lpc tclean', which allows one to see what files would be > removed *if* an 'lpc clean' is done. Note that 'lpc tclean' is > not a privileged command, since it won't actually remove anything. > 3) have 'lpc clean' and 'lpc tclean' also look for core files > in spool directories. > 4) make 'lpc clean' somewhat prettier and more informative. > 5) get rid of some more compile-type warnings when BDECFLAGS is used > (mainly by fixing up cmdtab.c). > 6) as part of creating 'lpc clean' from 'lpc tclean', make it possible > for "generic printer" routines to have an initialization routine > which can set initial values of global variables, or even do some > processing of command-line options. It can also set a "wrap-up" > routine, which could be used to print summary information. > >This is cross-posted to freebsd-audit since the 'lpc' command is >setgid daemon. (and at least at RPI, it's often run via 'sudo'). It >wouldn't hurt to be a little extra paranoid while eyeing these changes... I have a newer version of the update available at: http://freefour.acs.rpi.edu/pub/bsdlpr/lpc-clean.diff and http://people.freebsd.org/~gad/lpr/lpc-clean.diff It includes a change for the man page. Most of the rest of the update is just minor cleanups from my previous version. I hope to commit this to current this weekend, assuming no one has any feedback about it. The update is a little over 600 lines, so I wasn't sure if I should post the entire thing all over again. The 'unlinkf' routine has seen the most change, so here's just that part of the patch for people to eyeball: static void unlinkf(char *name) { + struct stat stbuf; + double agemod, agestat; + int res; + char linkbuf[BUFSIZ]; + + /* + * We have to use lstat() instead of stat(), in case this is a df* + * "file" which is really a symlink due to 'lpr -s' processing. In + * that case, we need to check the last-mod time of the symlink, and + * not the file that the symlink is pointed at. + */ seteuid(euid); - if (unlink(name) < 0) - printf("\tcannot remove %s\n", name); - else - printf("\tremoved %s\n", name); + res = lstat(name, &stbuf); seteuid(uid); + if (res < 0) { + printf("\terror return from stat(%s):\n", name); + printf("\t %s\n", strerror(errno)); + return; + } + + agemod = difftime(cln_now, stbuf.st_mtime); + agestat = difftime(cln_now, stbuf.st_ctime); + if (cln_debug) { + /* this debugging-aid probably is not needed any more... */ + printf("\t\t modify age=%g secs, stat age=%g secs\n", + agemod, agestat); + } + if ((agemod <= cln_minage) && (agestat <= cln_minage)) + return; + + /* + * if this file is a symlink, then find out the target of the + * symlink before unlink-ing the file itself + */ + if (S_ISLNK(stbuf.st_mode)) { + seteuid(euid); + res = readlink(name, linkbuf, sizeof(linkbuf)); + seteuid(uid); + if (res < 0) { + printf("\terror return from readlink(%s):\n", name); + printf("\t %s\n", strerror(errno)); + return; + } + if (res == sizeof(linkbuf)) + res--; + linkbuf[res] = '\0'; + } + + cln_filecnt++; + cln_sizecnt += stbuf.st_size; + + if (cln_testonly) { + printf("\twould remove %s\n", name); + if (S_ISLNK(stbuf.st_mode)) { + printf("\t (which is a symlink to %s)\n", linkbuf); + } + } else { + seteuid(euid); + res = unlink(name); + seteuid(uid); + if (res < 0) + printf("\tcannot remove %s (!)\n", name); + else + printf("\tremoved %s\n", name); + /* XXX + * Note that for a df* file, this code should also check to see + * if it is a symlink to some other file, and if the original + * lpr command included '-r' ("remove file"). Of course, this + * code would not be removing the df* file unless there was no + * matching cf* file, and without the cf* file it is currently + * impossible to determine if '-r' had been specified... + * + * As a result of this quandary, we may be leaving behind a + * user's file that was supposed to have been removed after + * being printed. This may effect services such as CAP or + * samba, if they were configured to use 'lpr -r', and if + * datafiles are not being properly removed. + */ + if (S_ISLNK(stbuf.st_mode)) { + printf("\t (which was a symlink to %s)\n", linkbuf); + } + } } /* -- 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 21 18:37:29 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 A19E737B401; Thu, 21 Jun 2001 18:37:21 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id DAA68165; Fri, 22 Jun 2001 03:37:18 +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: Alexey Zelkin , Peter Pentchev , , Subject: Re: whois(1) patch for review References: From: Dag-Erling Smorgrav Date: 22 Jun 2001 03:37:17 +0200 In-Reply-To: Message-ID: Lines: 13 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: > Arg.. I wish you had contacted me before doing this work. From looking at > your patch, your using an old copy of my work. The newest one is available > at: http://testbed.q9media.net/freebsd/whois.patch and will be committed > very-shortly-now(tm). Since Mike's patch is a style cleanup with no functional impact except plugging a memory leak, I feel it's better to commit it first, and merge in Alexey's patch later, after it's been reviewed by this forum. 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 Thu Jun 21 18:40:49 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 946AD37B401 for ; Thu, 21 Jun 2001 18:40:43 -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 f5M1egH122988; Thu, 21 Jun 2001 21:40:42 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Thu, 21 Jun 2001 21:40:40 -0400 To: freebsd-audit@FreeBSD.org, freebsd-print@bostonradio.org From: Garance A Drosihn Subject: Re: Patch: new options for lpd, improved msgs for connect-errs Cc: Morgan Davis 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 10:16 PM -0400 6/15/01, Garance A Drosihn wrote: >Main goals of this update to lpd: > > 1) add new option '-c', which will cause lpd to log appropriate > messages via syslog for all connection-errors. > 2) add new option '-w', which will cause lpd to accept connections > from other hosts (generally Windows) even if the connection is > NOT from a reserved port. > 3) generally improve the helpfulness of the various connection > error-messages. I have a newer version of the update available at: ftp://freefour.acs.rpi.edu/pub/bsdlpr/lpd-cncterrs.diff and http://people.freebsd.org/~gad/lpr/lpd-cncterrs.diff It hasn't changed much since the previous version, except that it now includes an update to lpd's man page for the two new options. I hope to commit this to current this weekend, assuming no one has any feedback about it. -- 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 21 20:48:17 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 9DC2637B403; Thu, 21 Jun 2001 20:47:55 -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 f5M3ltC18640; Thu, 21 Jun 2001 20:47:55 -0700 Date: Thu, 21 Jun 2001 20:47:55 -0700 From: Brooks Davis To: audit@freebsd.org, mobile@freebsd.org Subject: review request: an(4) patches Message-ID: <20010621204755.A18153@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="ew6BAiZeqk4r7MaW" 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 --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I'd like to request a review of the attached patch to the an driver before I commit it. It corrects a number of minor problems with the output of ifconfig status for an cards as well as insuring that changes in the length of resources on the cards (from firmware upgrades, etc) don't smash the kernel's stack. Once this patch has spent a week or so in -current we'll be ready for the 802.11 ifconfig support MFC. -- Brooks Index: if_aironet_ieee.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/dev/an/if_aironet_ieee.h,v retrieving revision 1.5 diff -u -r1.5 if_aironet_ieee.h --- if_aironet_ieee.h 2001/05/26 09:26:58 1.5 +++ if_aironet_ieee.h 2001/06/01 23:24:42 @@ -528,7 +528,7 @@ u_int16_t an_max_noise_prev_sec; /* 0x7A */ u_int16_t an_avg_noise_prev_min; /* 0x7C */ u_int16_t an_max_noise_prev_min; /* 0x7E */ - u_int16_t an_spare[3]; + u_int16_t an_spare[5]; }; =20 #define AN_STATUS_OPMODE_CONFIGURED 0x0001 Index: if_an.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/dev/an/if_an.c,v retrieving revision 1.18 diff -u -r1.18 if_an.c --- if_an.c 2001/06/15 00:10:30 1.18 +++ if_an.c 2001/06/22 03:43:18 @@ -162,9 +162,13 @@ struct mbuf *, unsigned short)); #endif =20 +static void an_dump_record __P((struct an_softc *,struct an_ltv_gen *, + char *)); + static int an_media_change __P((struct ifnet *)); static void an_media_status __P((struct ifnet *, struct ifmediareq *)); =20 +static int an_dump=3D0; /*=20 * We probe for an Aironet 4500/4800 card by attempting to * read the default SSID list. On reset, the first entry in @@ -511,7 +515,7 @@ int status; { struct ifnet *ifp; - int id; + int id, i; =20 /* TX DONE enable lan monitor DJA an_enable_sniff(); @@ -529,12 +533,13 @@ } else ifp->if_opackets++; =20 - if (id !=3D sc->an_rdata.an_tx_ring[sc->an_rdata.an_tx_cons]) - printf("an%d: id mismatch: expected %x, got %x\n", - sc->an_unit, - sc->an_rdata.an_tx_ring[sc->an_rdata.an_tx_cons], id); + for (i =3D 0; i < AN_TX_RING_CNT; i++ ) { + if (id =3D=3D sc->an_rdata.an_tx_ring[i]) { + sc->an_rdata.an_tx_ring[i] =3D 0; + break; + } + } =20 - sc->an_rdata.an_tx_ring[sc->an_rdata.an_tx_cons] =3D 0; AN_INC(sc->an_rdata.an_tx_cons, AN_TX_RING_CNT); =20 return; @@ -720,9 +725,10 @@ struct an_ltv_gen *ltv; { u_int16_t *ptr; + u_int8_t *ptr2; int i, len; =20 - if (ltv->an_len =3D=3D 0 || ltv->an_type =3D=3D 0) + if (ltv->an_len <=3D 2 || ltv->an_type =3D=3D 0) return(EINVAL); =20 /* Tell the NIC to enter record read mode. */ @@ -741,20 +747,29 @@ * Read the length and record type and make sure they * match what we expect (this verifies that we have enough * room to hold all of the returned data). + * Length includes type but not length. */ len =3D CSR_READ_2(sc, AN_DATA1); - if (len > (ltv->an_len - 2)) { + if (len > (ltv->an_len-2)) { printf("an%d: record length mismatch -- expected %d, " - "got %d\n", sc->an_unit, (ltv->an_len - 2), len); - len =3D (ltv->an_len - 2); + "got %d for Rid %x\n", sc->an_unit, + ltv->an_len-2, len, ltv->an_type); + len =3D ltv->an_len -2; + }else{ + ltv->an_len =3D len +2; } =20 - ltv->an_len =3D len; - /* Now read the data. */ + len -=3D 2; /* skip the type */ ptr =3D <v->an_val; - for (i =3D 0; i < (ltv->an_len - 2) >> 1; i++) - ptr[i] =3D CSR_READ_2(sc, AN_DATA1); + for (i =3D len; i > 1; i-=3D2) + *ptr++ =3D CSR_READ_2(sc, AN_DATA1); + if (i){ + ptr2 =3D (u_int8_t *)ptr; + *ptr2 =3D CSR_READ_1(sc, AN_DATA1); + } + if (an_dump) + an_dump_record(sc, ltv, "Read"); =20 return(0); } @@ -767,19 +782,32 @@ struct an_ltv_gen *ltv; { u_int16_t *ptr; - int i; + u_int8_t *ptr2; + int i, len; + + if (an_dump) + an_dump_record(sc, ltv, "Write"); =20 if (an_cmd(sc, AN_CMD_ACCESS|AN_ACCESS_READ, ltv->an_type)) return(EIO); - + =09 if (an_seek(sc, ltv->an_type, 0, AN_BAP1)) return(EIO); =20 - CSR_WRITE_2(sc, AN_DATA1, ltv->an_len-2); + /* + * Length includes type but not length. + */ + len =3D ltv->an_len-2; + CSR_WRITE_2(sc, AN_DATA1, len); =09 + len -=3D 2; /* skip the type */ ptr =3D <v->an_val; - for (i =3D 0; i < (ltv->an_len - 4) >> 1; i++) - CSR_WRITE_2(sc, AN_DATA1, ptr[i]); + for (i=3Dlen; i > 1; i-=3D2) + CSR_WRITE_2(sc, AN_DATA1, *ptr++); + if (i){ + ptr2 =3D (u_int8_t *)ptr; + CSR_WRITE_1(sc, AN_DATA0, *ptr2); + } =20 if (an_cmd(sc, AN_CMD_ACCESS|AN_ACCESS_WRITE, ltv->an_type)) return(EIO); @@ -787,6 +815,50 @@ return(0); } =20 +static void an_dump_record(sc, ltv, string) + struct an_softc *sc; + struct an_ltv_gen *ltv; + char *string; +{ + u_int8_t *ptr2; + int len; + int i; + int count =3D 0; + char buf[17], temp; + + len =3D ltv->an_len-4; + printf("an%d: RID %4x, Length %4d, Mode %s\n",=20 + sc->an_unit, ltv->an_type, ltv->an_len-4, string); + + if(an_dump =3D=3D 1 || (an_dump =3D=3D ltv->an_type)){ + printf("an%d:\t", sc->an_unit); + bzero(buf,sizeof(buf)); + + ptr2 =3D (u_int8_t *)<v->an_val; + for (i=3Dlen; i>0; i--){ + printf("%02x ", *ptr2); + + temp=3D*ptr2++; + if(temp>=3D' ' && temp <=3D'~') + buf[count]=3Dtemp; + else if(temp>=3D'A' && temp <=3D'Z') + buf[count]=3Dtemp; + else + buf[count]=3D'.'; + if(++count =3D=3D 16){ + count =3D 0; + printf("%s\n",buf); + printf("an%d:\t", sc->an_unit); + bzero(buf,sizeof(buf)); + } + } + for(; count !=3D 16; count++){ + printf(" "); + } + printf(" %s\n",buf); + } +} + static int an_seek(sc, id, off, chan) struct an_softc *sc; int id, off, chan; @@ -838,12 +910,11 @@ } =20 ptr =3D (u_int16_t *)buf; - for (i =3D 0; i < len / 2; i++) - ptr[i] =3D CSR_READ_2(sc, AN_DATA1); - i*=3D2; - if (i 1; i-=3D2) + *ptr++ =3D CSR_READ_2(sc, AN_DATA1); + if (i){ + ptr2 =3D (u_int8_t *)ptr; + *ptr2 =3D CSR_READ_1(sc, AN_DATA1); } =20 return(0); @@ -865,12 +936,11 @@ } =20 ptr =3D (u_int16_t *)buf; - for (i =3D 0; i < (len / 2); i++) - CSR_WRITE_2(sc, AN_DATA0, ptr[i]); - i*=3D2; - if (i 1; i-=3D2) + CSR_WRITE_2(sc, AN_DATA0, *ptr++); + if (i){ + ptr2 =3D (u_int8_t *)ptr; + CSR_WRITE_1(sc, AN_DATA0, *ptr2); } =20 return(0); @@ -1190,16 +1260,16 @@ len =3D 0; if(ireq->i_val < 4) { areq.an_type =3D AN_RID_WEP_TEMP; - for(i=3D0; i<4; i++) { - areq.an_len =3D sizeof(areq); + for(i=3D0; i<5; i++) { if (an_read_record(sc, (struct an_ltv_gen *)&areq)) { error =3D EINVAL; break; } - len =3D key->klen; - if(i =3D=3D ireq->i_val) + if(key->kindex =3D=3D 0xffff) break; + if(key->kindex =3D=3D ireq->i_val) + len =3D key->klen; /* Required to get next entry */ areq.an_type =3D AN_RID_WEP_PERM; } @@ -1219,6 +1289,25 @@ ireq->i_val =3D 8; break; case IEEE80211_IOC_WEPTXKEY: + /* + * For some strange reason, you have to read all + * keys before you can read the txkey. + */ + areq.an_type =3D AN_RID_WEP_TEMP; + for(i=3D0; i<5; i++) { + if (an_read_record(sc, + (struct an_ltv_gen *)&areq)) { + error =3D EINVAL; + break; + } + if(key->kindex =3D=3D 0xffff) + break; + /* Required to get next entry */ + areq.an_type =3D AN_RID_WEP_PERM; + } + if(error) + break; + areq.an_type =3D AN_RID_WEP_PERM; key->kindex =3D 0xffff; if (an_read_record(sc, Index: if_anreg.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/dev/an/if_anreg.h,v retrieving revision 1.7 diff -u -r1.7 if_anreg.h --- if_anreg.h 2001/05/26 09:26:58 1.7 +++ if_anreg.h 2001/06/01 23:24:42 @@ -532,7 +532,7 @@ u_int16_t an_max_noise_prev_sec; /* 0x7A */ u_int16_t an_avg_noise_prev_min; /* 0x7C */ u_int16_t an_max_noise_prev_min; /* 0x7E */ - u_int16_t an_spare[3]; + u_int16_t an_spare[5]; }; =20 #define AN_STATUS_OPMODE_CONFIGURED 0x0001 --=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 --ew6BAiZeqk4r7MaW 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 iD8DBQE7Mr/pXY6L6fI4GtQRAmBDAJwNPkSvxJW/X4TbsEzYeCdxxNdT/wCg09n1 q4qyjZvd+m2pLXhFZssD494= =pkgJ -----END PGP SIGNATURE----- --ew6BAiZeqk4r7MaW-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Jun 21 21:24: 3 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 88C9437B407; Thu, 21 Jun 2001 21:23:59 -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 f5M4NxB22079; Thu, 21 Jun 2001 21:23:59 -0700 Date: Thu, 21 Jun 2001 21:23:59 -0700 From: Brooks Davis To: audit@FreeBSD.ORG, mobile@FreeBSD.ORG Subject: Re: review request: an(4) patches Message-ID: <20010621212359.B20591@Odin.AC.HMC.Edu> References: <20010621204755.A18153@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="gj572EiMnwbLXET9" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010621204755.A18153@Odin.AC.HMC.Edu>; from brooks@one-eyed-alien.net on Thu, Jun 21, 2001 at 08:47:55PM -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 --gj572EiMnwbLXET9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Warner pointed out a number of style(9) bugs (mostly lack of white space) so I've posted an updated diff at: http://people.freebsd.org/~brooks/patches/an.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 --gj572EiMnwbLXET9 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 iD8DBQE7MsheXY6L6fI4GtQRAguOAKDIGlLuPAOLWtr5U0Lr25YEeFlXcgCcC1ck qoRbFp1jeFExXr19bp+Gi28= =FbPP -----END PGP SIGNATURE----- --gj572EiMnwbLXET9-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 1:46:50 2001 Delivered-To: freebsd-audit@freebsd.org Received: from columbus.cris.net (columbus.cris.net [212.110.128.65]) by hub.freebsd.org (Postfix) with ESMTP id 791D737B40A; Fri, 22 Jun 2001 01:46:35 -0700 (PDT) (envelope-from phantom@phantom.cris.net) Received: from phantom.cris.net (phantom.cris.net [212.110.130.74]) by columbus.cris.net (8.9.3/8.9.3) with ESMTP id LAA09343; Fri, 22 Jun 2001 11:46:30 +0300 (EEST) Received: (from phantom@localhost) by phantom.cris.net (8.11.1/8.11.1) id f5M8kWw37037; Fri, 22 Jun 2001 11:46:32 +0300 (EEST) (envelope-from phantom) Date: Fri, 22 Jun 2001 11:46:32 +0300 From: Alexey Zelkin To: Dag-Erling Smorgrav Cc: Mike Barcroft , Peter Pentchev , hackers@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: whois(1) patch for review Message-ID: <20010622114632.A37004@phantom.cris.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from des@ofug.org on Fri, Jun 22, 2001 at 03:37:17AM +0200 X-Operating-System: FreeBSD 4.2-STABLE i386 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hi, On Fri, Jun 22, 2001 at 03:37:17AM +0200, Dag-Erling Smorgrav wrote: > > Arg.. I wish you had contacted me before doing this work. From looking at > > your patch, your using an old copy of my work. The newest one is available > > at: http://testbed.q9media.net/freebsd/whois.patch and will be committed > > very-shortly-now(tm). > > Since Mike's patch is a style cleanup with no functional impact except > plugging a memory leak, I feel it's better to commit it first, and > merge in Alexey's patch later, after it's been reviewed by this forum. Thanks! It makes things easer :) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 1:47:18 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 2D99337B403; Fri, 22 Jun 2001 01:47:16 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5M8xew84983; Fri, 22 Jun 2001 04:59:40 -0400 (EDT) (envelope-from mike) Date: Fri, 22 Jun 2001 04:59:40 -0400 (EDT) Message-Id: <200106220859.f5M8xew84983@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Cc: kris@FreeBSD.org Subject: WARNS cleanup 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 commit the following patch: http://testbed.q9media.net/freebsd/warns.20010622.patch It does the following: o Changes all occurrences in the source tree of WARNS= to WARNS?= Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 3:23:37 2001 Delivered-To: freebsd-audit@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id 6DBF037B407; Fri, 22 Jun 2001 03:23:35 -0700 (PDT) (envelope-from obrien@nuxi.ucdavis.edu) Received: from dragon.nuxi.com (root@trang.nuxi.com [206.40.252.115]) by relay.nuxi.com (8.11.2/8.11.2) with ESMTP id f5MANNR14264; Fri, 22 Jun 2001 03:23:24 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f5MANNv00591; Fri, 22 Jun 2001 03:23:23 -0700 (PDT) (envelope-from obrien) Date: Fri, 22 Jun 2001 03:23:19 -0700 From: "David O'Brien" To: Mike Heffner Cc: Mike Barcroft , freebsd-audit@freebsd.org, phk@freebsd.org Subject: Re: whois(1) patch Message-ID: <20010622032318.A506@dragon.nuxi.com> Reply-To: obrien@freebsd.org References: 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 Thu, May 31, 2001 at 06:26:06PM -0400 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, May 31, 2001 at 06:26:06PM -0400, Mike Heffner wrote: > On 31-May-2001 Mike Barcroft wrote: > | > | I originally made the ANSI C change to silence a warning, but is there any > | reason not to bring the code up to ANSI C spec? Is it likely that anyone > | will need to compile whois with a K&R compiler? > > It's not likely, but I'm not sure on what the consensus is on ANSI-fication. > Technically, style(9) says it shouldn't be done in this case, but people > (myself included) have been removing K&R support in small patches like this > one. And I strongly wish you guys would *STOP* doing that. > I think there was also talk of doing a full sweep to remove __P. Yes. Lets plan for a sweep in 6mo. or so and make the conversion. Many of us don't want the CSRG derived sources in various forms -- they should be kept consistent. -- -- David (obrien@FreeBSD.org) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 3:26:59 2001 Delivered-To: freebsd-audit@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id F285E37B401; Fri, 22 Jun 2001 03:26:56 -0700 (PDT) (envelope-from obrien@nuxi.ucdavis.edu) Received: from dragon.nuxi.com (root@trang.nuxi.com [206.40.252.115]) by relay.nuxi.com (8.11.2/8.11.2) with ESMTP id f5MAQuR14279; Fri, 22 Jun 2001 03:26:56 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f5MAQur00672; Fri, 22 Jun 2001 03:26:56 -0700 (PDT) (envelope-from obrien) Date: Fri, 22 Jun 2001 03:26:55 -0700 From: "David O'Brien" To: Garance A Drosihn Cc: Mike Heffner , Mike Barcroft , freebsd-audit@FreeBSD.ORG, phk@FreeBSD.ORG Subject: Re: whois(1) patch Message-ID: <20010622032655.A599@dragon.nuxi.com> Reply-To: obrien@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from drosih@rpi.edu on Sun, Jun 03, 2001 at 01:50:46AM -0400 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Jun 03, 2001 at 01:50:46AM -0400, Garance A Drosihn wrote: > It is not likely that there will be a specific sweep to get rid > of _P() and to ansi-ify routine declarations. I strongly think you are wrong. Many of us are talking of doing a sweep. But in a controlled consistent manner. > However, the > consensus is that if you are going to be changing the declarations > in some module for OTHER reasons, then you might want to ansi-ify. I would say "consensus" as much as tolerated. > If you're going to ansi-ify, then you should ansi-ify the whole > source file, instead of mixing styles. Yet another reason to just leave things as-is until a sweep is done. -- -- David (obrien@FreeBSD.org) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 3:32: 4 2001 Delivered-To: freebsd-audit@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id 2C81A37B401; Fri, 22 Jun 2001 03:32:02 -0700 (PDT) (envelope-from obrien@nuxi.ucdavis.edu) Received: from dragon.nuxi.com (root@trang.nuxi.com [206.40.252.115]) by relay.nuxi.com (8.11.2/8.11.2) with ESMTP id f5MAW1R14297; Fri, 22 Jun 2001 03:32:01 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f5MAW1t00776; Fri, 22 Jun 2001 03:32:01 -0700 (PDT) (envelope-from obrien) Date: Fri, 22 Jun 2001 03:32:01 -0700 From: "David O'Brien" To: Mike Barcroft Cc: Mike Heffner , phk@freebsd.org, freebsd-audit@freebsd.org Subject: Re: whois(1) patch Message-ID: <20010622033201.B506@dragon.nuxi.com> Reply-To: obrien@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mike@q9media.com on Thu, May 31, 2001 at 02:30:21PM -0400 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, May 31, 2001 at 02:30:21PM -0400, Mike Barcroft wrote: > > | It does the following: > > | > > | o Silence warnings and set WARNS=2 > > | o Fix two memory leaks > > | o asprint -> strdup where appropriate > > | o calloc/strcpy/strcat -> aprintf > > | o Convert to ANSI C to avoid having to prototype main() You should separate your patches into functionality and style(9). I see DES just committed this patch as is, rather than break it into two parts as our practices says it should have been. You also changed puts() to printf(). Was there a reason for making that change? -- -- David (obrien@FreeBSD.org) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 3:34:51 2001 Delivered-To: freebsd-audit@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id D4ECA37B406; Fri, 22 Jun 2001 03:34:46 -0700 (PDT) (envelope-from obrien@nuxi.ucdavis.edu) Received: from dragon.nuxi.com (root@trang.nuxi.com [206.40.252.115]) by relay.nuxi.com (8.11.2/8.11.2) with ESMTP id f5MAYgR14306; Fri, 22 Jun 2001 03:34:42 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f5MAYfx00871; Fri, 22 Jun 2001 03:34:41 -0700 (PDT) (envelope-from obrien) Date: Fri, 22 Jun 2001 03:34:41 -0700 From: "David O'Brien" To: Dag-Erling Smorgrav Cc: Mike Barcroft , Alexey Zelkin , Peter Pentchev , hackers@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: whois(1) patch for review Message-ID: <20010622033441.A197@dragon.nuxi.com> Reply-To: obrien@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from des@ofug.org on Fri, Jun 22, 2001 at 03:37:17AM +0200 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Jun 22, 2001 at 03:37:17AM +0200, Dag-Erling Smorgrav wrote: > Mike Barcroft writes: > > Arg.. I wish you had contacted me before doing this work. From looking at > > your patch, your using an old copy of my work. The newest one is available > > at: http://testbed.q9media.net/freebsd/whois.patch and will be committed > > very-shortly-now(tm). > > Since Mike's patch is a style cleanup with no functional impact except > plugging a memory leak, I feel it's better to commit it first, and > merge in Alexey's patch later, after it's been reviewed by this forum. Uh wrong. There were other non-style bits than just the memory leak. For instance the cast changes are functionalty related, not style. It should have been done in two commits. -- -- David (obrien@FreeBSD.org) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 3:35:41 2001 Delivered-To: freebsd-audit@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id BD8B637B409; Fri, 22 Jun 2001 03:35:37 -0700 (PDT) (envelope-from obrien@nuxi.ucdavis.edu) Received: from dragon.nuxi.com (root@trang.nuxi.com [206.40.252.115]) by relay.nuxi.com (8.11.2/8.11.2) with ESMTP id f5MAZbR14321; Fri, 22 Jun 2001 03:35:37 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f5MAZaq00910; Fri, 22 Jun 2001 03:35:36 -0700 (PDT) (envelope-from obrien) Date: Fri, 22 Jun 2001 03:35:36 -0700 From: "David O'Brien" To: Alexey Zelkin Cc: hackers@FreeBSD.org, audit@FreeBSD.org, bde@FreeBSD.org, ache@FreeBSD.org Subject: Re: whois(1) patch for review Message-ID: <20010622033536.B197@dragon.nuxi.com> Reply-To: obrien@FreeBSD.org References: <20010621160821.A30249@phantom.cris.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010621160821.A30249@phantom.cris.net>; from phantom@FreeBSD.org.ua on Thu, Jun 21, 2001 at 04:08:21PM +0300 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jun 21, 2001 at 04:08:21PM +0300, Alexey Zelkin wrote: > > For example you can have following string in your whoisservers > configuration file (system wide -- /usr/share/misc/whoiservers > or personal ~/.whoisservers): System wide configuration files should be in /etc, not /usr/share/misc. -- -- David (obrien@FreeBSD.org) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 3:42:38 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mout0.freenet.de (mout0.freenet.de [194.97.50.131]) by hub.freebsd.org (Postfix) with ESMTP id 1D57C37B409; Fri, 22 Jun 2001 03:42:34 -0700 (PDT) (envelope-from Alexander@leidinger.net) Received: from [194.97.50.138] (helo=mx0.freenet.de) by mout0.freenet.de with esmtp (Exim 3.30 #3) id 15DOOW-0003pd-00; Fri, 22 Jun 2001 12:42:32 +0200 Received: from b83b4.pppool.de ([213.7.131.180] helo=Magelan.Leidinger.net) by mx0.freenet.de with esmtp (Exim 3.30 #3) id 15DOOV-0003dG-00; Fri, 22 Jun 2001 12:42:32 +0200 Received: from Leidinger.net (netchild@localhost [127.0.0.1]) by Magelan.Leidinger.net (8.11.4/8.11.4) with ESMTP id f5M99EK02123; Fri, 22 Jun 2001 11:09:15 +0200 (CEST) (envelope-from netchild@Leidinger.net) Message-Id: <200106220909.f5M99EK02123@Magelan.Leidinger.net> Date: Fri, 22 Jun 2001 11:09:13 +0200 (CEST) From: Alexander Leidinger Subject: Re: whois(1) patch for review To: ache@nagual.pp.ru Cc: hackers@FreeBSD.ORG, audit@FreeBSD.ORG, bde@FreeBSD.ORG In-Reply-To: <20010621222343.C23514@nagual.pp.ru> 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 21 Jun, Andrey A. Chernov wrote: > For domain names it works without '-Q' too. The main problem not with > domain names wich have "." found via whois-servers.net, but for > identificators or subnets without suffix, like: > > whois -c ru XXX-RIPN > whois -c ru 123.123.123.123 What about /etc/whoisrc instead of /usr/share/whois? Bye, Alexander. -- I believe the technical term is "Oops!" http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint = C518 BC70 E67F 143F BE91 3365 79E2 9C60 B006 3FE7 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 9:32:32 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 8F99737B407; Fri, 22 Jun 2001 09:32:26 -0700 (PDT) (envelope-from mike@q9media.com) Received: from [192.168.1.10] (vega.tct.net [216.94.230.13]) by coffee.q9media.com (8.11.2/8.11.2) with ESMTP id f5MGirL85366; Fri, 22 Jun 2001 12:44:53 -0400 (EDT) (envelope-from mike@q9media.com) User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Fri, 22 Jun 2001 12:32:26 -0400 Subject: Re: whois(1) patch From: Mike Barcroft To: Cc: Mike Heffner , , Message-ID: In-Reply-To: <20010622033201.B506@dragon.nuxi.com> Mime-version: 1.0 Organization: q9 media 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 6/22/01 6:32 AM, David O'Brien at obrien@freebsd.org wrote: > You should separate your patches into functionality and style(9). > I see DES just committed this patch as is, rather than break it into two > parts as our practices says it should have been. Sorry. I'll make sure I do this in future. > You also changed puts() to printf(). Was there a reason for making that > change? style(9): Use printf(3), not fputs/puts/putchar/whatever; it's faster and usually cleaner, not to mention avoiding stupid bugs. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 9:37:58 2001 Delivered-To: freebsd-audit@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id E720D37B401; Fri, 22 Jun 2001 09:37:55 -0700 (PDT) (envelope-from obrien@nuxi.ucdavis.edu) Received: from dragon.nuxi.com (root@trang.nuxi.com [206.40.252.115]) by relay.nuxi.com (8.11.2/8.11.2) with ESMTP id f5MGbtR16003; Fri, 22 Jun 2001 09:37:55 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f5MGbs638644; Fri, 22 Jun 2001 09:37:54 -0700 (PDT) (envelope-from obrien) Date: Fri, 22 Jun 2001 09:37:54 -0700 From: "David O'Brien" To: Mike Barcroft Cc: Mike Heffner , phk@freebsd.org, freebsd-audit@freebsd.org Subject: Re: whois(1) patch Message-ID: <20010622093754.B38146@dragon.nuxi.com> Reply-To: obrien@freebsd.org References: <20010622033201.B506@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mike@q9media.com on Fri, Jun 22, 2001 at 12:32:26PM -0400 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Jun 22, 2001 at 12:32:26PM -0400, Mike Barcroft wrote: > > You should separate your patches into functionality and style(9). > > I see DES just committed this patch as is, rather than break it into two > > parts as our practices says it should have been. > > Sorry. I'll make sure I do this in future. Thanks! :-) > > You also changed puts() to printf(). Was there a reason for making that > > change? > > style(9): > Use printf(3), not fputs/puts/putchar/whatever; it's faster and usually > cleaner, not to mention avoiding stupid bugs. Ah, I've missed that one. I haven't noticed anyone else do s/puts/printf/g in the name of style(9) before. -- -- David (obrien@FreeBSD.org) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 9:41: 1 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 72B7037B403; Fri, 22 Jun 2001 09:40:58 -0700 (PDT) (envelope-from mike@q9media.com) Received: from [192.168.1.10] (vega.tct.net [216.94.230.13]) by coffee.q9media.com (8.11.2/8.11.2) with ESMTP id f5MGrPL85381; Fri, 22 Jun 2001 12:53:26 -0400 (EDT) (envelope-from mike@q9media.com) User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Fri, 22 Jun 2001 12:40:58 -0400 Subject: Re: whois(1) patch From: Mike Barcroft To: Cc: Mike Heffner , Message-ID: In-Reply-To: <20010622032318.A506@dragon.nuxi.com> Mime-version: 1.0 Organization: q9 media 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 6/22/01 6:23 AM, David O'Brien at obrien@freebsd.org wrote: > On Thu, May 31, 2001 at 06:26:06PM -0400, Mike Heffner wrote: >> I think there was also talk of doing a full sweep to remove __P. > > Yes. Lets plan for a sweep in 6mo. or so and make the conversion. > Many of us don't want the CSRG derived sources in various forms -- they > should be kept consistent. Perhaps we should also remove the register storage-classes at that time. The best time to do this is probably right before 5.0 enters BETA, as to reduce the differences between -STABLE and -CURRENT. Is that your thinking as well? Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 9:45:57 2001 Delivered-To: freebsd-audit@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id 0F56437B403 for ; Fri, 22 Jun 2001 09:45:53 -0700 (PDT) (envelope-from obrien@nuxi.ucdavis.edu) Received: from dragon.nuxi.com (root@trang.nuxi.com [206.40.252.115]) by relay.nuxi.com (8.11.2/8.11.2) with ESMTP id f5MGjqR16051; Fri, 22 Jun 2001 09:45:52 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f5MGjqB38786; Fri, 22 Jun 2001 09:45:52 -0700 (PDT) (envelope-from obrien) Date: Fri, 22 Jun 2001 09:45:51 -0700 From: "David O'Brien" To: Mike Barcroft Cc: Mike Heffner , freebsd-audit@freebsd.org Subject: Re: whois(1) patch Message-ID: <20010622094551.D38146@dragon.nuxi.com> Reply-To: obrien@freebsd.org References: <20010622032318.A506@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mike@q9media.com on Fri, Jun 22, 2001 at 12:40:58PM -0400 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Jun 22, 2001 at 12:40:58PM -0400, Mike Barcroft wrote: > > Yes. Lets plan for a sweep in 6mo. or so and make the conversion. > > Many of us don't want the CSRG derived sources in various forms -- they > > should be kept consistent. > > Perhaps we should also remove the register storage-classes at that time. With out a doubt. I sort of see it as an ANSI'ifcation as such compilers tend to ignore `register' a lot more than K&R ones. > The best time to do this is probably right before 5.0 enters BETA, as to > reduce the differences between -STABLE and -CURRENT. Is that your thinking > as well? Not yet sure when the best time will be. -- -- David (obrien@FreeBSD.org) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 9:48:47 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 1F42437B403; Fri, 22 Jun 2001 09:48: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 f5MGmgV57634; Fri, 22 Jun 2001 10:48:43 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200106221648.f5MGmgV57634@harmony.village.org> To: obrien@FreeBSD.ORG Subject: Re: whois(1) patch Cc: Mike Barcroft , Mike Heffner , freebsd-audit@FreeBSD.ORG In-reply-to: Your message of "Fri, 22 Jun 2001 09:45:51 PDT." <20010622094551.D38146@dragon.nuxi.com> References: <20010622094551.D38146@dragon.nuxi.com> <20010622032318.A506@dragon.nuxi.com> Date: Fri, 22 Jun 2001 10:48: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 <20010622094551.D38146@dragon.nuxi.com> "David O'Brien" writes: : > The best time to do this is probably right before 5.0 enters BETA, as to : > reduce the differences between -STABLE and -CURRENT. Is that your thinking : > as well? : : Not yet sure when the best time will be. Sometime before 5.0. For userland side it can be done at any time, to be honest. For the kernel we need to wait until the SMPng work has settled down to a dull roar before doing it there. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 10: 6:46 2001 Delivered-To: freebsd-audit@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id 7BE2E37B409 for ; Fri, 22 Jun 2001 10:06:44 -0700 (PDT) (envelope-from obrien@nuxi.ucdavis.edu) Received: from dragon.nuxi.com (root@trang.nuxi.com [206.40.252.115]) by relay.nuxi.com (8.11.2/8.11.2) with ESMTP id f5MH6hR16164; Fri, 22 Jun 2001 10:06:43 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f5MH6hK39153; Fri, 22 Jun 2001 10:06:43 -0700 (PDT) (envelope-from obrien) Date: Fri, 22 Jun 2001 10:06:42 -0700 From: "David O'Brien" To: Warner Losh Cc: Mike Barcroft , Mike Heffner , freebsd-audit@FreeBSD.ORG Subject: Re: whois(1) patch Message-ID: <20010622100642.F38146@dragon.nuxi.com> Reply-To: obrien@FreeBSD.ORG References: <20010622094551.D38146@dragon.nuxi.com> <20010622032318.A506@dragon.nuxi.com> <20010622094551.D38146@dragon.nuxi.com> <200106221648.f5MGmgV57634@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: <200106221648.f5MGmgV57634@harmony.village.org>; from imp@harmony.village.org on Fri, Jun 22, 2001 at 10:48:42AM -0600 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Jun 22, 2001 at 10:48:42AM -0600, Warner Losh wrote: > In message <20010622094551.D38146@dragon.nuxi.com> "David O'Brien" writes: > : > The best time to do this is probably right before 5.0 enters BETA, as to > : > reduce the differences between -STABLE and -CURRENT. Is that your thinking > : > as well? > : > : Not yet sure when the best time will be. > > Sometime before 5.0. For userland side it can be done at any time, to > be honest. It would be nice to wait until more people can make it thru two `make world's in a row so that the commits are properly tested. It will also make MFC's harder. So I would wait until after 4.4 is released. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 16:44:50 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 346E737B401 for ; Fri, 22 Jun 2001 16:44:48 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5MNvIL85887; Fri, 22 Jun 2001 19:57:18 -0400 (EDT) (envelope-from mike) Date: Fri, 22 Jun 2001 19:57:18 -0400 (EDT) Message-Id: <200106222357.f5MNvIL85887@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.bin/enigma cleanup 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 commit the following patch: http://testbed.q9media.net/freebsd/enigma.20010622.patch It does the following: o Silence warning about missing prototype. o Silence warnings about random & deck shadowing a global declaration. o Set WARNS?=2 Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Jun 22 17: 9:57 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 E861A37B409; Fri, 22 Jun 2001 17:09:53 -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 <20010623000953.STC1034.iatl0x01@enterprise.muriel.penguinpowered.com>; Fri, 22 Jun 2001 20:09:53 -0400 Message-ID: X-Mailer: XFMail 1.4.7 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.4.7.FreeBSD:20010622200946:5666=_"; micalg=pgp-md5; protocol="application/pgp-signature" In-Reply-To: <20010622033201.B506@dragon.nuxi.com> MYHEADER: test Date: Fri, 22 Jun 2001 20:09:46 -0400 (EDT) Reply-To: Mike Heffner From: Mike Heffner To: "David O'Brien" Subject: Re: whois(1) patch Cc: freebsd-audit@freebsd.org, Mike Barcroft , phk@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.4.7.FreeBSD:20010622200946:5666=_ Content-Type: text/plain; charset=us-ascii On 22-Jun-2001 David O'Brien wrote: | On Thu, May 31, 2001 at 02:30:21PM -0400, Mike Barcroft wrote: |> > | It does the following: |> > | |> > | o Silence warnings and set WARNS=2 |> > | o Fix two memory leaks |> > | o asprint -> strdup where appropriate |> > | o calloc/strcpy/strcat -> aprintf |> > | o Convert to ANSI C to avoid having to prototype main() | | | You should separate your patches into functionality and style(9). | I see DES just committed this patch as is, rather than break it into two | parts as our practices says it should have been. | | You also changed puts() to printf(). Was there a reason for making that | change? Probably because style(9) mentions it: Use printf(3), not fputs/puts/putchar/whatever; it's faster and usually cleaner, not to mention avoiding stupid bugs. Mike -- Mike Heffner Fredericksburg, VA http://filebox.vt.edu/users/mheffner --_=XFMail.1.4.7.FreeBSD:20010622200946:5666=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7M95KFokZQs3sv5kRAkzCAJ0aki4jqpHbqBxMurtLevRFjRqqOwCfUHCA XdaCAeo8kyaFr0i0yhjmTu8= =vCHc -----END PGP SIGNATURE----- --_=XFMail.1.4.7.FreeBSD:20010622200946:5666=_-- 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 Fri Jun 22 17:27: 5 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 0A77137B406; Fri, 22 Jun 2001 17:27: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 <20010623002700.TCS1034.iatl0x01@enterprise.muriel.penguinpowered.com>; Fri, 22 Jun 2001 20:27:00 -0400 Message-ID: X-Mailer: XFMail 1.4.7 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.4.7.FreeBSD:20010622202651:5666=_"; micalg=pgp-md5; protocol="application/pgp-signature" In-Reply-To: <20010622032318.A506@dragon.nuxi.com> MYHEADER: test Date: Fri, 22 Jun 2001 20:26:51 -0400 (EDT) Reply-To: Mike Heffner From: Mike Heffner To: "David O'Brien" Subject: Re: whois(1) patch Cc: phk@freebsd.org, freebsd-audit@freebsd.org, Mike Barcroft , 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.4.7.FreeBSD:20010622202651:5666=_ Content-Type: text/plain; charset=us-ascii On 22-Jun-2001 David O'Brien wrote: | On Thu, May 31, 2001 at 06:26:06PM -0400, Mike Heffner wrote: |> On 31-May-2001 Mike Barcroft wrote: |> | |> | I originally made the ANSI C change to silence a warning, but is there any |> | reason not to bring the code up to ANSI C spec? Is it likely that anyone |> | will need to compile whois with a K&R compiler? |> |> It's not likely, but I'm not sure on what the consensus is on ANSI-fication. |> Technically, style(9) says it shouldn't be done in this case, but people |> (myself included) have been removing K&R support in small patches like this |> one. | | And I strongly wish you guys would *STOP* doing that. I try to reserve it for situations where a mix of various styles have been used. |> I think there was also talk of doing a full sweep to remove __P. | | Yes. Lets plan for a sweep in 6mo. or so and make the conversion. Yes! ;) Mike -- Mike Heffner Fredericksburg, VA http://filebox.vt.edu/users/mheffner --_=XFMail.1.4.7.FreeBSD:20010622202651:5666=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7M+JKFokZQs3sv5kRAjBYAJ95mYP6FydqnVzm+OGRVaWoANJGCwCffBb4 iLO6Q2+lpwySr1lMNGqZu24= =lxY3 -----END PGP SIGNATURE----- --_=XFMail.1.4.7.FreeBSD:20010622202651:5666=_-- 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 Fri Jun 22 17:30:24 2001 Delivered-To: freebsd-audit@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id 3CE0A37B401; Fri, 22 Jun 2001 17:30:21 -0700 (PDT) (envelope-from obrien@nuxi.ucdavis.edu) Received: from dragon.nuxi.com (root@trang.nuxi.com [206.40.252.115]) by relay.nuxi.com (8.11.2/8.11.2) with ESMTP id f5N0UER18693; Fri, 22 Jun 2001 17:30:14 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f5N0UD081193; Fri, 22 Jun 2001 17:30:13 -0700 (PDT) (envelope-from obrien) Date: Fri, 22 Jun 2001 17:30:08 -0700 From: "David O'Brien" To: Mike Heffner Cc: phk@freebsd.org, freebsd-audit@freebsd.org, Mike Barcroft Subject: Re: whois(1) patch Message-ID: <20010622173008.D39496@dragon.nuxi.com> Reply-To: obrien@freebsd.org References: <20010622032318.A506@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mheffner@novacoxmail.com on Fri, Jun 22, 2001 at 08:26:51PM -0400 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Jun 22, 2001 at 08:26:51PM -0400, Mike Heffner wrote: > | And I strongly wish you guys would *STOP* doing that. > > I try to reserve it for situations where a mix of various styles have > been used. That certainly makes sense today. -- -- David (obrien@FreeBSD.org) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Jun 23 5:14:55 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 DDD4137B408 for ; Sat, 23 Jun 2001 05:14:48 -0700 (PDT) (envelope-from roam@ringworld.nanolink.com) Received: (qmail 616 invoked by uid 1000); 23 Jun 2001 12:13:10 -0000 Date: Sat, 23 Jun 2001 15:13:10 +0300 From: Peter Pentchev To: arch@FreeBSD.org Cc: audit@FreeBSD.org Subject: patch for '%lld' handling in *scanf(3) Message-ID: <20010623151310.A497@ringworld.oblivion.bg> Mail-Followup-To: arch@FreeBSD.org, audit@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, 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. Demonstration: the following program: #include #include int main(void) { quad_t x = 0xeFFFFFFFFFFFFFFe; scanf("%lld", &x); printf("%llx\n", x); return (0); } Before: [roam@freefall ~/c/misc/foo]$ ./foo7 5 efffffff00000005 [roam@freefall ~/c/misc/foo]$ After: [roam@ringworld:v4 ~/c/misc/foo]$ ./foo7 5 5 [roam@ringworld:v4 ~/c/misc/foo]$ 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(). G'luck, Peter -- When you are not looking at it, this sentence is in Spanish. Index: src/lib/libc/stdio/vfscanf.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdio/vfscanf.c,v retrieving revision 1.16 diff -u -r1.16 vfscanf.c --- src/lib/libc/stdio/vfscanf.c 2001/02/10 05:46:05 1.16 +++ src/lib/libc/stdio/vfscanf.c 2001/06/23 12:12:30 @@ -186,7 +186,12 @@ flags |= SUPPRESS; goto again; case 'l': - flags |= LONG; + if (*fmt == 'l') { + fmt++; + flags |= QUAD; + } else { + flags |= LONG; + } goto again; case 'q': flags |= QUAD; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Jun 23 6: 9:34 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 4DCEF37B406 for ; Sat, 23 Jun 2001 06:09:27 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 1823 invoked by uid 1000); 23 Jun 2001 13:07:48 -0000 Date: Sat, 23 Jun 2001 16:07:48 +0300 From: Peter Pentchev To: arch@FreeBSD.org Cc: audit@FreeBSD.org Subject: Re: patch for '%lld' handling in *scanf(3) Message-ID: <20010623160748.C497@ringworld.oblivion.bg> Mail-Followup-To: arch@FreeBSD.org, audit@FreeBSD.org References: <20010623151310.A497@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: <20010623151310.A497@ringworld.oblivion.bg>; from roam@orbitel.bg on Sat, Jun 23, 2001 at 03:13:10PM +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 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 :) G'luck, Peter -- If you think this sentence is confusing, then change one pig. Index: src/lib/libc/stdio/vfscanf.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdio/vfscanf.c,v retrieving revision 1.16 diff -u -r1.16 vfscanf.c --- src/lib/libc/stdio/vfscanf.c 2001/02/10 05:46:05 1.16 +++ src/lib/libc/stdio/vfscanf.c 2001/06/23 13:09:23 @@ -77,6 +77,7 @@ #define POINTER 0x10 /* weird %p pointer (`fake hex') */ #define NOSKIP 0x20 /* do not skip blanks */ #define QUAD 0x400 +#define LONGLONG 0x800 /* * The following are used in numeric conversions only: @@ -186,7 +187,12 @@ flags |= SUPPRESS; goto again; case 'l': - flags |= LONG; + if (*fmt == 'l') { + fmt++; + flags |= LONGLONG; + } else { + flags |= LONG; + } goto again; case 'q': flags |= QUAD; @@ -290,6 +296,8 @@ *va_arg(ap, short *) = nread; else if (flags & LONG) *va_arg(ap, long *) = nread; + else if (flags & LONGLONG) + *va_arg(ap, long long *) = nread; else if (flags & QUAD) *va_arg(ap, quad_t *) = nread; else @@ -580,6 +588,8 @@ *va_arg(ap, short *) = res; else if (flags & LONG) *va_arg(ap, long *) = res; + else if (flags & LONGLONG) + *va_arg(ap, long long *) = res; else if (flags & QUAD) *va_arg(ap, quad_t *) = res; else To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Jun 23 11:19: 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 C3F3437B401 for ; Sat, 23 Jun 2001 11:18:52 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5NIVUk89438; Sat, 23 Jun 2001 14:31:30 -0400 (EDT) (envelope-from mike) Date: Sat, 23 Jun 2001 14:31:30 -0400 (EDT) Message-Id: <200106231831.f5NIVUk89438@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.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 commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/usr.bin.20010623.patch BTW, this patch should probably be tested on an alpha before committing. Best regards, Mike Barcroft ----------------------------------------------------------------------- usr.bin.20010623.patch o Set WARNS?=2 on Makefiles that should have it. o Tested on i386; alpha might have additional warnings. 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/23 18:02:36 @@ -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/23 18:02:36 @@ -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/23 18:02:37 @@ -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/23 18:02:37 @@ -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/23 18:02:37 @@ -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/23 18:02:38 @@ -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/23 18:02:38 @@ -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/23 18:02:38 @@ -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/23 18:02:38 @@ -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/23 18:02:38 @@ -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/23 18:02:39 @@ -2,6 +2,7 @@ PROG= gencat SRCS= gencat.c genlib.c +WARNS?= 2 CFLAGS+= -I${.CURDIR}/../../lib/libc/nls 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/23 18:02:39 @@ -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/23 18:02:40 @@ -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/23 18:02:40 @@ -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/23 18:02:40 @@ -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/23 18:02:41 @@ -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/23 18:02:41 @@ -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/23 18:02:42 @@ -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/23 18:02:45 @@ -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/23 18:02:47 @@ -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/23 18:02:47 @@ -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/23 18:02:48 @@ -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/23 18:02:48 @@ -1,5 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= yes +WARNS?= 2 .include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Jun 23 12: 0:38 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 CBBED37B408 for ; Sat, 23 Jun 2001 12:00:27 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5NJD6p89481; Sat, 23 Jun 2001 15:13:06 -0400 (EDT) (envelope-from mike) Date: Sat, 23 Jun 2001 15:13:06 -0400 (EDT) Message-Id: <200106231913.f5NJD6p89481@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: 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 I would appreciate it if someone would commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/usr.sbin.20010623.patch It seems src/usr.sbin is in worse shape than src/usr.bin with regards to compiler warnings. Again, this patch should probably be tested on an alpha before committing. Best regards, Mike Barcroft ----------------------------------------------------------------------- usr.sbin.20010623.patch o Set WARNS?=2 on Makefiles that should have it. o Tested on i386; alpha might have additional warnings. 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/23 18:50:44 @@ -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/23 18:50:47 @@ -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/23 18:50:47 @@ -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/23 18:50:48 @@ -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/23 18:50:53 @@ -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/23 18:50:55 @@ -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/23 18:50:58 @@ -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 Sat Jun 23 12: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 6343537B401 for ; Sat, 23 Jun 2001 12: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 f5NK34F89545; Sat, 23 Jun 2001 16:03:04 -0400 (EDT) (envelope-from mike) Date: Sat, 23 Jun 2001 16:03:04 -0400 (EDT) Message-Id: <200106232003.f5NK34F89545@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.sbin/ac 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 commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/ac.20010623.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- ac.20010623.patch o Silence compiler warnings and set WARNS?=2. Index: ac/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/ac/Makefile,v retrieving revision 1.6 diff -u -r1.6 Makefile --- ac/Makefile 2001/03/26 14:39:16 1.6 +++ ac/Makefile 2001/06/23 19:39:18 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/ac/Makefile,v 1.6 2001/03/26 14:39:16 ru Exp $ PROG= ac +WARNS?= 2 MAN= ac.8 # If "CONSOLE_TTY" is not defined, this program is compatible with the Index: ac/ac.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/ac/ac.c,v retrieving revision 1.16 diff -u -r1.16 ac.c --- ac/ac.c 2001/03/21 13:41:03 1.16 +++ ac/ac.c 2001/06/23 19:39:19 @@ -87,11 +87,11 @@ int ac __P((FILE *)); struct tty_list *add_tty __P((char *)); int do_tty __P((char *)); -FILE *file __P((char *)); +FILE *file __P((const char *)); struct utmp_list *log_in __P((struct utmp_list *, struct utmp *)); struct utmp_list *log_out __P((struct utmp_list *, struct utmp *)); int on_console __P((struct utmp_list *)); -void show __P((char *, time_t)); +void show __P((const char *, time_t)); void show_today __P((struct user_list *, struct utmp_list *, time_t)); void show_users __P((struct user_list *)); @@ -103,7 +103,7 @@ */ FILE * file(name) - char *name; + const char *name; { FILE *fp; @@ -293,7 +293,7 @@ */ void show(name, secs) - char *name; + const char *name; time_t secs; { (void)printf("\t%-*s %8.2f\n", UT_NAMESIZE, name, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Jun 23 14:45:35 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 E83ED37B405 for ; Sat, 23 Jun 2001 14:45:32 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5NLwC589659; Sat, 23 Jun 2001 17:58:12 -0400 (EDT) (envelope-from mike) Date: Sat, 23 Jun 2001 17:58:12 -0400 (EDT) Message-Id: <200106232158.f5NLwC589659@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.sbin/lptcontrol 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 commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/lptcontrol.20010623.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- lptcontrol.20010623.patch o Fix two compiler warnings and set WARNS?=2 Index: lptcontrol/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/lptcontrol/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- lptcontrol/Makefile 2001/03/26 14:40:43 1.4 +++ lptcontrol/Makefile 2001/06/23 21:42:37 @@ -1,7 +1,7 @@ # $FreeBSD: src/usr.sbin/lptcontrol/Makefile,v 1.4 2001/03/26 14:40:43 ru Exp $ PROG= lptcontrol +WARNS?= 2 MAN= lptcontrol.8 -CFLAGS+= -Wall .include Index: lptcontrol/lptcontrol.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/lptcontrol/lptcontrol.c,v retrieving revision 1.11 diff -u -r1.11 lptcontrol.c --- lptcontrol/lptcontrol.c 2000/07/14 07:55:26 1.11 +++ lptcontrol/lptcontrol.c 2001/06/23 21:42:37 @@ -56,7 +56,7 @@ #define USE_EXT_MODE 2 #define USE_STD_MODE 3 -static void usage() +static void usage(void) { fprintf(stderr, "usage: lptcontrol -i | -p | -s | -e [-d device]\n"); exit(1); @@ -77,7 +77,7 @@ { int opt; int irq_status = IRQ_INVALID; - char *device = DEFAULT_DEVICE; + const char *device = DEFAULT_DEVICE; while((opt = getopt(argc, argv, "ipesd:")) != -1) switch(opt) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Jun 23 15:52: 0 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 A7D7237B405 for ; Sat, 23 Jun 2001 15:51:55 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5NN4Zh89727; Sat, 23 Jun 2001 19:04:35 -0400 (EDT) (envelope-from mike) Date: Sat, 23 Jun 2001 19:04:35 -0400 (EDT) Message-Id: <200106232304.f5NN4Zh89727@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.sbin/zic 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 commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/zic.20010623.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- zic.20010623.patch o Silence a series of compiler warnings and set WARNS?=2 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)); /* ** Finally, some convenience items. Index: zic/scheck.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/zic/scheck.c,v retrieving revision 1.5 diff -u -r1.5 scheck.c --- zic/scheck.c 2000/11/28 18:18:56 1.5 +++ zic/scheck.c 2001/06/23 22:19:53 @@ -13,7 +13,7 @@ #include "private.h" -char * +const char * scheck(string, format) const char * const string; const char * const format; @@ -22,7 +22,7 @@ register const char * fp; register char * tp; register int c; - register char * result; + register const char * result; char dummy; static char nada; @@ -58,7 +58,7 @@ *tp++ = 'c'; *tp = '\0'; if (sscanf(string, fbuf, &dummy) != 1) - result = (char *) format; + result = format; ifree(fbuf); return result; } Index: zic/zic.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/zic/zic.c,v retrieving revision 1.12 diff -u -r1.12 zic.c --- zic/zic.c 2000/11/28 18:18:56 1.12 +++ zic/zic.c 2001/06/23 22:19:56 @@ -89,6 +89,7 @@ static void leapadd P((time_t t, int positive, int rolling, int count)); static void adjleap P((void)); static void associate P((void)); +static int atcomp P((const void * avp, const void * bvp)); static int ciequal P((const char * ap, const char * bp)); static void convert P((long val, char * buf)); static void dolink P((const char * fromfile, const char * tofile)); @@ -129,6 +130,7 @@ static void setuser P((uid_t *flag, const char *name)); static time_t tadd P((time_t t1, long t2)); static void usage P((void)); +static void warning P((const char * const string)); static void writezone P((const char * name)); static int yearistype P((int year, const char * type)); @@ -1360,12 +1362,14 @@ static int atcomp(avp, bvp) -void * avp; -void * bvp; +const void * avp; +const void * bvp; { - if (((struct attype *) avp)->at < ((struct attype *) bvp)->at) + if (((const struct attype *) avp)->at < + ((const struct attype *) bvp)->at) return -1; - else if (((struct attype *) avp)->at > ((struct attype *) bvp)->at) + else if (((const struct attype *) avp)->at > + ((const struct attype *) bvp)->at) return 1; else return 0; } Index: zic/zdump/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/zic/zdump/Makefile,v retrieving revision 1.6 diff -u -r1.6 Makefile --- zic/zdump/Makefile 2001/03/26 14:42:20 1.6 +++ zic/zdump/Makefile 2001/06/23 22:19:56 @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/.. PROG= zdump +WARNS?= 2 SRCS= zdump.c ialloc.c scheck.c MAN= ${.CURDIR}/../zdump.8 Index: zic/zic/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/zic/zic/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- zic/zic/Makefile 2001/03/26 14:42:20 1.7 +++ zic/zic/Makefile 2001/06/23 22:19:56 @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/.. PROG= zic +WARNS?= 2 SRCS= zic.c ialloc.c scheck.c MAN= ${.CURDIR}/../zic.8 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Jun 23 16:25: 9 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 C2C0D37B405 for ; Sat, 23 Jun 2001 16:25:06 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5NNblC89760; Sat, 23 Jun 2001 19:37:47 -0400 (EDT) (envelope-from mike) Date: Sat, 23 Jun 2001 19:37:47 -0400 (EDT) Message-Id: <200106232337.f5NNblC89760@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.sbin/boot98cfg 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 commit the patch at the end of this message. Also available at: http://testbed.q9media.net/freebsd/boot98cfg.20010623.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- boot98cfg.20010623.patch o Silence warning and set WARNS?=2 Index: boot98cfg/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/boot98cfg/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- boot98cfg/Makefile 2001/03/26 14:39:36 1.3 +++ boot98cfg/Makefile 2001/06/23 23:14:55 @@ -1,6 +1,7 @@ # $FreeBSD: src/usr.sbin/boot98cfg/Makefile,v 1.3 2001/03/26 14:39:36 ru Exp $ PROG= boot98cfg +WARNS?= 2 MAN= boot98cfg.8 .include Index: boot98cfg/boot98cfg.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/boot98cfg/boot98cfg.c,v retrieving revision 1.1 diff -u -r1.1 boot98cfg.c --- boot98cfg/boot98cfg.c 2000/08/02 10:11:08 1.1 +++ boot98cfg/boot98cfg.c 2001/06/23 23:14:55 @@ -114,7 +114,7 @@ main(int argc, char *argv[]) { char *endptr; - char *iplpath = "/boot/boot0", *menupath = "/boot/boot0.5"; + const char *iplpath = "/boot/boot0", *menupath = "/boot/boot0.5"; char *iplbakpath = NULL, *menubakpath = NULL; char *disk; int B_flag = 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 23 19:46: 3 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 0424E37B401; Sat, 23 Jun 2001 19:46:01 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id EAA80523; Sun, 24 Jun 2001 04:45:59 +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: obrien@FreeBSD.ORG Cc: Warner Losh , Mike Barcroft , Mike Heffner , freebsd-audit@FreeBSD.ORG Subject: Re: whois(1) patch References: <20010622094551.D38146@dragon.nuxi.com> <20010622032318.A506@dragon.nuxi.com> <20010622094551.D38146@dragon.nuxi.com> <200106221648.f5MGmgV57634@harmony.village.org> <20010622100642.F38146@dragon.nuxi.com> From: Dag-Erling Smorgrav Date: 24 Jun 2001 04:45:58 +0200 In-Reply-To: <20010622100642.F38146@dragon.nuxi.com> Message-ID: Lines: 10 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 "David O'Brien" writes: > It would be nice to wait until more people can make it thru two > `make world's in a row so that the commits are properly tested. Except for the occasional compiler breakage, you seem to be the only one having any significant trouble. 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 Sat Jun 23 19:50:58 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 B6F3C37B406 for ; Sat, 23 Jun 2001 19:50:55 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id EAA80548; Sun, 24 Jun 2001 04:50:52 +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 References: <200106231831.f5NIVUk89438@coffee.q9media.com> From: Dag-Erling Smorgrav Date: 24 Jun 2001 04:50:52 +0200 In-Reply-To: <200106231831.f5NIVUk89438@coffee.q9media.com> Message-ID: Lines: 14 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: > I would appreciate it if someone would commit the patch at the end of > this message. Not so fast. Please patch your /usr/share/mk/bsd.sys.mk to add -fno-builtin to CFLAGS when WARNS is greater than zero; some of the programs your patch marks as WARNS-safe (basename(1), for one) will then break due to calling exit(1) without including . Same goes for your usr.sbin warns patch. 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 Sat Jun 23 20: 9: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 3AE6D37B401 for ; Sat, 23 Jun 2001 20:09:19 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5O3M1S90006; Sat, 23 Jun 2001 23:22:01 -0400 (EDT) (envelope-from mike) Date: Sat, 23 Jun 2001 23:22:01 -0400 (EDT) Message-Id: <200106240322.f5O3M1S90006@coffee.q9media.com> To: audit@FreeBSD.org From: Mike Barcroft Subject: src/usr.bin/lsvfs 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/lsvfs.20010623.patch Best regards, Mike Barcroft ----------------------------------------------------------------------- lsvfs.20010623.patch o Silence compiler warning o Set WARNS?=2 Index: lsvfs/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/lsvfs/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- lsvfs/Makefile 1999/08/28 01:03:17 1.4 +++ lsvfs/Makefile 2001/06/24 03:02:21 @@ -1,4 +1,5 @@ # $FreeBSD: src/usr.bin/lsvfs/Makefile,v 1.4 1999/08/28 01:03:17 peter Exp $ PROG= lsvfs +WARNS?= 2 .include Index: lsvfs/lsvfs.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lsvfs/lsvfs.c,v retrieving revision 1.13 diff -u -r1.13 lsvfs.c --- lsvfs/lsvfs.c 1999/08/28 01:03:17 1.13 +++ lsvfs/lsvfs.c 2001/06/24 03:02:22 @@ -44,7 +44,7 @@ } } } else { - while (ovfcp = getvfsent()) { + while ((ovfcp = getvfsent()) != NULL) { printf(FMT, ovfcp->vfc_name, ovfcp->vfc_refcount, fmt_flags(ovfcp->vfc_flags)); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Jun 23 21:53:55 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 F2C8537B401 for ; Sat, 23 Jun 2001 21:53:48 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f5O56S790146; Sun, 24 Jun 2001 01:06:28 -0400 (EDT) (envelope-from mike) Date: Sun, 24 Jun 2001 01:06:28 -0400 (EDT) Message-Id: <200106240506.f5O56S790146@coffee.q9media.com> To: Dag-Erling Smorgrav From: Mike Barcroft Cc: audit@FreeBSD.org 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 Dag-Erling Smorgrav writes: > Not so fast. Please patch your /usr/share/mk/bsd.sys.mk to add > -fno-builtin to CFLAGS when WARNS is greater than zero; some of the > programs your patch marks as WARNS-safe (basename(1), for one) will > then break due to calling exit(1) without including . > > Same goes for your usr.sbin warns patch. Thanks for spotting that. The patch at the end of this e-mail and also available at: http://testbed.q9media.net/freebsd/include.20010624.patch addresses this problem. It should be applied before the usr.bin and usr.sbin patches. The other patches I sent to -audit weren't missing any includes. Best regards, Mike Barcroft ----------------------------------------------------------------------- include.20010624.patch o Include missing headers for which gcc has built-in equivalents. Index: basename/basename.c =================================================================== RCS file: /home/ncvs/src/usr.bin/basename/basename.c,v retrieving revision 1.7 diff -u -r1.7 basename.c --- basename/basename.c 2001/05/20 06:18:37 1.7 +++ basename/basename.c 2001/06/24 04:30:08 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include Index: dirname/dirname.c =================================================================== RCS file: /home/ncvs/src/usr.bin/dirname/dirname.c,v retrieving revision 1.7 diff -u -r1.7 dirname.c --- dirname/dirname.c 2000/09/06 07:28:02 1.7 +++ dirname/dirname.c 2001/06/24 04:30:09 @@ -46,6 +46,7 @@ #include #include #include +#include #include void usage __P((void)); Index: fsync/fsync.c =================================================================== RCS file: /home/ncvs/src/usr.bin/fsync/fsync.c,v retrieving revision 1.2 diff -u -r1.2 fsync.c --- fsync/fsync.c 2000/07/24 20:35:19 1.2 +++ fsync/fsync.c 2001/06/24 04:30:09 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include Index: gencat/gencat.c =================================================================== RCS file: /home/ncvs/src/usr.bin/gencat/gencat.c,v retrieving revision 1.6 diff -u -r1.6 gencat.c --- gencat/gencat.c 2001/02/08 16:38:16 1.6 +++ gencat/gencat.c 2001/06/24 04:30:10 @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include #include "gencat.h" Index: keyinfo/keyinfo.c =================================================================== RCS file: /home/ncvs/src/usr.bin/keyinfo/keyinfo.c,v retrieving revision 1.1 diff -u -r1.1 keyinfo.c --- keyinfo/keyinfo.c 2000/08/10 22:53:49 1.1 +++ keyinfo/keyinfo.c 2001/06/24 04:30:10 @@ -28,6 +28,7 @@ #include #include +#include #include #include #include Index: keylogout/keylogout.c =================================================================== RCS file: /home/ncvs/src/usr.bin/keylogout/keylogout.c,v retrieving revision 1.3 diff -u -r1.3 keylogout.c --- keylogout/keylogout.c 1999/08/28 01:02:29 1.3 +++ keylogout/keylogout.c 2001/06/24 04:30:10 @@ -41,6 +41,8 @@ */ #include +#include +#include #include #include Index: leave/leave.c =================================================================== RCS file: /home/ncvs/src/usr.bin/leave/leave.c,v retrieving revision 1.7 diff -u -r1.7 leave.c --- leave/leave.c 2001/05/30 02:38:10 1.7 +++ leave/leave.c 2001/06/24 04:30:11 @@ -49,6 +49,7 @@ #include #include #include +#include #include #include Index: mkfifo/mkfifo.c =================================================================== RCS file: /home/ncvs/src/usr.bin/mkfifo/mkfifo.c,v retrieving revision 1.5 diff -u -r1.5 mkfifo.c --- mkfifo/mkfifo.c 1999/08/28 01:04:06 1.5 +++ mkfifo/mkfifo.c 2001/06/24 04:30:12 @@ -51,6 +51,7 @@ #include #include #include +#include #include #include Index: unexpand/unexpand.c =================================================================== RCS file: /home/ncvs/src/usr.bin/unexpand/unexpand.c,v retrieving revision 1.5 diff -u -r1.5 unexpand.c --- unexpand/unexpand.c 1999/08/28 01:07:04 1.5 +++ unexpand/unexpand.c 2001/06/24 04:30:13 @@ -50,6 +50,7 @@ */ #include #include +#include #include char genbuf[BUFSIZ]; Index: lastlogin.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/lastlogin/lastlogin.c,v retrieving revision 1.2 diff -u -r1.2 lastlogin.c --- lastlogin.c 2000/12/10 20:57:23 1.2 +++ lastlogin.c 2001/06/24 04:31:10 @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message