From owner-freebsd-audit Mon May 14 0:20:35 2001 Delivered-To: freebsd-audit@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id DE1FB37B42C for ; Mon, 14 May 2001 00:20:18 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 7A3BF3E28; Mon, 14 May 2001 00:20:18 -0700 (PDT) To: audit@freebsd.org Cc: Bruce Evans , Warner Losh Subject: Re: jot(1) patch Date: Mon, 14 May 2001 00:20:18 -0700 From: Dima Dorfman Message-Id: <20010514072018.7A3BF3E28@bazooka.unixfreak.org> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -------- Hi folks, Anyone care to commit this or should I? Attached is the latest version that doesn't break K&R support. Thanks! Dima Dorfman dima@unixfreak.org Dima Dorfman writes: > Bruce Evans writes: > > On Wed, 9 May 2001, Warner Losh wrote: > > > > > In message <20010509210433.1BDA13E28@bazooka.unixfreak.org> Dima Dorfman > wr > > ites: > > > : - use getopt > > > : - de-register > > > > > > You should de __P() as well. The changes add a prototype > > > > > > : -usage() > > > : +usage(void) > > > > > > which breaks K&R compatibility. So do one or the other. The one > > > thing worse than old K&R code in the tree is broken K&R code in the > > > tree. > > > > You should just not gratuitously break usage(). usage() is already > > declared to take a void in its forward declaration using __P(()), > > so using "void" in its definition just breaks K&R support. > > Fair enough. The attached patch is like the first one I sent, but > doesn't include the change to break K&R support. > > If there's nothing wrong with this could someone please commit it? > > Thanks, > > Dima Dorfman > dima@unixfreak.org Index: jot.c =================================================================== RCS file: /st/src/FreeBSD/src/usr.bin/jot/jot.c,v retrieving revision 1.14 diff -u -r1.14 jot.c --- jot.c 2000/07/10 05:57:29 1.14 +++ jot.c 2001/05/14 07:18:20 @@ -65,7 +65,7 @@ #define ENDER_DEF 100 #define STEP_DEF 1 -#define isdefault(s) (strcmp((s), "-") == 0) +#define is_default(s) (strcmp((s), "-") == 0) double begin; double ender; @@ -83,11 +83,10 @@ char *sepstring = "\n"; char format[BUFSIZ]; -void getargs __P((int, char *[])); -void getformat __P((void)); +void getformat __P((void)); int getprec __P((char *)); -int putdata __P((double, long)); -static void usage __P((void)); +int putdata __P((double, long)); +static void usage __P((void)); int main(argc, argv) @@ -96,37 +95,15 @@ { double xd, yd; long id; - register double *x = &xd; - register double *y = &yd; - register long *i = &id; + double *x = &xd; + double *y = &yd; + long *i = &id; + unsigned int mask = 0; + int n = 0; + int ch; - getargs(argc, argv); - if (randomize) { - *x = (ender - begin) * (ender > begin ? 1 : -1); - for (*i = 1; *i <= reps || infinity; (*i)++) { - *y = (double) arc4random() / ULONG_MAX; - if (putdata(*y * *x + begin, reps - *i)) - errx(1, "range error in conversion"); - } - } else - for (*i = 1, *x = begin; *i <= reps || infinity; (*i)++, *x += s) - if (putdata(*x, reps - *i)) - errx(1, "range error in conversion"); - if (!nofinalnl) - putchar('\n'); - exit(0); -} - -void -getargs(ac, av) - int ac; - char *av[]; -{ - register unsigned int mask = 0; - register int n = 0; - - while (--ac && **++av == '-' && !isdefault(*av)) - switch ((*av)[1]) { + while ((ch = getopt(argc, argv, "rb:w:cs:np:")) != -1) + switch ((char)ch) { case 'r': randomize = 1; break; @@ -138,72 +115,63 @@ break; case 'b': boring = 1; + /* FALLTHROUGH */ case 'w': - if ((*av)[2]) - strcpy(format, *av + 2); - else if (!--ac) - errx(1, "need context word after -w or -b"); - else - strcpy(format, *++av); + if (strlcpy(format, optarg, sizeof(format)) >= + sizeof(format)) + errx(1, "-%c word too long", ch); break; case 's': - if ((*av)[2]) - sepstring = *av + 2; - else if (!--ac) - errx(1, "need string after -s"); - else - sepstring = *++av; + sepstring = optarg; break; case 'p': - if ((*av)[2]) - prec = atoi(*av + 2); - else if (!--ac) - errx(1, "need number after -p"); - else - prec = atoi(*++av); + prec = atoi(optarg); if (prec <= 0) errx(1, "bad precision value"); break; default: usage(); } + argc -= optind; + argv += optind; - switch (ac) { /* examine args right to left, falling thru cases */ + switch (argc) { /* examine args right to left, falling thru cases */ case 4: - if (!isdefault(av[3])) { - if (!sscanf(av[3], "%lf", &s)) - errx(1, "bad s value: %s", av[3]); + if (!is_default(argv[3])) { + if (!sscanf(argv[3], "%lf", &s)) + errx(1, "bad s value: %s", argv[3]); mask |= 01; } case 3: - if (!isdefault(av[2])) { - if (!sscanf(av[2], "%lf", &ender)) - ender = av[2][strlen(av[2])-1]; + if (!is_default(argv[2])) { + if (!sscanf(argv[2], "%lf", &ender)) + ender = argv[2][strlen(argv[2])-1]; mask |= 02; if (!prec) - n = getprec(av[2]); + n = getprec(argv[2]); } case 2: - if (!isdefault(av[1])) { - if (!sscanf(av[1], "%lf", &begin)) - begin = av[1][strlen(av[1])-1]; + if (!is_default(argv[1])) { + if (!sscanf(argv[1], "%lf", &begin)) + begin = argv[1][strlen(argv[1])-1]; mask |= 04; if (!prec) - prec = getprec(av[1]); + prec = getprec(argv[1]); if (n > prec) /* maximum precision */ prec = n; } case 1: - if (!isdefault(av[0])) { - if (!sscanf(av[0], "%ld", &reps)) - errx(1, "bad reps value: %s", av[0]); + if (!is_default(argv[0])) { + if (!sscanf(argv[0], "%ld", &reps)) + errx(1, "bad reps value: %s", argv[0]); mask |= 010; } break; case 0: usage(); default: - errx(1, "too many arguments. What do you mean by %s?", av[4]); + errx(1, "too many arguments. What do you mean by %s?", + argv[4]); } getformat(); while (mask) /* 4 bit mask has 1's where last 4 args were given */ @@ -257,7 +225,7 @@ mask = 015; break; case 012: - s = (randomize ? -1.0 : STEP_DEF); + s = (randomize ? time(NULL) : STEP_DEF); mask = 013; break; case 013: @@ -265,8 +233,7 @@ begin = BEGIN_DEF; else if (reps == 0) errx(1, "must specify begin if reps == 0"); - else - begin = ender - reps * s + s; + begin = ender - reps * s + s; mask = 0; break; case 014: @@ -306,6 +273,20 @@ } if (reps == 0) infinity = 1; + if (randomize) { + *x = (ender - begin) * (ender > begin ? 1 : -1); + for (*i = 1; *i <= reps || infinity; (*i)++) { + *y = (double) arc4random() / ULONG_MAX; + if (putdata(*y * *x + begin, reps - *i)) + errx(1, "range error in conversion"); + } + } else + for (*i = 1, *x = begin; *i <= reps || infinity; (*i)++, *x += s) + if (putdata(*x, reps - *i)) + errx(1, "range error in conversion"); + if (!nofinalnl) + putchar('\n'); + exit(0); } int @@ -358,8 +339,8 @@ getprec(s) char *s; { - register char *p; - register char *q; + char *p; + char *q; for (p = s; *p; p++) if (*p == '.') @@ -375,8 +356,9 @@ void getformat() { - register char *p; + char *p; int dot, hash, space, sign, numbers = 0; + size_t sz; char *s; if (boring) /* no need to bother */ @@ -384,14 +366,19 @@ for (p = format; *p; p++) /* look for '%' */ if (*p == '%' && *(p+1) != '%') /* leave %% alone */ break; - if (!*p && !chardata) - sprintf(p, "%%.%df", prec); - else if (!*p && chardata) { - strcpy(p, "%c"); + sz = sizeof(format) - strlen(format) - 1; + if (!*p && !chardata) { + if (snprintf(p, sz, "%%.%df", prec) >= (int)sz) + errx(1, "-w word too long"); + } else if (!*p && chardata) { + if (strlcpy(p, "%c", sz) >= sz) + errx(1, "-w word too long"); intdata = 1; - } else if (!*(p+1)) + } else if (!*(p+1)) { + if (sz <= 0) + errx(1, "-w word too long"); strcat(format, "%"); /* cannot end in single '%' */ - else { + } else { /* * Allow conversion format specifiers of the form * %[#][ ][{+,-}][0-9]*[.[0-9]*]? where ? must be one of To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon May 14 12:13: 4 2001 Delivered-To: freebsd-audit@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 5405537B423; Mon, 14 May 2001 12:13:01 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f4EJCvG01821; Mon, 14 May 2001 12:12:57 -0700 (PDT) Date: Mon, 14 May 2001 12:12:57 -0700 From: Alfred Perlstein To: Ruslan Ermilov Cc: audit@FreeBSD.org, freebsd-standards@bostonradio.org Subject: Re: Please review: new implementation of hsearch(3) Message-ID: <20010514121257.Q18676@fw.wintelcom.net> References: <20010511143904.A58159@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: <20010511143904.A58159@sunbay.com>; from ru@FreeBSD.org on Fri, May 11, 2001 at 02:39:05PM +0300 X-all-your-base: are belong to us. Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Ruslan Ermilov [010514 12:10] wrote: > Hi! > > Our current hsearch(3) implementation is buggy in many ways. > The most limiting factor is that it can only handle char * > item.data despite the type was recently changed to void *. > (See example in the manpage.) > > The attached patch merely merges NetBSD re-implementation of > the hsearch(3), which is POSIX.1-200x conformant. Nice, it'd be sorta cool if we offered expanded versions that allowed for more than one hash table at a time. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon May 14 23:40:36 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 6D7E437B423 for ; Mon, 14 May 2001 23:40:32 -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 f4F6eCq14423; Tue, 15 May 2001 09:40:12 +0300 (EEST) (envelope-from ru) Date: Tue, 15 May 2001 09:40:12 +0300 From: Ruslan Ermilov To: Alfred Perlstein Cc: audit@FreeBSD.org, freebsd-standards@bostonradio.org Subject: Re: Please review: new implementation of hsearch(3) Message-ID: <20010515094012.A14389@sunbay.com> References: <20010511143904.A58159@sunbay.com> <20010514121257.Q18676@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010514121257.Q18676@fw.wintelcom.net>; from bright@wintelcom.net on Mon, May 14, 2001 at 12:12:57PM -0700 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, May 14, 2001 at 12:12:57PM -0700, Alfred Perlstein wrote: > * Ruslan Ermilov [010514 12:10] wrote: > > Hi! > > > > Our current hsearch(3) implementation is buggy in many ways. > > The most limiting factor is that it can only handle char * > > item.data despite the type was recently changed to void *. > > (See example in the manpage.) > > > > The attached patch merely merges NetBSD re-implementation of > > the hsearch(3), which is POSIX.1-200x conformant. > > Nice, it'd be sorta cool if we offered expanded versions that > allowed for more than one hash table at a time. > But these are POSIX compatible :-) -- 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 Tue May 15 4:57:45 2001 Delivered-To: freebsd-audit@freebsd.org Received: from green.bikeshed.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 60CB137B423; Tue, 15 May 2001 04:57:42 -0700 (PDT) (envelope-from green@green.bikeshed.org) Received: from localhost (green@localhost) by green.bikeshed.org (8.11.2/8.11.1) with ESMTP id f4FBvaw71562; Tue, 15 May 2001 07:57:40 -0400 (EDT) (envelope-from green@green.bikeshed.org) Message-Id: <200105151157.f4FBvaw71562@green.bikeshed.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Ruslan Ermilov Cc: Alfred Perlstein , audit@FreeBSD.org, freebsd-standards@bostonradio.org Subject: Re: Please review: new implementation of hsearch(3) In-Reply-To: Message from Ruslan Ermilov of "Tue, 15 May 2001 09:40:12 +0300." <20010515094012.A14389@sunbay.com> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 15 May 2001 07:57:35 -0400 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ruslan Ermilov wrote: > On Mon, May 14, 2001 at 12:12:57PM -0700, Alfred Perlstein wrote: > > * Ruslan Ermilov [010514 12:10] wrote: > > > Hi! > > > > > > Our current hsearch(3) implementation is buggy in many ways. > > > The most limiting factor is that it can only handle char * > > > item.data despite the type was recently changed to void *. > > > (See example in the manpage.) > > > > > > The attached patch merely merges NetBSD re-implementation of > > > the hsearch(3), which is POSIX.1-200x conformant. > > > > Nice, it'd be sorta cool if we offered expanded versions that > > allowed for more than one hash table at a time. > > > But these are POSIX compatible :-) I was thinking the same thing. Do something exactly like how strtok_r() and strtok() are done :) That doesn't add much overhead or effort at all. -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu May 17 11: 5:54 2001 Delivered-To: freebsd-audit@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 8C9B537B423 for ; Thu, 17 May 2001 11:05:52 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.3/8.11.3) with SMTP id f4HI5lf22138 for ; Thu, 17 May 2001 14:05:47 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Thu, 17 May 2001 14:05:46 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: audit@FreeBSD.org Subject: RE: Patch to eliminate struct pcred (fwd) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thanks to all for the additional comments, here's what I hope will be (almost) the final version of the patch, which I'd like to commit in the next couple of days: http://www.watson.org/~robert/pcred/pcred.5.diff (Note that I've moved the other pcred patches into that directory also) Most changes made since the last revision were to simplify logic, improve style(9) compliance, et al. Once pcred has been eliminated, I'll move on with the securelevel patches, and then jailNG. Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu May 17 22:17:34 2001 Delivered-To: freebsd-audit@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id 5CA8337B423 for ; Thu, 17 May 2001 22:17:27 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id D1FD83E0B for ; Thu, 17 May 2001 22:17:26 -0700 (PDT) To: audit@freebsd.org Subject: Patch to make snp(4) a module Date: Thu, 17 May 2001 22:17:26 -0700 From: Dima Dorfman Message-Id: <20010518051726.D1FD83E0B@bazooka.unixfreak.org> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: X-Loop: FreeBSD.ORG Please review the attached patch to make snp(4) a module. Right now, two things stop it from being one: it relies on hacks in the tty subsystem which are compiled in just for it, and there is no kld code in it. The hacks in the tty subsystem look like this: #ifdef DEV_SNP if (ISSET(tp->t_state, TS_SNOOP) && tp->t_sc != NULL) snpin((struct snoop *)tp->t_sc, cp, cc); #endif The patch solves this problem by using line disciplines to get the information it needs. I don't know whether this is abuse or how bad it is, but I sent this to -hackers a little while ago and no one responsed (which means it's not interesting enough to say anything but not ugly enough to warrant a bikeshed, either). The second problem of not having kld code is solved in the obvious manner (by adding the code). Please review. Thanks in advance, Dima Dorfman dima@unixfreak.org Index: kern/tty_snoop.c =================================================================== RCS file: /st/src/FreeBSD/src/sys/kern/tty_snoop.c,v retrieving revision 1.53 diff -u -r1.53 tty_snoop.c --- kern/tty_snoop.c 2001/04/17 20:53:11 1.53 +++ kern/tty_snoop.c 2001/05/15 04:15:51 @@ -12,10 +12,9 @@ * * Snoop stuff. * - * $FreeBSD: src/sys/kern/tty_snoop.c,v 1.53 2001/04/17 20:53:11 dd Exp $ + * $FreeBSD$ */ -#include "opt_compat.h" #include #include #include @@ -29,6 +28,7 @@ #include #include #include +#include static d_open_t snpopen; static d_close_t snpclose; @@ -61,9 +61,63 @@ static MALLOC_DEFINE(M_SNP, "snp", "Snoop device data"); +#define ttytosnp(t) (struct snoop *)(t)->t_sc static struct tty *snpdevtotty __P((dev_t dev)); static int snp_detach __P((struct snoop *snp)); +/* + * The number of the "snoop" line discipline. This gets determined at + * module load time. + */ +static int mylinedisc; + +static int +dsnwrite(struct tty *tp, struct uio *uio, int flag) +{ + struct snoop *snp = ttytosnp(tp); + int error = 0; + char ibuf[1024]; + int ilen; + struct iovec iov; + struct uio uio2; + + while (uio->uio_resid) { + ilen = MIN(sizeof(ibuf), uio->uio_resid); + error = uiomove(ibuf, ilen, uio); + if (error) + break; + snpin(snp, ibuf, ilen); + /* Hackish, but I think it's the least of all evils. */ + iov.iov_base = ibuf; + iov.iov_len = ilen; + uio2.uio_iov = &iov; + uio2.uio_iovcnt = 1; + uio2.uio_offset = 0; + uio2.uio_resid = ilen; + uio2.uio_segflg = UIO_SYSSPACE; + uio2.uio_rw = UIO_WRITE; + uio2.uio_procp = uio->uio_procp; + error = ttwrite(tp, &uio2, flag); + if (error) + break; + } + return (error); +} + +/* + * XXX should there be a global version of this? + */ +static int +l_nullioctl(struct tty *tp, u_long cmd, char *data, int flags, struct proc *p) +{ + + return (ENOIOCTL); +} + +static struct linesw snpdisc = { + ttyopen, ttylclose, ttread, dsnwrite, + l_nullioctl, ttyinput, ttstart, ttymodem }; + static struct tty * snpdevtotty (dev) dev_t dev; @@ -98,7 +152,7 @@ tp = snp->snp_tty; if ((tp->t_sc == snp) && (tp->t_state & TS_SNOOP) && - (tp->t_line == OTTYDISC || tp->t_line == NTTYDISC)) + tp->t_line == mylinedisc) goto tty_input; printf("Snoop: attempt to write to bad tty.\n"); @@ -334,9 +388,10 @@ tp = snp->snp_tty; if (tp && (tp->t_sc == snp) && (tp->t_state & TS_SNOOP) && - (tp->t_line == OTTYDISC || tp->t_line == NTTYDISC)) { + tp->t_line == mylinedisc) { tp->t_sc = NULL; tp->t_state &= ~TS_SNOOP; + tp->t_line = snp->snp_olddisc; } else printf("Snoop: bad attached tty data.\n"); @@ -409,12 +464,6 @@ if (!tp) return (EINVAL); - if ((tp->t_sc != (caddr_t)snp) && (tp->t_state & TS_SNOOP)) - return (EBUSY); - - if ((tp->t_line != OTTYDISC) && (tp->t_line != NTTYDISC)) - return (EBUSY); - s = spltty(); if (snp->snp_target == NODEV) { @@ -425,6 +474,8 @@ tp->t_sc = (caddr_t)snp; tp->t_state |= TS_SNOOP; + snp->snp_olddisc = tp->t_line; + tp->t_line = mylinedisc; snp->snp_tty = tp; snp->snp_target = tdev; @@ -503,8 +554,6 @@ return (revents); } -static void snp_drvinit __P((void *unused)); - static void snp_clone(void *arg, char *name, int namelen, dev_t *dev) { @@ -519,13 +568,31 @@ return; } -static void -snp_drvinit(unused) - void *unused; +static int +snp_modevent(module_t mod, int type, void *data) { + static eventhandler_tag eh_tag = NULL; - EVENTHANDLER_REGISTER(dev_clone, snp_clone, 0, 1000); - cdevsw_add(&snp_cdevsw); + switch (type) { + case MOD_LOAD: + eh_tag = EVENTHANDLER_REGISTER(dev_clone, snp_clone, 0, 1000); + mylinedisc = ldisc_register(LDISC_LOAD, &snpdisc); + cdevsw_add(&snp_cdevsw); + break; + case MOD_UNLOAD: + EVENTHANDLER_DEREGISTER(dev_clone, eh_tag); + ldisc_deregister(mylinedisc); + cdevsw_remove(&snp_cdevsw); + break; + default: + break; + } + return 0; } -SYSINIT(snpdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,snp_drvinit,NULL) +static moduledata_t snp_mod = { + "snp", + snp_modevent, + NULL +}; +DECLARE_MODULE(snp, snp_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR); Index: sys/snoop.h =================================================================== RCS file: /st/src/FreeBSD/src/sys/sys/snoop.h,v retrieving revision 1.14 diff -u -r1.14 snoop.h --- sys/snoop.h 1999/12/29 04:24:47 1.14 +++ sys/snoop.h 2001/05/15 04:15:51 @@ -54,6 +54,7 @@ #define SNOOP_OFLOW 0x0010 #define SNOOP_DOWN 0x0020 struct selinfo snp_sel; /* Selection info */ + int snp_olddisc; /* Old line discipline */ }; /* XXX several wrong storage classes and types here. */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu May 17 22:26:37 2001 Delivered-To: freebsd-audit@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id 758D237B424 for ; Thu, 17 May 2001 22:26:35 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 2DE963E28 for ; Thu, 17 May 2001 22:26:35 -0700 (PDT) To: audit@freebsd.org Subject: Short patch to id(1) Date: Thu, 17 May 2001 22:26:35 -0700 From: Dima Dorfman Message-Id: <20010518052635.2DE963E28@bazooka.unixfreak.org> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: X-Loop: FreeBSD.ORG Hi folks, Please review the attached short patch to id(1) to fix a minor cosmetic bug; id(1) will separate the list of groups with commas *only* if it is not invoked with a username as an argument as demonstrated here: dima@sungold% id uid=1003(dima) gid=100(users) groups=100(users), 0(wheel), 101(dns) dima@sungold% id dima uid=1003(dima) gid=100(users) groups=100(users) 0(wheel) 101(dns) I believe the correct behavior is to use commas in both cases. This is consistent with both NetBSD and OpenBSD. Thanks, Dima Dorfman dima@unixfreak.org Index: id.c =================================================================== RCS file: /st/src/FreeBSD/src/usr.bin/id/id.c,v retrieving revision 1.12 diff -u -r1.12 id.c --- id.c 1999/09/06 20:07:12 1.12 +++ id.c 2001/05/18 05:25:06 @@ -259,7 +259,7 @@ if (lastgid == (gid = groups[cnt])) continue; (void)printf(fmt, gid); - fmt = " %u"; + fmt = ", %u"; if ((gr = getgrgid(gid))) (void)printf("(%s)", gr->gr_name); lastgid = gid; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 4:26:33 2001 Delivered-To: freebsd-audit@freebsd.org Received: from lists01.iafrica.com (lists01.iafrica.com [196.7.0.141]) by hub.freebsd.org (Postfix) with ESMTP id EDBB037B424 for ; Fri, 18 May 2001 04:26:29 -0700 (PDT) (envelope-from sheldonh@uunet.co.za) Received: from nwl.fw.uunet.co.za ([196.31.2.162]) by lists01.iafrica.com with esmtp (Exim 3.12 #2) id 150iOi-00065L-00; Fri, 18 May 2001 13:26:20 +0200 Received: (from nobody@localhost) by nwl.fw.uunet.co.za (8.8.8/8.6.9) id NAA15949; Fri, 18 May 2001 13:26:19 +0200 (SAST) Received: by nwl.fw.uunet.co.za via recvmail id 15894; Fri May 18 13:26:06 2001 Received: from sheldonh (helo=axl.fw.uunet.co.za) by axl.fw.uunet.co.za with local-esmtp (Exim 3.22 #1) id 150iOU-000Id9-00; Fri, 18 May 2001 13:26:06 +0200 To: Dima Dorfman Cc: audit@freebsd.org Subject: Re: Short patch to id(1) In-reply-to: Your message of "Thu, 17 May 2001 22:26:35 MST." <20010518052635.2DE963E28@bazooka.unixfreak.org> Date: Fri, 18 May 2001 13:26:06 +0200 Message-ID: <71618.990185166@axl.fw.uunet.co.za> From: Sheldon Hearn Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: X-Loop: FreeBSD.ORG On Thu, 17 May 2001 22:26:35 MST, Dima Dorfman wrote: > - fmt = " %u"; > + fmt = ", %u"; Doesn't need a security audit. Just do it. :-) Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 4:41:26 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 0C33C37B422 for ; Fri, 18 May 2001 04:41:19 -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 f4IBf5569743; Fri, 18 May 2001 14:41:05 +0300 (EEST) (envelope-from ru) Date: Fri, 18 May 2001 14:41:05 +0300 From: Ruslan Ermilov To: Dima Dorfman Cc: audit@FreeBSD.ORG Subject: Re: Short patch to id(1) Message-ID: <20010518144105.A65354@sunbay.com> References: <20010518052635.2DE963E28@bazooka.unixfreak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010518052635.2DE963E28@bazooka.unixfreak.org>; from dima@unixfreak.org on Thu, May 17, 2001 at 10:26:35PM -0700 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: X-Loop: FreeBSD.ORG On Thu, May 17, 2001 at 10:26:35PM -0700, Dima Dorfman wrote: > Hi folks, > > Please review the attached short patch to id(1) to fix a minor > cosmetic bug; id(1) will separate the list of groups with commas > *only* if it is not invoked with a username as an argument as > demonstrated here: > > dima@sungold% id > uid=1003(dima) gid=100(users) groups=100(users), 0(wheel), 101(dns) > dima@sungold% id dima > uid=1003(dima) gid=100(users) groups=100(users) 0(wheel) 101(dns) > > I believe the correct behavior is to use commas in both cases. This > is consistent with both NetBSD and OpenBSD. > With the exception that NetBSD doesn't insert spaces after commas. Go ahead with this! Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 9:37:19 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 F155637B42C; Fri, 18 May 2001 09:37:13 -0700 (PDT) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.11.3/8.11.3) id f4IGbAe79287; Fri, 18 May 2001 20:37:11 +0400 (MSD) (envelope-from ache) Date: Fri, 18 May 2001 20:37:06 +0400 From: "Andrey A. Chernov" To: i18n@freebsd.org, audit@freebsd.org Subject: CFR: ISO_* -> ISO-* locale renaming Message-ID: <20010518203702.B79058@nagual.pp.ru> 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 In the spirit of GNU locale (which use IANA charsets too) I plan to rename our ISO_* locales to ISO-* ones, because ISO-* is preferred name according to http://www.iana.org/assignments/character-sets and we have only one locale name, it should be preferred. GNU locale use preferred MIME names in the first place too. Any comments? -- 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 Fri May 18 9:53: 0 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 AB18A37B424; Fri, 18 May 2001 09:52:53 -0700 (PDT) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.11.3/8.11.3) id f4IGqoF79479; Fri, 18 May 2001 20:52:51 +0400 (MSD) (envelope-from ache) Date: Fri, 18 May 2001 20:52:45 +0400 From: "Andrey A. Chernov" To: i18n@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: CFR: ISO_* -> ISO-* locale renaming Message-ID: <20010518205242.A79407@nagual.pp.ru> References: <20010518203702.B79058@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: <20010518203702.B79058@nagual.pp.ru>; from ache@nagual.pp.ru on Fri, May 18, 2001 at 08:37:06PM +0400 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, May 18, 2001 at 20:37:06 +0400, Andrey A. Chernov wrote: > In the spirit of GNU locale (which use IANA charsets too) I plan to rename > our ISO_* locales to ISO-* ones, because ISO-* is preferred name according > to http://www.iana.org/assignments/character-sets and we have only one > locale name, it should be preferred. GNU locale use preferred MIME names > in the first place too. > > Any comments? Other renames to preferred name: ASCII -> US-ASCII Other wrong names (not existed in IANA!) I find and plan for rename: ja_JP.EUC -> ja_JP.EUC-JP ja_JP.SJIS -> ja_JP.Shift_JIS ko_KR.EUC -> ko_KR.EUC-KR I doubt about this one: zh_CN.EUC There is no EUC-CN in IANA. What variant we should use? EUC-JP? -- 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 Fri May 18 10:10: 0 2001 Delivered-To: freebsd-audit@freebsd.org Received: from cartier.cirx.org (cartier.cirx.org [211.72.15.243]) by hub.freebsd.org (Postfix) with ESMTP id 114F937B424; Fri, 18 May 2001 10:09:54 -0700 (PDT) (envelope-from clive@tongi.org) Received: from cartier.cirx.org (nullmail@localhost [127.0.0.1]) by cartier.cirx.org (8.11.3/8.11.3) with SMTP id f4IH9Ka03012; Sat, 19 May 2001 01:09:20 +0800 (CST) (envelope-from clive@tongi.org) Received: (nullmailer pid 3008 invoked by uid 1000); Fri, 18 May 2001 17:09:20 -0000 Date: Sat, 19 May 2001 01:09:20 +0800 From: Clive Lin To: "Andrey A. Chernov" Cc: i18n@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: CFR: ISO_* -> ISO-* locale renaming Message-ID: <20010519010920.A2911@cartier.cirx.org> References: <20010518203702.B79058@nagual.pp.ru> <20010518205242.A79407@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: <20010518205242.A79407@nagual.pp.ru>; from ache@nagual.pp.ru on Fri, May 18, 2001 at 08:52:45PM +0400 X-PGP-key: http://www.cirx.org/~clive/clive.asc 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, May 18, 2001 at 08:52:45PM +0400, Andrey A. Chernov wrote: > I doubt about this one: > zh_CN.EUC > There is no EUC-CN in IANA. What variant we should use? EUC-JP? Just zh_CN.EUC -> zh_CN.GB2312 would be fine. They (almost) mean the same thing, but in different names. -- Clive Lin (Tong-I Lin) =P clive@tongi.org - Family, friends, private affairs =F clive@FreeBSD.org - Chinese ports, documentation =O clive@CirX.ORG - Others =J .* - What do you think about the 'J' ? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 10:57:38 2001 Delivered-To: freebsd-audit@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 1598437B424 for ; Fri, 18 May 2001 10:57:36 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.3/8.11.3) with SMTP id f4IHvHf39246; Fri, 18 May 2001 13:57:17 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Fri, 18 May 2001 13:57:16 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Sheldon Hearn Cc: Dima Dorfman , audit@freebsd.org Subject: Re: Short patch to id(1) In-Reply-To: <71618.990185166@axl.fw.uunet.co.za> 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 Fri, 18 May 2001, Sheldon Hearn wrote: > On Thu, 17 May 2001 22:26:35 MST, Dima Dorfman wrote: > > > - fmt = " %u"; > > + fmt = ", %u"; > > Doesn't need a security audit. Actually, non-security code review seems to be fine here also. Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 13:13:48 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ms1.din.or.jp (ms1.din.or.jp [210.135.65.21]) by hub.freebsd.org (Postfix) with ESMTP id 2947D37B440; Fri, 18 May 2001 13:13:24 -0700 (PDT) (envelope-from tshiozak@din.or.jp) Received: from localhost (ppp10-072.din.or.jp [210.135.74.103]) by ms1.din.or.jp (8.9.3/3.7W) with ESMTP id FAA07109; Sat, 19 May 2001 05:11:01 +0900 (JST) To: i18n@freebsd.org, audit@freebsd.org Cc: ache@nagual.pp.ru Cc: bsd-locale@hauN.org Subject: Re: CFR: ISO_* -> ISO-* locale renaming From: "T.SHIOZAKI" In-Reply-To: <20010518203702.B79058@nagual.pp.ru> References: <20010518203702.B79058@nagual.pp.ru> X-Mailer: Mew version 1.95b3 on Emacs 20.6 / Mule 4.1 (AOI) X-Prom-Mew: Prom-Mew 1.94 (procmail reader for Mew) X-My-Web-Root: http://www.imou.to/~AoiMoe/ X-Organization: The I18n/M17n project On Unix environments (IMOU), Japan. Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010519050946U.tshiozak@din.or.jp> Date: Sat, 19 May 2001 05:09:46 +0900 X-Dispatcher: imput version 20000228(IM140) Lines: 43 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 From: "Andrey A. Chernov" Subject: CFR: ISO_* -> ISO-* locale renaming Date: Fri, 18 May 2001 20:37:06 +0400 Message-ID: <20010518203702.B79058@nagual.pp.ru> > In the spirit of GNU locale (which use IANA charsets too) I plan to rename > our ISO_* locales to ISO-* ones, because ISO-* is preferred name according > to http://www.iana.org/assignments/character-sets and we have only one > locale name, it should be preferred. GNU locale use preferred MIME names > in the first place too. Your suggestion seems not so bad for me, because this policy is at least better than the current naming policy and there is a widely-used system that takes MIME names as the primary codeset names, that is Linux. Sure, the current locale naming policy of FreeBSD has several problems, e.g. "ja_JP.EUC" is absolutely wrong. # At this point, I'm more tolerant than Soda-san :-), # although I prefer "traditional" UNIX locale naming policy. I dare to say, - We should take an examination about the other policy at least once, that is the "traditional" UNIX locale naming policy taken by X, Tru64, HP-UX, etc. This convention is well used, although TOG no longer authorize nor maintain this name. On the other hand, Linux is the only system which uses MIME names as locale codeset now. - At least in Japan, nobody uses "ja_JP.EUC-JP". Instead, most Japanese people (even Linux users) use "ja_JP.eucJP" (and FreeBSD users still use ja_JP.EUC :-<). "ja_JP.eucJP" was determined by Japanese UNIX vendors' council and the effect of this past determination is still alive. We should prepare some aliases for such popular names, even if we take MIME names for locale codeset policy. - rename src/doc/ja_JP.eucJP once again? -- Takuya SHIOZAKI To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 15:38:38 2001 Delivered-To: freebsd-audit@freebsd.org Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) by hub.freebsd.org (Postfix) with ESMTP id 1646337B422; Fri, 18 May 2001 15:38:30 -0700 (PDT) (envelope-from soda@sra.co.jp) Received: from sranhf.sra.co.jp (sranhf [133.137.28.3]) by sraigw.sra.co.jp (8.8.7/3.7W-sraigw) with ESMTP id HAA07609; Sat, 19 May 2001 07:38:22 +0900 (JST) Received: from srapc342.sra.co.jp (root@srapc342 [133.137.28.111]) by sranhf.sra.co.jp (8.8.7/3.6Wbeta7-srambox) with ESMTP id HAA01690; Sat, 19 May 2001 07:38:22 +0900 (JST) Received: (from soda@localhost) by srapc342.sra.co.jp (8.8.8/3.4W-sra) id HAA29872; Sat, 19 May 2001 07:38:21 +0900 (JST) Date: Sat, 19 May 2001 07:38:21 +0900 (JST) Message-Id: <200105182238.HAA29872@srapc342.sra.co.jp> From: Noriyuki Soda To: ache@nagual.pp.ru, i18n@freebsd.org, audit@freebsd.org Cc: bsd-locale@hauN.org Subject: Re: CFR: ISO_* -> ISO-* locale renaming In-Reply-To: <20010519050946U.tshiozak@din.or.jp> References: <20010518203702.B79058@nagual.pp.ru> <20010519050946U.tshiozak@din.or.jp> 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 Andrey A. Chernov wrote: > In the spirit of GNU locale (which use IANA charsets too) I plan to rename > our ISO_* locales to ISO-* ones, because ISO-* is preferred name according > to http://www.iana.org/assignments/character-sets and we have only one > locale name, it should be preferred. GNU locale use preferred MIME names > in the first place too. It's highly suspicious to me. I still think that using X11 codeset name is better than using IANA registry due to the following problems. 6 questions. 1. As I already wrote, Solaris, Tru64 and IRIX uses "ISO8859-1". And X11's primary name of Latin-1 codeset is also "ISO8859-1". I prefer to use the name compatible with Solaris, Tru64, IRIX and X Window System, rather than the name only compatible with Linux. Note that Linux also supports "ISO8859-1" as locale's codeset suffix. So, if we use "ISO8859-1", we are still compatible with Linux, as well as Solaris, Tru64 and IRIX. If we use "ISO-8859-1", we are only compatible with Linux, and we become incompatible with Solaris, Tru64 and IRIX. Why do you think that it is better to become only compatible with Linux? For me, apparently "ISO8859-1" is better. 2. What codeset name will you use for codesets which are available on X Window System, but not defined in IANA registry? (Yes, there is such codeset in locales supported by X11, already.) If we follow the convention of X Window System, this problem never happens. Note that nl_langinfo(CODESET) of glibc-2 returns *WRONG* result for such locale. 3. IANA registry (MIME charset name) is case insensitive. Will you support case-insensitive codeset-suffix for locale name? Yes, codeset-suffix in glibc is case insenstive, although language part and territory part of locale name are case sensitive. i.e. ja_JP.EUC-JP, ja_JP.eUc-jP, ja_JP.EuC-Jp are all correct locale name on glibc, although ja_jp.EUC-JP is incorrect. If we use IANA registry for codeset name, we should support case-insensitive codeset-suffix as above. Will you really support this? 4. IANA registry (MIME charset name) has many name variants in one codeset. For example, "Extended_UNIX_Code_Packed_Format_for_Japanese", "csEUCPkdFmtJapanese" are same codeset with "EUC-JP". Will you support all variants for locale name? Yes, glibc supports all variants. e.g. the following names are all valid locale names in glibc: "ja_JP.Extended_UNIX_Code_Packed_Format_for_Japanese" "ja_JP.csEUCPkdFmtJapanese" "ja_JP.EUC-JP" "ja_JP.eucJP" (note that because MIME charset name is case insenstive, names which only differs about upper-case/lower-case are also valid. e.g. "ja_JP.eXTENDED_unix_cODE_pACKED_fORMAT_FOR_jAPANESE" is valid, too.) Will you really support this? 5. Why do you think that is is better *NOT* to follow OpenGroup standard? At least, "eucJP" and "SJIS" seem to be OpenGroup standard as I already said. And those names are not compatible with IANA registry. 6. Do you really think that the following name should be usable for locale name? "ja_JP.Extended_UNIX_Code_Packed_Format_for_Japanese" (I don't think so.) -- soda To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 15:52: 9 2001 Delivered-To: freebsd-audit@freebsd.org Received: from cowpie.acm.vt.edu (cowpie.acm.vt.edu [128.173.42.253]) by hub.freebsd.org (Postfix) with ESMTP id 2549037B422 for ; Fri, 18 May 2001 15:52:07 -0700 (PDT) (envelope-from mheffner@cowpie.acm.vt.edu) Received: (from mheffner@localhost) by cowpie.acm.vt.edu (8.11.3/8.11.3) id f4IMpe733067 for freebsd-audit@freebsd.org; Fri, 18 May 2001 18:51:40 -0400 (EDT) (envelope-from mheffner) Date: Fri, 18 May 2001 18:51:40 -0400 From: Mike Heffner To: freebsd-audit@freebsd.org Subject: Cleanup of mail(1)'s varying styles Message-ID: <20010518185140.A33060@cowpie.acm.vt.edu> Reply-To: mheffner@vt.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [ I sent this two days ago, but since it hasn't come through yet I'm switching accounts and trying again, sorry if anyone gets this twice. ] I've gone through mail(1) and tried to cleanup its heterogenous mix of different styles by trying to make everything style(9) compliant. I've also killed `register' use, converted uses of NIL, NONE, NOVAR, NOGRP, NOGE, NOSTR to NULL, and took a stab at cleaning up BDECFLAGS. There shouldn't be any functional changes to the code however. The patch is fairly large, 150K+, so I won't spam the list with it, but it can be found at the address below. While this patch is rather large and mainly just a style(9) update, I think it's something that should be done because it'll make future changes to mail(1) alot easier. Please review. http://people.freebsd.org/~mikeh/diffs/mail.style.diff Thanks, Mike -- Mike Heffner Fredericksburg, VA http://filebox.vt.edu/users/mheffner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 16: 0:22 2001 Delivered-To: freebsd-audit@freebsd.org Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) by hub.freebsd.org (Postfix) with ESMTP id 7F00737B422; Fri, 18 May 2001 16:00:19 -0700 (PDT) (envelope-from soda@sra.co.jp) Received: from sranhf.sra.co.jp (sranhf [133.137.28.3]) by sraigw.sra.co.jp (8.8.7/3.7W-sraigw) with ESMTP id IAA08129; Sat, 19 May 2001 08:00:16 +0900 (JST) Received: from srapc342.sra.co.jp (root@srapc342 [133.137.28.111]) by sranhf.sra.co.jp (8.8.7/3.6Wbeta7-srambox) with ESMTP id IAA01723; Sat, 19 May 2001 08:00:15 +0900 (JST) Received: (from soda@localhost) by srapc342.sra.co.jp (8.8.8/3.4W-sra) id IAA29954; Sat, 19 May 2001 08:00:15 +0900 (JST) Date: Sat, 19 May 2001 08:00:15 +0900 (JST) Message-Id: <200105182300.IAA29954@srapc342.sra.co.jp> From: Noriyuki Soda To: Clive Lin , i18n@freebsd.org, audit@freebsd.org Cc: ache@nagual.pp.ru, bsd-locale@hauN.org Subject: Re: CFR: ISO_* -> ISO-* locale renaming In-Reply-To: <20010519010920.A2911@cartier.cirx.org> References: <20010518203702.B79058@nagual.pp.ru> <20010518205242.A79407@nagual.pp.ru> <20010519010920.A2911@cartier.cirx.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 Clive Lin wrote: > Just zh_CN.EUC -> zh_CN.GB2312 would be fine. > > They (almost) mean the same thing, but in different names. How about zh_TW.eucTW then? (zh_TW.eucTW is supported by both X11 and citrus). -- soda To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 16:17: 8 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 1FF4537B424; Fri, 18 May 2001 16:17:00 -0700 (PDT) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.11.3/8.11.3) id f4INGLr83381; Sat, 19 May 2001 03:16:22 +0400 (MSD) (envelope-from ache) Date: Sat, 19 May 2001 03:16:15 +0400 From: "Andrey A. Chernov" To: Noriyuki Soda Cc: i18n@FreeBSD.ORG, audit@FreeBSD.ORG, bsd-locale@hauN.org Subject: Re: CFR: ISO_* -> ISO-* locale renaming Message-ID: <20010519031612.B83245@nagual.pp.ru> References: <20010518203702.B79058@nagual.pp.ru> <20010519050946U.tshiozak@din.or.jp> <200105182238.HAA29872@srapc342.sra.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105182238.HAA29872@srapc342.sra.co.jp>; from soda@sra.co.jp on Sat, May 19, 2001 at 07:38:21AM +0900 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, May 19, 2001 at 07:38:21 +0900, Noriyuki Soda wrote: > I still think that using X11 codeset name is better than using IANA > registry due to the following problems. X11 codeset registry is outdated and not maintained, as replies says. > If we use "ISO-8859-1", we are only compatible with Linux, > and we become incompatible with Solaris, Tru64 and IRIX. > > Why do you think that it is better to become only compatible with > Linux? This is not compatibility question at all. POSIX clearly says that codeset names are 'implementation defined' - any variant will be right per POSIX. FreeBSD either can maintain its own codeset registry or use 3rd party one actively maintained. > 2. What codeset name will you use for codesets which are available > on X Window System, but not defined in IANA registry? > (Yes, there is such codeset in locales supported by X11, already.) If they are not in IANA registry, any variant will be right. > 3. IANA registry (MIME charset name) is case insensitive. > Will you support case-insensitive codeset-suffix for locale name? I don't think so, the same as for partial locale names - any relaxation there make locale sensing from programs much harder, i.e. like missing codeset name, etc. > 4. IANA registry (MIME charset name) has many name variants in one > codeset. For example, "Extended_UNIX_Code_Packed_Format_for_Japanese", > "csEUCPkdFmtJapanese" are same codeset with "EUC-JP". > Will you support all variants for locale name? There is 'preferred MIME names' marked. Since we currently support only one name, we should use prefered one. > 5. Why do you think that is is better *NOT* to follow OpenGroup > standard? Because there is no such standard. As replies indicates, OpenGroup don't attempt to cover this area. See reply about aardvark. > At least, "eucJP" and "SJIS" seem to be OpenGroup standard as I > already said. And those names are not compatible with IANA registry. See my CFR for rename. > 6. Do you really think that the following name should be usable > for locale name? > "ja_JP.Extended_UNIX_Code_Packed_Format_for_Japanese" > (I don't think so.) I too. -- 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 Fri May 18 16:43: 4 2001 Delivered-To: freebsd-audit@freebsd.org Received: from kalaid.f2f.com.ua (kalaid.f2f.com.ua [62.149.0.33]) by hub.freebsd.org (Postfix) with ESMTP id 175AA37B42C; Fri, 18 May 2001 16:42:40 -0700 (PDT) (envelope-from sobomax@mail-in.net) Received: from mail.uic-in.net (root@[212.35.189.4]) by kalaid.f2f.com.ua (8.11.3/8.11.1) with ESMTP id f4INhpE26880; Sat, 19 May 2001 02:43:53 +0300 (EEST) (envelope-from sobomax@mail-in.net) Received: from notebook.vega.com (das0-l86.uic-in.net [212.35.189.213]) by mail.uic-in.net (8.11.3/8.11.3) with ESMTP id f4INgJx36064; Sat, 19 May 2001 02:42:28 +0300 (EEST) (envelope-from sobomax@mail-in.net) Date: Sat, 19 May 2001 02:42:28 +0300 (EEST) Message-Id: <200105182342.f4INgJx36064@mail.uic-in.net> To: nik@FreeBSD.org, ru@FreeBSD.org, audit@FreeBSD.org, arch@FreeBSD.org From: Maxim Sobolev Reply-To: sobomax@FreeBSD.org Subject: Integrating new scrshot(1) utility into vidcontrol(1) [patch for review] X-Mailer: Pygmy (v0.5.7) Content-type: text/plain Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Ok, as it was agreed I've integrated scrshot(1) into vidcontrol(1) and also added ability to dump contents of display buffer in plain text format, so you don't even need a special utility to see what's going on on a console of display-less machine. :-) Please somebody review attached patches (esp. manpage). Thank you! -Maxim Index: vidcontrol.1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.sbin/vidcontrol/vidcontrol.1,v retrieving revision 1.34 diff -d -u -r1.34 vidcontrol.1 --- vidcontrol.1=092001/04/18 15:51:56=091.34 +++ vidcontrol.1=092001/05/18 23:32:37 @@ -36,6 +36,8 @@ .Op Fl M Ar char .Op Fl m Cm on | off .Op Fl r Ar foreground Ar background +.Op Fl p +.Op Fl P .Op Fl s Ar number .Op Fl t Ar N | Cm off .Op Fl x @@ -185,6 +187,21 @@ Used together with the = .Xr moused 8 daemon for text mode cut & paste functionality. +.It Fl p +Capture the current contents of the video buffer corresponding +to the terminal device referred to by standard input. +.Nm +writes contents of the video buffer to the standard +output in a raw binary format. For details about that +format see +.Sx Format of Video Buffer Dump +below. +.It Fl P +Same as +.Fl p , +but dump contents of the video buffer in a plain text format +ignoring nonprintable characters and information about text +attributes. .It Fl r Ar foreground background Change reverse mode colors to .Ar foreground = @@ -253,6 +270,106 @@ option. See .Xr syscons 4 for more details on this kernel option. +.Ss Format of Video Buffer Dump +The +.Nm +utility uses the +.Xr syscons 4 +.Dv CONS_SCRSHOT +.Xr ioctl 2 +to capture the current contents of the video buffer. +.Nm +writes version and additional information to the standard +output, followed by the contents of the terminal device. +.Pp +PC video memory is typically arranged in two byte tuples, +one per character position. In each tuple, the first byte +will be the character code, and the second byte is the +character's color attribute. +.Pp +The color attribute byte is further broken down in to the +low nibble, which specifies which of 16 different foreground +colors is active, and the high nibble, which specifies which +of 16 different background colors is active. +.Pp +.Bl -hang -offset indent -compact +.It 0 +Black +.It 1 +Blue +.It 2 +Green +.It 3 +Cyan +.It 4 +Red +.It 5 +Magenta +.It 6 +Brown +.It 7 +White +.It 8 +Grey +.It 9 +Light Blue +.It 10 +Light Green +.It 11 +Light Cyan +.It 12 +Light Red +.It 13 +Light Magenta +.It 14 +Yellow +.It 15 +White +.El +.Pp +It can be seen that the last 8 colors are brighter +versions of the first 8. +.Pp +For example, the two bytes +.Pp +.Dl "65 158" +.Pp +specify an uppercase A (character code 65), in +yellow (low nibble 15) on a light blue background +(high nibble 9). +.Pp +The +.Nm +output contains a small header which includes additional +information which may be useful to utilities processing +the output. +.Pp +The first 10 bytes are always arranged as follows: +.Bl -column "Byte range" "Contents" -offset indent +.It Sy "Byte Range=09Contents" +.It "1 thru 8=09Literal text" Dq Li SCRSHOT_ +.It "9=09File format version number" +.It "10=09Remaining number of bytes in the header" +.El +.Pp +Subsequent bytes depend on the version number. +.Bl -column "Version" "13 and up" -offset indent +.It Sy "Version=09Byte=09Meaning" +.It "1=0911=09Terminal width, in characters" +.It "=0912=09Terminal depth, in characters" +.It "=0913 and up=09The snapshot data" +.El +.Pp +So a dump of an 80x25 screen would start (in hex) +.Bd -literal -offset indent +53 43 52 53 48 4f 54 5f 01 02 50 19 +----------------------- -- -- -- -- + | | | | ` 25 decimal + | | | `--- 80 decimal + | | `------ 2 remaining bytes of header data + | `--------- File format version 1 + `------------------------ Literal "SCRSHOT_" +.Ed .Sh VIDEO OUTPUT CONFIGURATION .Ss Boot Time Configuration You may set the following variables in @@ -329,6 +446,18 @@ some LCD models): .Pp .Dl vidcontrol -g 100x37 VESA_800x600 +.Pp +The following command will capture the contents of the first virtual +terminal, and redirect the output to the +.Pa shot.scr +file: +.Pp +.Dl vidcontrol -p < /dev/ttyv0 > shot.scr +.Pp +The following command will dump contents of the forth virtual terminal +to the standard output in the human readable format: +.Pp +.Dl vidcontrol -P < /dev/ttyv3 .Sh SEE ALSO .Xr kbdcontrol 1 , .Xr vidfont 1 , @@ -339,5 +468,13 @@ .Xr rc.conf 5 , .Xr kldload 8 , .Xr moused 8 +.Xr watch 8 +.Pp +The various +.Li shot2* +utilities in the +.Li textproc +category of the +.Em "Ports Collection" . .Sh AUTHORS .An S\(/oren Schmidt Aq sos@FreeBSD.org Index: vidcontrol.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.sbin/vidcontrol/vidcontrol.c,v retrieving revision 1.36 diff -d -u -r1.36 vidcontrol.c --- vidcontrol.c=092001/04/21 13:50:32=091.36 +++ vidcontrol.c=092001/05/18 23:32:37 @@ -50,6 +50,11 @@ #define _VESA_800x600_DFL_ROWS 25 #define _VESA_800x600_DFL_FNSZ 16 = +#define DUMP_RAW=090 +#define DUMP_TXT=091 + +#define DUMP_FMT_REV=091 + char =09legal_colors[16][16] =3D { =09"black", "blue", "green", "cyan", =09"red", "magenta", "brown", "white", @@ -70,8 +75,8 @@ =09fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: vidcontrol [-r fg bg] [-b color] [-c appearance] [-d] [-l scrmap]"= , " [-i adapter | mode] [-L] [-M char] [-m on|off]", -" [-f size file] [-s number] [-t N|off] [-x] [-g geometry= ]", = -" [mode] [fgcol [bgcol]] [show]"); +" [-f size file] [-s number] [-t N|off] [-x] [-g geometry= ]", +" [-p] [-P] [mode] [fgcol [bgcol]] [show]"); =09exit(1); } = @@ -638,6 +643,77 @@ =09=09info.mv_rev.fore, info.mv_rev.back); } = +/* + * Snapshot the video memory of that terminal, using the CONS_SCRSHOT + * ioctl, and writes the results to stdout either in the special + * binary format (see manual page for details), or in the plain + * text format. + */ +void +dump_screen(int mode) +{ +=09scrshot_t shot; +=09vid_info_t info; + +=09info.size =3D sizeof(info); +=09if (ioctl(0, CONS_GETINFO, &info) =3D=3D -1) { +=09=09warn("failed to obtain current video mode parameters"); +=09=09return; +=09} + +=09shot.buf =3D alloca(info.mv_csz * info.mv_rsz * sizeof(u_int16_t)); +=09if (shot.buf =3D=3D NULL) { +=09=09warn("failed to allocate memory for dump"); +=09=09return; +=09} + +=09shot.xsize =3D info.mv_csz; +=09shot.ysize =3D info.mv_rsz; +=09if (ioctl(0, CONS_SCRSHOT, &shot) =3D=3D -1) { +=09=09warn("failed to get dump of the screen"); +=09=09return; +=09} + +=09if (mode =3D=3D DUMP_RAW) { +=09=09printf("SCRSHOT_%c%c%c%c", DUMP_FMT_REV, 2, +=09=09 shot.xsize, shot.ysize); +=09=09fflush(stdout); + +=09=09(void)write(STDOUT_FILENO, shot.buf, +=09=09=09 shot.xsize * shot.ysize * sizeof(u_int16_t)); +=09} else { +=09=09char *line; +=09=09int x, y; +=09=09u_int16_t ch; + +=09=09line =3D alloca(shot.xsize + 1); +=09=09if (line =3D=3D NULL) { +=09=09=09warn("failed to allocate memory for line buffer"); +=09=09=09return; +=09=09} + +=09=09for (y =3D 0; y < shot.ysize; y++) { +=09=09=09for (x =3D 0; x < shot.xsize; x++) { +=09=09=09=09ch =3D shot.buf[x + (y * shot.xsize)]; +=09=09=09=09ch &=3D 0xff; +=09=09=09=09if (isprint(ch) =3D=3D 0) +=09=09=09=09=09ch =3D ' '; +=09=09=09=09line[x] =3D (char)ch; +=09=09=09} + +=09=09=09/* Trim trailing spaces */ +=09=09=09do { +=09=09=09=09line[x--] =3D '\0'; +=09=09=09} while (line[x] =3D=3D ' ' && x !=3D 0); + +=09=09=09puts(line); +=09=09} +=09=09fflush(stdout); +=09} + +=09return; +} + int main(int argc, char **argv) { @@ -648,7 +724,7 @@ =09info.size =3D sizeof(info); =09if (ioctl(0, CONS_GETINFO, &info) < 0) =09=09err(1, "must be on a virtual console"); -=09while((opt =3D getopt(argc, argv, "b:c:df:g:i:l:LM:m:r:s:t:x")) !=3D -1= ) +=09while((opt =3D getopt(argc, argv, "b:c:df:g:i:l:LM:m:pPr:s:t:x")) !=3D = -1) =09=09switch(opt) { =09=09=09case 'b': =09=09=09=09set_border_color(optarg); @@ -689,6 +765,12 @@ =09=09=09=09break; =09=09=09case 'm': =09=09=09=09set_mouse(optarg); +=09=09=09=09break; +=09=09=09case 'p': +=09=09=09=09dump_screen(DUMP_RAW); +=09=09=09=09break; +=09=09=09case 'P': +=09=09=09=09dump_screen(DUMP_TXT); =09=09=09=09break; =09=09=09case 'r': =09=09=09=09set_reverse_colors(argc, argv, &optind); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 16:57: 7 2001 Delivered-To: freebsd-audit@freebsd.org Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) by hub.freebsd.org (Postfix) with ESMTP id 346CE37B424; Fri, 18 May 2001 16:56:57 -0700 (PDT) (envelope-from soda@sra.co.jp) Received: from sranhf.sra.co.jp (sranhf [133.137.28.3]) by sraigw.sra.co.jp (8.8.7/3.7W-sraigw) with ESMTP id IAA09407; Sat, 19 May 2001 08:56:55 +0900 (JST) Received: from srapc342.sra.co.jp (root@srapc342 [133.137.28.111]) by sranhf.sra.co.jp (8.8.7/3.6Wbeta7-srambox) with ESMTP id IAA01806; Sat, 19 May 2001 08:56:54 +0900 (JST) Received: (from soda@localhost) by srapc342.sra.co.jp (8.8.8/3.4W-sra) id IAA00242; Sat, 19 May 2001 08:56:54 +0900 (JST) Date: Sat, 19 May 2001 08:56:54 +0900 (JST) Message-Id: <200105182356.IAA00242@srapc342.sra.co.jp> From: Noriyuki Soda To: i18n@FreeBSD.ORG, audit@FreeBSD.ORG Cc: bsd-locale@hauN.org Subject: Re: CFR: ISO_* -> ISO-* locale renaming In-Reply-To: <20010519031612.B83245@nagual.pp.ru> References: <20010518203702.B79058@nagual.pp.ru> <20010519050946U.tshiozak@din.or.jp> <200105182238.HAA29872@srapc342.sra.co.jp> <20010519031612.B83245@nagual.pp.ru> 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, 19 May 2001 08:17:09 +0900, "Andrey A. Chernov" wrote: >> I still think that using X11 codeset name is better than using IANA >> registry due to the following problems. > X11 codeset registry is outdated and not maintained, as replies says. The one who said this is Bruno Haible, and I know him in another context. He often shows clueless-ness about i18n, and shows different opinion against Sun and IBM's cheef architect about i18n. Perhaps Bruno made a mistake in this case too... If we support new codeset, apparently we should add its support to X11. So, X11 is still best place to maintain codeset name. (We can feedback it to X11 or XFree86). >> If we use "ISO-8859-1", we are only compatible with Linux, >> and we become incompatible with Solaris, Tru64 and IRIX. >> >> Why do you think that it is better to become only compatible with >> Linux? > This is not compatibility question at all. POSIX clearly says that codeset > names are 'implementation defined' - any variant will be right per POSIX. > FreeBSD either can maintain its own codeset registry or use 3rd party one > actively maintained. But there is no reason to choose *incompatible* name with rest of world. As I already said, "ISO8859-1" is compatible name with Linux, Solaris, Tru64, IRIX (and OpenGroup reply shows that "ISO8859-1" is also compatible with AIX). So why do you want the incompatible convention? The existing standard (ISO8859-1) is reasonable. There is no reason not to use the name. (BTW, the ISO registry referred in one of reply is apparently not suitable for UNIX codeset name, although probably you already noticed that.) >> 2. What codeset name will you use for codesets which are available >> on X Window System, but not defined in IANA registry? >> (Yes, there is such codeset in locales supported by X11, already.) > If they are not in IANA registry, any variant will be right. That makes FreeBSD incomplatible with rest of world. There is no reason to prefer incompatiblity, give that there is reasonable standard in X11. >> 3. IANA registry (MIME charset name) is case insensitive. >> Will you support case-insensitive codeset-suffix for locale name? > I don't think so, the same as for partial locale names - any relaxation > there make locale sensing from programs much harder, i.e. like missing > codeset name, etc. That avoids benefit to use IANA registry. If MIME charset name can be just used as codeset name like Linux, certainly it has its benefit. But if it cannot be used, why do you want to use IANA registry at all? >> 4. IANA registry (MIME charset name) has many name variants in one >> codeset. For example, "Extended_UNIX_Code_Packed_Format_for_Japanese", >> "csEUCPkdFmtJapanese" are same codeset with "EUC-JP". >> Will you support all variants for locale name? > There is 'preferred MIME names' marked. Since we currently support only > one name, we should use prefered one. That causes another incompatibility with Linux. For example, Linux uses "ANSI_X3.4-1968" rather than "US-ASCII" (preferred MIME name). So, if we choose IANA registry, all software which use codeset name should be re-written. Because your proposal is not compatible with Linux nor commercial UNIXes (Solaris, Tru64, IRIX and AIX). If we use X11 name, we don't have to rewrite much. Because X11 name is already supported (for commerical UNIXes). Also, there are MIME charset names which have variants, but don't have preferred MIME name. Because preferred MIME name may be defined for such MIME charset in the future, FreeBSD's name may become incosistent with IANA registry. >> 5. Why do you think that is is better *NOT* to follow OpenGroup >> standard? > Because there is no such standard. As replies indicates, OpenGroup don't > attempt to cover this area. See reply about aardvark. It seems their reply is not consistent, is it? I've asked same question to another OpenGroup list , and its reply is follows: >>>>> On Thu, 17 May 2001 16:39:31 -0400, Deborah May wrote: : I want to let you know that we have received your email. : At this point, I don't know the answer to your question, : but am trying to see if someone else within The Open Group : can help you. : : We will get back to you within the next couple of days. How about waiting for her answer for a while? >> 6. Do you really think that the following name should be usable >> for locale name? >> "ja_JP.Extended_UNIX_Code_Packed_Format_for_Japanese" >> (I don't think so.) > I too. So, your proposal is not only incompatible with commercial UNIXes, but also incompatible with Linux. Mmmm, how about using X11 name instead? -- soda To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 17:22:14 2001 Delivered-To: freebsd-audit@freebsd.org Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) by hub.freebsd.org (Postfix) with ESMTP id A88AF37B443; Fri, 18 May 2001 17:22:10 -0700 (PDT) (envelope-from soda@sra.co.jp) Received: from sranhf.sra.co.jp (sranhf [133.137.28.3]) by sraigw.sra.co.jp (8.8.7/3.7W-sraigw) with ESMTP id JAA10144; Sat, 19 May 2001 09:22:09 +0900 (JST) Received: from srapc342.sra.co.jp (root@srapc342 [133.137.28.111]) by sranhf.sra.co.jp (8.8.7/3.6Wbeta7-srambox) with ESMTP id JAA01845; Sat, 19 May 2001 09:22:08 +0900 (JST) Received: (from soda@localhost) by srapc342.sra.co.jp (8.8.8/3.4W-sra) id JAA00323; Sat, 19 May 2001 09:22:08 +0900 (JST) Date: Sat, 19 May 2001 09:22:08 +0900 (JST) Message-Id: <200105190022.JAA00323@srapc342.sra.co.jp> From: Noriyuki Soda To: i18n@FreeBSD.ORG, audit@FreeBSD.ORG Cc: bsd-locale@hauN.org Subject: Re: CFR: ISO_* -> ISO-* locale renaming In-Reply-To: <200105182356.IAA00242@srapc342.sra.co.jp> References: <20010518203702.B79058@nagual.pp.ru> <20010519050946U.tshiozak@din.or.jp> <200105182238.HAA29872@srapc342.sra.co.jp> <20010519031612.B83245@nagual.pp.ru> <200105182356.IAA00242@srapc342.sra.co.jp> 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 forgot to say one thing. ache> FreeBSD either can maintain its own codeset registry or use 3rd ache> party one actively maintained. Please use the Citrus project as the 3rd party which maintains codeset name. Actually, that is the reason why citrus project maintains unified source tree for both FreeBSD, NetBSD and OpenBSD. We, Citrus project, are trying to keep consistency between all BSDs, and trying to keep consistency with rest of the world, if it is possible. Some i18n specialist in commericial UNIX (e.g. Hiura-san in Sun) are also subscribing and actively posting to the citrus mailing list. -- soda To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 19:47:50 2001 Delivered-To: freebsd-audit@freebsd.org Received: from cartier.cirx.org (cartier.cirx.org [211.72.15.243]) by hub.freebsd.org (Postfix) with ESMTP id CD55137B424; Fri, 18 May 2001 19:47:42 -0700 (PDT) (envelope-from clive@tongi.org) Received: from cartier.cirx.org (nullmail@localhost [127.0.0.1]) by cartier.cirx.org (8.11.3/8.11.3) with SMTP id f4J2lSa08227; Sat, 19 May 2001 10:47:29 +0800 (CST) (envelope-from clive@tongi.org) Received: (nullmailer pid 8223 invoked by uid 1000); Sat, 19 May 2001 02:47:28 -0000 Date: Sat, 19 May 2001 10:47:28 +0800 From: Clive Lin To: Noriyuki Soda Cc: i18n@freebsd.org, audit@freebsd.org, ache@nagual.pp.ru, bsd-locale@hauN.org Subject: Re: CFR: ISO_* -> ISO-* locale renaming Message-ID: <20010519104728.A8118@cartier.cirx.org> References: <20010518203702.B79058@nagual.pp.ru> <20010518205242.A79407@nagual.pp.ru> <20010519010920.A2911@cartier.cirx.org> <200105182300.IAA29954@srapc342.sra.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105182300.IAA29954@srapc342.sra.co.jp>; from soda@sra.co.jp on Sat, May 19, 2001 at 08:00:15AM +0900 X-PGP-key: http://www.cirx.org/~clive/clive.asc 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, May 19, 2001 at 08:00:15AM +0900, Noriyuki Soda wrote: > Clive Lin wrote: > > Just zh_CN.EUC -> zh_CN.GB2312 would be fine. > > > > They (almost) mean the same thing, but in different names. > > How about zh_TW.eucTW then? > (zh_TW.eucTW is supported by both X11 and citrus). This is great ! But do I misunderstand you ? zh_CN.EUC and zh_TW.eucTW are different. BTW, the only Chinese document published in zh_TW.eduTW I have ever seen is by Sun Microsystems. > soda -- Clive Lin (Tong-I Lin)\n =P clive@tongi.org # Family, friends, private affairs\n =F clive@FreeBSD.org # Chinese ports, documentation\n =O clive@CirX.ORG # Others\n =J.* # What do you think about the 'J' ?\n To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 20:12: 5 2001 Delivered-To: freebsd-audit@freebsd.org Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) by hub.freebsd.org (Postfix) with ESMTP id DE20137B43C; Fri, 18 May 2001 20:11:58 -0700 (PDT) (envelope-from soda@sra.co.jp) Received: from sranhf.sra.co.jp (sranhf [133.137.28.3]) by sraigw.sra.co.jp (8.8.7/3.7W-sraigw) with ESMTP id MAA18444; Sat, 19 May 2001 12:11:57 +0900 (JST) Received: from srapc342.sra.co.jp (root@srapc342 [133.137.28.111]) by sranhf.sra.co.jp (8.8.7/3.6Wbeta7-srambox) with ESMTP id MAA02089; Sat, 19 May 2001 12:11:56 +0900 (JST) Received: (from soda@localhost) by srapc342.sra.co.jp (8.8.8/3.4W-sra) id MAA00879; Sat, 19 May 2001 12:11:56 +0900 (JST) Date: Sat, 19 May 2001 12:11:56 +0900 (JST) Message-Id: <200105190311.MAA00879@srapc342.sra.co.jp> From: Noriyuki Soda To: i18n@freebsd.org, audit@freebsd.org Cc: bsd-locale@hauN.org Subject: Re: CFR: ISO_* -> ISO-* locale renaming In-Reply-To: <20010519104728.A8118@cartier.cirx.org> References: <20010518203702.B79058@nagual.pp.ru> <20010518205242.A79407@nagual.pp.ru> <20010519010920.A2911@cartier.cirx.org> <200105182300.IAA29954@srapc342.sra.co.jp> <20010519104728.A8118@cartier.cirx.org> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >>>>> On Sat, 19 May 2001 11:48:08 +0900, Clive Lin said: >> > Just zh_CN.EUC -> zh_CN.GB2312 would be fine. >> > >> > They (almost) mean the same thing, but in different names. >> >> How about zh_TW.eucTW then? >> (zh_TW.eucTW is supported by both X11 and citrus). > do I misunderstand you ? zh_CN.EUC and zh_TW.eucTW are different. Yes, I know that. That's why they should have different codeset names. i.e. "eucCN" and "eucTW" (as already supported X11 primary codeset name). My point is that there is no MIME charset name definition for eucTW in IANA registry. And Linux implementation (at least Redhat 6.1) produces incorrect result for eucTW. In other words, one of examples that IANA doesn't work, and X11 works. -- soda To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri May 18 20:53:47 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 0EFA337B424; Fri, 18 May 2001 20:53:41 -0700 (PDT) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.11.3/8.11.3) id f4J3rY289062; Sat, 19 May 2001 07:53:34 +0400 (MSD) (envelope-from ache) Date: Sat, 19 May 2001 07:53:33 +0400 From: "Andrey A. Chernov" To: Noriyuki Soda Cc: i18n@FreeBSD.ORG, audit@FreeBSD.ORG, bsd-locale@hauN.org Subject: Re: CFR: ISO_* -> ISO-* locale renaming Message-ID: <20010519075333.C83245@nagual.pp.ru> References: <20010518203702.B79058@nagual.pp.ru> <20010519050946U.tshiozak@din.or.jp> <200105182238.HAA29872@srapc342.sra.co.jp> <20010519031612.B83245@nagual.pp.ru> <200105182356.IAA00242@srapc342.sra.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105182356.IAA00242@srapc342.sra.co.jp>; from soda@sra.co.jp on Sat, May 19, 2001 at 08:56:54AM +0900 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, May 19, 2001 at 08:56:54 +0900, Noriyuki Soda wrote: > > The existing standard (ISO8859-1) is reasonable. > There is no reason not to use the name. Yes, there _is_ that reason. In your case nl_langinfo(CODESET) returns _illegal_ and unusable MIME character set so you can't use it f.e. in mail exchange or any other MIME format compatible application. So, you need conversion table between illegal and legal character sets in case you suggest. I am strongly against such practice. Compatibility reasons weights very small comparing to that. > That avoids benefit to use IANA registry. > > If MIME charset name can be just used as codeset name like Linux, > certainly it has its benefit. But if it cannot be used, why do you > want to use IANA registry at all? Currently IANA registry codeset can be used in MIME applications as is and it is main benefit of choosing IANA and main X11 disadvantage. About case insensitive and aliased names at whole as you ask: this must be implemented in one direction only, i.e. ideally locale code must understand _any_ codeset, including X11 one, but nl_langinfo(CODESET) must return preferred MIME name only. Since we currently not implement both this features, we need to use exactly what nl_langinfo(CODESET) returns, i.e. preferred MIME name. > It seems their reply is not consistent, is it? > I've asked same question to another OpenGroup list > , and its reply is follows: > > >>>>> On Thu, 17 May 2001 16:39:31 -0400, Deborah May wrote: > > : I want to let you know that we have received your email. > : At this point, I don't know the answer to your question, > : but am trying to see if someone else within The Open Group > : can help you. > : > : We will get back to you within the next couple of days. > > How about waiting for her answer for a while? Ok. > So, your proposal is not only incompatible with commercial UNIXes, > but also incompatible with Linux. Mmmm, how about using X11 name instead? I explain my position about multi-names a bit earlier in this message. Currently such code is not implemented. -- 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 Fri May 18 22:38:53 2001 Delivered-To: freebsd-audit@freebsd.org Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) by hub.freebsd.org (Postfix) with ESMTP id 6B55737B424; Fri, 18 May 2001 22:38:44 -0700 (PDT) (envelope-from soda@sra.co.jp) Received: from sranhf.sra.co.jp (sranhf [133.137.28.3]) by sraigw.sra.co.jp (8.8.7/3.7W-sraigw) with ESMTP id OAA28208; Sat, 19 May 2001 14:38:42 +0900 (JST) Received: from srapc342.sra.co.jp (root@srapc342 [133.137.28.111]) by sranhf.sra.co.jp (8.8.7/3.6Wbeta7-srambox) with ESMTP id OAA02314; Sat, 19 May 2001 14:38:42 +0900 (JST) Received: (from soda@localhost) by srapc342.sra.co.jp (8.8.8/3.4W-sra) id OAA01191; Sat, 19 May 2001 14:38:41 +0900 (JST) Date: Sat, 19 May 2001 14:38:41 +0900 (JST) Message-Id: <200105190538.OAA01191@srapc342.sra.co.jp> From: Noriyuki Soda To: i18n@FreeBSD.ORG, audit@FreeBSD.ORG Cc: bsd-locale@hauN.org Subject: Re: CFR: ISO_* -> ISO-* locale renaming In-Reply-To: <20010519075333.C83245@nagual.pp.ru> References: <20010518203702.B79058@nagual.pp.ru> <20010519050946U.tshiozak@din.or.jp> <200105182238.HAA29872@srapc342.sra.co.jp> <20010519031612.B83245@nagual.pp.ru> <200105182356.IAA00242@srapc342.sra.co.jp> <20010519075333.C83245@nagual.pp.ru> 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, 19 May 2001 12:53:45 +0900, "Andrey A. Chernov" said: > On Sat, May 19, 2001 at 08:56:54 +0900, Noriyuki Soda wrote: >> >> The existing standard (ISO8859-1) is reasonable. >> There is no reason not to use the name. > Yes, there _is_ that reason. In your case nl_langinfo(CODESET) returns > _illegal_ and unusable MIME character set so you can't use it f.e. in mail > exchange or any other MIME format compatible application. So, you need > conversion table between illegal and legal character sets in case you > suggest. I am strongly against such practice. Compatibility reasons > weights very small comparing to that. You are missing point. It is existing practice that the return value of nl_langinfo(CODESET) is not usable for MIME charset name. So, *ALL* existing programs are using conversion table to convert nl_langinfo(CODESET) to MIME charset name. Interestingly, this is true on even Linux. Because Linux uses "ANSI_X3.4-1968" as nl_langinfo(CODESET) for ASCII as I already pointed out, and many programs only knows "US-ASCII" as MIME charset name for ASCII, programs usually have to convert "ANSI_X3.4-1968" to "US-ASCII" on even Linux. If a program depends on the fact that an OS retruns MIME compatible value as nl_langinfo(CODESET), such program is just not-portable. So, avoiding conversion table has no real gain at all. All programs are using such conversion table already. And all future programs also should use such conversion table in the future, because all commercial UNIX and even Linux returns unsable value as MIME charset name. >> That avoids benefit to use IANA registry. >> >> If MIME charset name can be just used as codeset name like Linux, >> certainly it has its benefit. But if it cannot be used, why do you >> want to use IANA registry at all? I said "benefit" above, but it is not *real* benefit, because portable code cannot rely on such behavior. > Currently IANA registry codeset can be used in MIME applications as is and > it is main benefit of choosing IANA and main X11 disadvantage. > About case insensitive and aliased names at whole as you ask: this must be > implemented in one direction only, i.e. ideally locale code must > understand _any_ codeset, including X11 one, That is very problematic approch. The codes which understand locale names are not only locale functions in libc, but also many userland programs. For example, look at charset.c in "less" program. "less" certainly parse locale name, and the way that "less" currently use is case *sensitive* (of course). If any locale code must understand _any_ codeset, there are really many programs that FreeBSD should modify. And most importantly, there is no real benefit to implement such complex rule (because the way is not portable at all). In contrast to your proposal, using X11 (or OpenGroup) locale name requires almost *no* code change at all, because they are already standard and already supported. >> So, your proposal is not only incompatible with commercial UNIXes, >> but also incompatible with Linux. Mmmm, how about using X11 name instead? > I explain my position about multi-names a bit earlier in this > message. Currently such code is not implemented. The way I proposed is same with what commercial UNIXes are already do, and it is already implemented on FreeBSD, and waiting for approvement for merging to FreeBSD. In contrast, your proposal is incompatible with commercial UNIXes, and incompatible with even Linux in some points. Why do you have to create yet another incompatiblity, even there is no real benefit? -- soda To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat May 19 11:52:51 2001 Delivered-To: freebsd-audit@freebsd.org Received: from nothing-going-on.demon.co.uk (pc-62-31-42-140-hy.blueyonder.co.uk [62.31.42.140]) by hub.freebsd.org (Postfix) with ESMTP id F203837B424; Sat, 19 May 2001 11:52:42 -0700 (PDT) (envelope-from nik@nothing-going-on.demon.co.uk) Received: (from nik@localhost) by nothing-going-on.demon.co.uk (8.11.3/8.11.3) id f4JIiZ522306; Sat, 19 May 2001 19:44:35 +0100 (BST) (envelope-from nik) Date: Sat, 19 May 2001 19:44:35 +0100 From: Nik Clayton To: sobomax@FreeBSD.org Cc: nik@FreeBSD.org, ru@FreeBSD.org, audit@FreeBSD.org, arch@FreeBSD.org Subject: Re: Integrating new scrshot(1) utility into vidcontrol(1) [patch for review] Message-ID: <20010519194435.A22224@catkin.nothing-going-on.org> References: <200105182342.f4INgJx36064@mail.uic-in.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105182342.f4INgJx36064@mail.uic-in.net>; from sobomax@mail-in.net on Sat, May 19, 2001 at 02:42:28AM +0300 Organization: FreeBSD Project 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 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 19, 2001 at 02:42:28AM +0300, Maxim Sobolev wrote: > Ok, as it was agreed I've integrated scrshot(1) into > vidcontrol(1)=20 Any opinions on selecting this option by default if vidcontrol is invoked as scrshot? > and also added ability to dump contents > of display buffer in plain text format, so you don't > even need a special utility to see what's going on > on a console of display-less machine. :-) Isn't that what watch(8) is for? [...] > + if (mode =3D=3D DUMP_RAW) { > + printf("SCRSHOT_%c%c%c%c", DUMP_FMT_REV, 2, > + shot.xsize, shot.ysize); > + fflush(stdout); You've duplicated a buf of mine, "SCRSHOT_" should probably be #define. [...] > + /* Trim trailing spaces */ > + do { > + line[x--] =3D '\0'; > + } while (line[x] =3D=3D ' ' && x !=3D 0); I'm not sure that's necessary (nor is the trimming of notionally unprintable characters). The point was to get an accurate dump of the video buffer contents. We've already had requests to automatically convert the 8 bit line drawing characters in to 7 bit ones (which shot2txt now does). I'd prefer to see all the post-processing done outside of vidcontrol, otherwise you're on a slope in terms of what functionality is deemed acceptable for vidcontrol vs. what functionality has to be put in another utility. Apart from those quibbles, great. Thanks for doing the work. N --=20 FreeBSD: The Power to Serve http://www.freebsd.org/ FreeBSD Documentation Project http://www.freebsd.org/docproj/ --- 15B8 3FFC DDB4 34B0 AA5F 94B7 93A8 0764 2C37 E375 --- --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.5 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjsGvxIACgkQk6gHZCw343UegACdFjYxkdhupSRto5zIe+2aebon yF0AnAm4iXYRsNbmgvNeiAyqxgvZRL5+ =5eXE -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat May 19 12:40:17 2001 Delivered-To: freebsd-audit@freebsd.org Received: from kalaid.f2f.com.ua (kalaid.f2f.com.ua [62.149.0.33]) by hub.freebsd.org (Postfix) with ESMTP id C709937B422; Sat, 19 May 2001 12:39:53 -0700 (PDT) (envelope-from sobomax@mail-in.net) Received: from mail.uic-in.net (root@[212.35.189.4]) by kalaid.f2f.com.ua (8.11.3/8.11.1) with ESMTP id f4JJfDE44190; Sat, 19 May 2001 22:41:15 +0300 (EEST) (envelope-from sobomax@mail-in.net) Received: from notebook.vega.com (das0-l92.uic-in.net [212.35.189.219]) by mail.uic-in.net (8.11.3/8.11.3) with ESMTP id f4JJdjr00870; Sat, 19 May 2001 22:39:47 +0300 (EEST) (envelope-from sobomax@mail-in.net) Date: Sat, 19 May 2001 22:39:47 +0300 (EEST) Message-Id: <200105191939.f4JJdjr00870@mail.uic-in.net> To: nik@FreeBSD.ORG Cc: nik@FreeBSD.ORG, ru@FreeBSD.ORG, audit@FreeBSD.ORG, arch@FreeBSD.ORG From: Maxim Sobolev Reply-To: sobomax@FreeBSD.ORG Subject: Re: Integrating new scrshot(1) utility into vidcontrol(1) [patch for review] X-Mailer: Pygmy (v0.5.7) In-Reply-To: <20010519194435.A22224@catkin.nothing-going-on.org> Content-type: text/plain Content-Transfer-Encoding: quoted-printable 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, 19 May 2001 19:44:35 +0100, Nik Clayton wrote: > On Sat, May 19, 2001 at 02:42:28AM +0300, Maxim Sobolev wrote: > > Ok, as it was agreed I've integrated scrshot(1) into > > vidcontrol(1) = > = > Any opinions on selecting this option by default if vidcontrol is > invoked as scrshot? I don't really think it is worth effort. There is no POLA to preserve. > > and also added ability to dump contents > > of display buffer in plain text format, so you don't > > even need a special utility to see what's going on > > on a console of display-less machine. :-) > = > Isn't that what watch(8) is for? No, this and watch(8)'s functionality are ortogonal because `vidcontrol -P' could be used to dump what *is* already on the terminal, while watch(8) what *will* be on terminal after it has been started. > > +=09if (mode =3D=3D DUMP_RAW) { > > +=09=09printf("SCRSHOT_%c%c%c%c", DUMP_FMT_REV, 2, > > +=09=09 shot.xsize, shot.ysize); > > +=09=09fflush(stdout); > = > You've duplicated a buf of mine, "SCRSHOT_" should probably be #define. Well, frankly speaking I don't think it matters. I won't have a problem, though, if you will change it to whatever you think is appropriate. > > +=09=09=09/* Trim trailing spaces */ > > +=09=09=09do { > > +=09=09=09=09line[x--] =3D '\0'; > > +=09=09=09} while (line[x] =3D=3D ' ' && x !=3D 0); > = > I'm not sure that's necessary (nor is the trimming of notionally > unprintable characters). The point was to get an accurate dump of the > video buffer contents. As I clearly stated in the manpage, `-P' option intended only for getting quick'n'dirty human-readable dump. For accurate dump with attributes, 8-bit clearness and so on one should really use `-p' option. > We've already had requests to automatically convert the 8 bit line > drawing characters in to 7 bit ones (which shot2txt now does). I'd > prefer to see all the post-processing done outside of vidcontrol, > otherwise you're on a slope in terms of what functionality is deemed > acceptable for vidcontrol vs. what functionality has to be put in > another utility. In my view, in 90% of cases my -P option will cover the users' needs. -p plus external utility will cover remaining 10%. > Apart from those quibbles, great. Thanks for doing the work. Thank *you* for doing it. I've merely just rearranged things a bit. BTW, I think that the kernel's part of this feature has to be extended to dump not only visible portion of the screen buffer, but the whole history buffer as well. What do you think? -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat May 19 12:43:26 2001 Delivered-To: freebsd-audit@freebsd.org Received: from tao.org.uk (genesis.tao.org.uk [212.135.162.62]) by hub.freebsd.org (Postfix) with ESMTP id 8993C37B424; Sat, 19 May 2001 12:43:20 -0700 (PDT) (envelope-from joe@tao.org.uk) Received: by tao.org.uk (Postfix, from userid 100) id 25A8F22; Sat, 19 May 2001 20:43:19 +0100 (BST) Date: Sat, 19 May 2001 20:43:19 +0100 From: Josef Karthauser To: sobomax@FreeBSD.ORG Cc: nik@FreeBSD.ORG, ru@FreeBSD.ORG, audit@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: Integrating new scrshot(1) utility into vidcontrol(1) [patch for review] Message-ID: <20010519204319.B2145@tao.org.uk> References: <20010519194435.A22224@catkin.nothing-going-on.org> <200105191939.f4JJdjr00870@mail.uic-in.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="cvVnyQ+4j833TQvp" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105191939.f4JJdjr00870@mail.uic-in.net>; from sobomax@mail-in.net on Sat, May 19, 2001 at 10:39:47PM +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 --cvVnyQ+4j833TQvp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 19, 2001 at 10:39:47PM +0300, Maxim Sobolev wrote: >=20 > BTW, I think that the kernel's part of this feature has > to be extended to dump not only visible portion of the > screen buffer, but the whole history buffer as well. What > do you think? >=20 Now _that_'d be cool. :) Joe --cvVnyQ+4j833TQvp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjsGzNYACgkQXVIcjOaxUBZ5OQCdEp+xN2iQ9mEHaSuyjCuJjxsL aNgAoLmnHbYx9qBuNipo2Lf0CEWVrhXt =cEZb -----END PGP SIGNATURE----- --cvVnyQ+4j833TQvp-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat May 19 21:31:47 2001 Delivered-To: freebsd-audit@freebsd.org Received: from obsecurity.dyndns.org (adsl-63-207-60-32.dsl.lsan03.pacbell.net [63.207.60.32]) by hub.freebsd.org (Postfix) with ESMTP id 7240B37B422; Sat, 19 May 2001 21:31:38 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id EEB9366E1D; Sat, 19 May 2001 21:31:37 -0700 (PDT) Date: Sat, 19 May 2001 21:31:37 -0700 From: Kris Kennaway To: audit@FreeBSD.org Cc: green@FreeBSD.org Subject: dd BDECFLAGS cleanup Message-ID: <20010519213137.A13195@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="yrj/dFKFPuw6o+aM" 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 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Please review the following. Passes BDECFLAGS on the alpha and i386. Kris Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/bin/dd/Makefile,v retrieving revision 1.8 diff -u -r1.8 Makefile --- Makefile 1999/12/07 03:32:37 1.8 +++ Makefile 2001/05/20 03:27:19 @@ -6,4 +6,6 @@ =20 MAINTAINER=3D green@FreeBSD.org =20 +WARNS=3D 2 + .include Index: args.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/bin/dd/args.c,v retrieving revision 1.27 diff -u -r1.27 args.c --- args.c 2000/10/22 23:00:32 1.27 +++ args.c 2001/05/20 04:22:30 @@ -168,8 +168,8 @@ /* * Bail out if the calculation of a file offset would overflow. */ - if (in.offset > QUAD_MAX / in.dbsz || out.offset > QUAD_MAX / out.dbsz) - errx(1, "seek offsets cannot be larger than %qd", QUAD_MAX); + if ((unsigned long long)in.offset > QUAD_MAX / in.dbsz || (unsigned long = long)out.offset > QUAD_MAX / out.dbsz) + errx(1, "seek offsets cannot be larger than %lld", (long long)QUAD_MAX); } =20 static int @@ -189,7 +189,7 @@ =20 res =3D get_num(arg); if (res < 1 || res > SSIZE_MAX) - errx(1, "bs must be between 1 and %d", SSIZE_MAX); + errx(1, "bs must be between 1 and %ld", (long)SSIZE_MAX); in.dbsz =3D out.dbsz =3D (size_t)res; } =20 @@ -201,7 +201,7 @@ =20 res =3D get_num(arg); if (res < 1 || res > SSIZE_MAX) - errx(1, "cbs must be between 1 and %d", SSIZE_MAX); + errx(1, "cbs must be between 1 and %ld", (long)SSIZE_MAX); cbsz =3D (size_t)res; } =20 @@ -224,7 +224,7 @@ =20 files_cnt =3D get_num(arg); if (files_cnt < 1) - errx(1, "files must be between 1 and %qd", QUAD_MAX); + errx(1, "files must be between 1 and %lld", (long long)QUAD_MAX); } =20 static void @@ -236,7 +236,7 @@ if (!(ddflags & C_BS)) { res =3D get_num(arg); if (res < 1 || res > SSIZE_MAX) - errx(1, "ibs must be between 1 and %d", SSIZE_MAX); + errx(1, "ibs must be between 1 and %ld", (long)SSIZE_MAX); in.dbsz =3D (size_t)res; } } @@ -258,7 +258,7 @@ if (!(ddflags & C_BS)) { res =3D get_num(arg); if (res < 1 || res > SSIZE_MAX) - errx(1, "obs must be between 1 and %d", SSIZE_MAX); + errx(1, "obs must be between 1 and %ld", (long)SSIZE_MAX); out.dbsz =3D (size_t)res; } } Index: dd.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/bin/dd/dd.c,v retrieving revision 1.31 diff -u -r1.31 dd.c --- dd.c 2000/10/10 01:48:22 1.31 +++ dd.c 2001/05/20 04:24:47 @@ -71,8 +71,8 @@ =20 static void dd_close __P((void)); static void dd_in __P((void)); -int main __P((int, char *[])); static void getfdtype __P((IO *)); +int main __P((int, char *[])); static void setup __P((void)); =20 IO in, out; /* input/output state */ @@ -87,9 +87,10 @@ =20 int main(argc, argv) - int argc; + int argc __unused; char *argv[]; { + (void)setlocale(LC_CTYPE, ""); jcl(argv); setup(); @@ -175,7 +176,7 @@ */ if ((ddflags & (C_OF | C_SEEK | C_NOTRUNC)) =3D=3D (C_OF | C_SEEK) && out.flags & ISTRUNC) - if (ftruncate(out.fd, out.offset * out.dbsz) =3D=3D -1) + if (ftruncate(out.fd, out.offset * (off_t)out.dbsz) =3D=3D -1) err(1, "truncating %s", out.name); =20 /* @@ -422,7 +423,7 @@ err(2, "%s: seek error creating sparse file", out.name); if (force) - write(out.fd, outp, 1); + write(out.fd, outp, (size_t)1); pending =3D 0; } if (cnt) Index: misc.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/bin/dd/misc.c,v retrieving revision 1.18 diff -u -r1.18 misc.c --- misc.c 1999/08/27 23:14:04 1.18 +++ misc.c 2001/05/20 04:27:36 @@ -48,6 +48,7 @@ =20 #include #include +#include #include =20 #include "dd.h" @@ -66,29 +67,32 @@ secs =3D 1e-6; /* Use snprintf(3) so that we don't reenter stdio(3). */ (void)snprintf(buf, sizeof(buf), - "%qu+%qu records in\n%qu+%qu records out\n", - st.in_full, st.in_part, st.out_full, st.out_part); + "%llu+%llu records in\n%llu+%llu records out\n", + (unsigned long long)st.in_full, (unsigned long long)st.in_part, + (unsigned long long)st.out_full, (unsigned long long)st.out_part); (void)write(STDERR_FILENO, buf, strlen(buf)); if (st.swab) { - (void)snprintf(buf, sizeof(buf), "%qu odd length swab %s\n", - st.swab, (st.swab =3D=3D 1) ? "block" : "blocks"); + (void)snprintf(buf, sizeof(buf), "%llu odd length swab %s\n", + (unsigned long long)st.swab, + (st.swab =3D=3D 1) ? "block" : "blocks"); (void)write(STDERR_FILENO, buf, strlen(buf)); } if (st.trunc) { - (void)snprintf(buf, sizeof(buf), "%qu truncated %s\n", - st.trunc, (st.trunc =3D=3D 1) ? "block" : "blocks"); + (void)snprintf(buf, sizeof(buf), "%llu truncated %s\n", + (unsigned long long)st.trunc, + (st.trunc =3D=3D 1) ? "block" : "blocks"); (void)write(STDERR_FILENO, buf, strlen(buf)); } (void)snprintf(buf, sizeof(buf), - "%qu bytes transferred in %.6f secs (%.0f bytes/sec)\n", - st.bytes, secs, st.bytes / secs); + "%llu bytes transferred in %.6f secs (%.0f bytes/sec)\n", + (unsigned long long)st.bytes, secs, st.bytes / secs); (void)write(STDERR_FILENO, buf, strlen(buf)); } =20 /* ARGSUSED */ void summaryx(notused) - int notused; + int notused __unused; { int save_errno =3D errno; =20 Index: position.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/bin/dd/position.c,v retrieving revision 1.19 diff -u -r1.19 position.c --- position.c 2000/10/22 23:00:32 1.19 +++ position.c 2001/05/20 04:28:25 @@ -70,7 +70,7 @@ /* If known to be seekable, try to seek on it. */ if (in.flags & ISSEEK) { errno =3D 0; - if (lseek(in.fd, in.offset * in.dbsz, SEEK_CUR) =3D=3D -1 && + if (lseek(in.fd, in.offset * (off_t)in.dbsz, SEEK_CUR) =3D=3D -1 && errno !=3D 0) err(1, "%s", in.name); return; @@ -136,7 +136,7 @@ */ if (out.flags & (ISSEEK | ISPIPE)) { errno =3D 0; - if (lseek(out.fd, out.offset * out.dbsz, SEEK_CUR) =3D=3D -1 && + if (lseek(out.fd, out.offset * (off_t)out.dbsz, SEEK_CUR) =3D=3D -1 && errno !=3D 0) err(1, "%s", out.name); return; --yrj/dFKFPuw6o+aM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.5 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7B0ioWry0BWjoQKURAu92AJ9GtFyVMNAH2kX3uzfPZhvd8FBU8wCggosi +rgaBygXtlGcaj7Rt8kPDsQ= =g72N -----END PGP SIGNATURE----- --yrj/dFKFPuw6o+aM-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message