From owner-freebsd-audit Sun Sep 9 10:40:19 2001 Delivered-To: freebsd-audit@freebsd.org Received: from freebsd.org.ru (sweet.etrust.ru [194.84.67.5]) by hub.freebsd.org (Postfix) with ESMTP id 2310337B401 for ; Sun, 9 Sep 2001 10:40:10 -0700 (PDT) Received: by freebsd.org.ru (Postfix, from userid 1000) id 4D7D724D; Sun, 9 Sep 2001 21:40:08 +0400 (MSD) Date: Sun, 9 Sep 2001 21:40:08 +0400 From: "Sergey A. Osokin" To: audit@FreeBSD.org Subject: libdevstat patch - WARNS=2 Message-ID: <20010909214008.A76698@freebsd.org.ru> Reply-To: osa@FreeBSD.org.ru Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.22.1i 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 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello. Please review WARNS=2 patch for libdevstat. Thanks. -- Rgdz, /"\ Sergey Osokin aka oZZ, \ / ASCII RIBBON CAMPAIGN osa@freebsd.org.ru X AGAINST HTML MAIL http://freebsd.org.ru/~osa/ / \ --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=koi8-r Content-Disposition: attachment; filename=patch-libdevstat Content-Transfer-Encoding: 8bit diff -ruN libdevstat.old/Makefile libdevstat/Makefile --- libdevstat.old/Makefile Fri Sep 7 17:23:34 2001 +++ libdevstat/Makefile Fri Sep 7 17:23:18 2001 @@ -34,4 +34,6 @@ CFLAGS+=-I${.CURDIR} +WARNS?= 2 + .include diff -ruN libdevstat.old/devstat.c libdevstat/devstat.c --- libdevstat.old/devstat.c Fri Sep 7 17:23:34 2001 +++ libdevstat/devstat.c Fri Sep 7 18:24:49 2001 @@ -114,7 +114,7 @@ { DSM_SKIP, DEVSTAT_ARG_SKIP } }; -static char *namelist[] = { +static const char *namelist[] = { #define X_NUMDEVS 0 "_devstat_num_devs", #define X_GENERATION 1 @@ -131,7 +131,7 @@ */ static int compare_select(const void *arg1, const void *arg2); static int readkmem(kvm_t *kd, unsigned long addr, void *buf, size_t nbytes); -static int readkmem_nl(kvm_t *kd, char *name, void *buf, size_t nbytes); +static int readkmem_nl(kvm_t *kd, const char *name, void *buf, size_t nbytes); static char *get_devstat_kvm(kvm_t *kd); #define KREADNL(kd, var, val) \ @@ -142,7 +142,7 @@ { size_t numdevsize; int numdevs; - char *func_name = "devstat_getnumdevs"; + const char *func_name = "devstat_getnumdevs"; numdevsize = sizeof(int); @@ -160,6 +160,7 @@ } else return(numdevs); } else { + if (KREADNL(kd, X_NUMDEVS, numdevs) == -1) return(-1); else @@ -179,7 +180,7 @@ { size_t gensize; long generation; - char *func_name = "devstat_getgeneration"; + const char *func_name = "devstat_getgeneration"; gensize = sizeof(long); @@ -214,7 +215,7 @@ { size_t versize; int version; - char *func_name = "devstat_getversion"; + const char *func_name = "devstat_getversion"; versize = sizeof(int); @@ -246,7 +247,7 @@ int devstat_checkversion(kvm_t *kd) { - char *func_name = "devstat_checkversion"; + const char *func_name = "devstat_checkversion"; int buflen, res, retval = 0, version; version = devstat_getversion(kd); @@ -312,7 +313,7 @@ long oldgeneration; int retval = 0; struct devinfo *dinfo; - char *func_name = "devstat_getdevs"; + const char *func_name = "devstat_getdevs"; dinfo = stats->dinfo; @@ -899,7 +900,7 @@ * device at index i in the old array. */ else { - int found = 0; + found = 0; /* * Search through the old selection array @@ -950,17 +951,17 @@ static int compare_select(const void *arg1, const void *arg2) { - if ((((struct device_selection *)arg1)->selected) - && (((struct device_selection *)arg2)->selected == 0)) + if ((((const struct device_selection *)arg1)->selected) + && (((const struct device_selection *)arg2)->selected == 0)) return(-1); - else if ((((struct device_selection *)arg1)->selected == 0) - && (((struct device_selection *)arg2)->selected)) + else if ((((const struct device_selection *)arg1)->selected == 0) + && (((const struct device_selection *)arg2)->selected)) return(1); - else if (((struct device_selection *)arg2)->bytes < - ((struct device_selection *)arg1)->bytes) + else if (((const struct device_selection *)arg2)->bytes < + ((const struct device_selection *)arg1)->bytes) return(-1); - else if (((struct device_selection *)arg2)->bytes > - ((struct device_selection *)arg1)->bytes) + else if (((const struct device_selection *)arg2)->bytes > + ((const struct device_selection *)arg1)->bytes) return(1); else return(0); @@ -978,7 +979,7 @@ char **tempstr; int num_args; register int i, j; - char *func_name = "devstat_buildmatch"; + const char *func_name = "devstat_buildmatch"; /* We can't do much without a string to parse */ if (match_str == NULL) { @@ -1162,7 +1163,7 @@ devstat_compute_statistics(struct devstat *current, struct devstat *previous, long double etime, ...) { - char *func_name = "devstat_compute_statistics"; + const char *func_name = "devstat_compute_statistics"; u_int64_t totalbytes, totalbytesread, totalbyteswrite; u_int64_t totaltransfers, totaltransfersread, totaltransferswrite; u_int64_t totaltransfersother, totalblocks, totalblocksread; @@ -1449,7 +1450,7 @@ static int readkmem(kvm_t *kd, unsigned long addr, void *buf, size_t nbytes) { - char *func_name = "readkmem"; + const char *func_name = "readkmem"; if (kvm_read(kd, addr, buf, nbytes) == -1) { snprintf(devstat_errbuf, sizeof(devstat_errbuf), @@ -1461,10 +1462,13 @@ } static int -readkmem_nl(kvm_t *kd, char *name, void *buf, size_t nbytes) +readkmem_nl(kvm_t *kd, const char *name, void *buf, size_t nbytes) { - char *func_name = "readkmem_nl"; - struct nlist nl[2] = { { name }, { NULL } }; + const char *func_name = "readkmem_nl"; + struct nlist nl[2]; + + *((const char **)&nl[0].n_name) = name; + nl[1].n_name = NULL; if (kvm_nlist(kd, nl) == -1) { snprintf(devstat_errbuf, sizeof(devstat_errbuf), @@ -1489,7 +1493,7 @@ struct devstatlist dhead; int num_devs; char *rv = NULL; - char *func_name = "get_devstat_kvm"; + const char *func_name = "get_devstat_kvm"; if ((num_devs = getnumdevs()) <= 0) return(NULL); diff -ruN libdevstat.old/devstat.h libdevstat/devstat.h --- libdevstat.old/devstat.h Fri Sep 7 17:23:34 2001 +++ libdevstat/devstat.h Fri Sep 7 17:23:18 2001 @@ -85,7 +85,7 @@ }; struct devstat_match_table { - char *match_str; + const char * match_str; devstat_type_flags type; devstat_match_flags match_field; }; --GvXjxJ+pjyke8COw-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Sep 9 23:55:49 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id 9990837B401 for ; Sun, 9 Sep 2001 23:55:44 -0700 (PDT) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.3) id f8A6wiW18995; Mon, 10 Sep 2001 02:58:44 -0400 (EDT) (envelope-from mike) Date: Mon, 10 Sep 2001 02:58:43 -0400 From: Mike Barcroft To: audit@FreeBSD.org Cc: Dag-Erling Smorgrav Subject: procfs change for review Message-ID: <20010910025843.A18719@coffee.q9media.com> Mail-Followup-To: Mike Barcroft , audit@FreeBSD.org, Dag-Erling Smorgrav Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Organization: The 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 I would appreciate reviews on the following change to procfs. The problem this patch corrects can be observed by doing the following: % cp /bin/cat c\ a\ t % ./c\ a\ t /proc/curproc/status Current procfs: c a t 21589 20303 21589 20303 12,4 ctty 1000103493,166578 0,0 0,4185 nochan 1000 1000 1000,1000,1000,0 - Procfs (with patch applied): c\040a\040t 22970 20303 22970 20303 12,4 ctty 1000103759,393406 0,0 0,3960 nochan 1000 1000 1000,1000,1000,0 - Since the first version contains spaces, a script parsing the data will become confused and fail. The patch is at the end of this e-mail and also available at: http://people.FreeBSD.org/~mike/patches/procfs.20010824.patch Best regards, Mike Barcroft ---------------------------------------------------------------------- procfs.20010824.patch A process name may contain whitespace and unprintable characters, so convert those characters to octal notation. Also convert backslashes to octal notation to avoid confusion. Index: procfs_status.c =================================================================== RCS file: /home/ncvs/src/sys/fs/procfs/procfs_status.c,v retrieving revision 1.32 diff -u -r1.32 procfs_status.c --- procfs_status.c 2001/07/05 17:10:43 1.32 +++ procfs_status.c 2001/08/25 01:07:42 @@ -69,7 +69,7 @@ struct session *sess; struct tty *tp; struct ucred *cr; - char *ps; + char *ps, *pc; char *sep; int pid, ppid, pgid, sid; int i; @@ -95,10 +95,16 @@ ("Too short buffer for new MAXCOMLEN")); ps = psbuf; - bcopy(p->p_comm, ps, MAXCOMLEN); - ps[MAXCOMLEN] = '\0'; - ps += strlen(ps); - DOCHECK(); + pc = p->p_comm; + xlen = strlen(p->p_comm); + do { + if (*pc < 33 || *pc > 126 || *pc == 92) + ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, "\\%03o", + *pc); + else + *ps++ = *pc; + DOCHECK(); + } while (++pc < p->p_comm + xlen); ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, " %d %d %d %d ", pid, ppid, pgid, sid); DOCHECK(); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Sep 10 7:29:10 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (sentinel.office1.bg [217.75.135.254]) by hub.freebsd.org (Postfix) with SMTP id 33F1C37B406 for ; Mon, 10 Sep 2001 07:28:58 -0700 (PDT) Received: (qmail 2007 invoked by uid 1000); 10 Sep 2001 14:28:29 -0000 Date: Mon, 10 Sep 2001 17:28:29 +0300 From: Peter Pentchev To: neckpain@nettaxi.com Cc: Andrzej Bialecki , cc@devcon.net, current@FreeBSD.ORG, audit@FreeBSD.org Subject: Re: problem with dynamic sysctls in -current Message-ID: <20010910172829.A1983@ringworld.oblivion.bg> Mail-Followup-To: neckpain@nettaxi.com, Andrzej Bialecki , cc@devcon.net, current@FreeBSD.ORG, audit@FreeBSD.org References: <200109090052.RAA03215@taxismtp2.alchemyfx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200109090052.RAA03215@taxismtp2.alchemyfx.com>; from neckpain@nettaxi.com on Sun, Sep 09, 2001 at 09:49:59AM +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 Sun, Sep 09, 2001 at 09:49:59AM +0900, neckpain@nettaxi.com wrote: > On Sat, Sep 08, 2001 at 10:27:10PM +0200, Christian Carstensen wrote: > > > > hmm, > > > > i've posted the attached mail a week ago to this list, but got no > > response. could someone please comment on this issue? > > I've also posted a patch(much less refined than yours, though) last month > but still got no response. Maybe you need to talk to the person who committed > rev 1.112 of kern_sysctl.c ? Ouch! I was wondering why no one complained about the way I broke dynamic module unloading.. Guess I don't read -current as much as I should.. Anyway - yes, I am aware of the breakage that rev 1.112 introduced, although I only became aware of it a week or so ago, when I tried to MFC it to 4.4-RC.. I wrote up a quick patch to make things work again, a short discussion on -arch followed, resulting in no real agreement except for "it's broken, somebody should fix it". This, of course, is definitely not an appropriate way to end a discussion about a FreeBSD kernel breakage, but I've been a bit held up by real work events lately, and my -current system went a-bye-bye due to unrelated issues, so I had no system to test any kind of fixes on. I am CC'ing this to Andrej Bialecki, who seems to know a bit more than me about kern_sysctl.c; Andrej, is the attached patch good enough to be committed as an interim fix, until somebody actually gets around to fixing the sysctl_ctx_free() algorithm? This patch is definitely way better than my hack, which added a bogus new argument to sysctl_add_oid() :) If there are no objections, I could commit this in the next few days and take on the responsibility to really look into this in a week or two, and really clean up the mess I made.. G'luck, Peter -- Nostalgia ain't what it used to be. > > ---------- Forwarded message ---------- > > Date: Sat, 1 Sep 2001 03:26:46 +0200 (CEST) > > From: Christian Carstensen > > To: current@freebsd.org > > Subject: dynamic sysctl problem and proposed hot fix > > > > > > hi, > > > > i just came across a problem with dynamic sysctls: > > when unloading a driver module that used dyn sysctls, my system paniced > > with "oid too high". that problem is caused by sysctl_ctx_free() in > > kern/kern_sysctl.c, that first deregisters all oids in the list to see if > > a error occurs. then, all oids are being reregistered and, if there was no > > error, they're finally removed. > > during the second phase, sysctl_register_oid(e1->entry) is called with > > n := e1->entry->oid_number being the old oid number with n > CTL_AUTO_START. > > that leads to panic("static sysctl too high") in sysctl_register_oid. > > one approach might be to initialize the oid_number field to contain the > > value OID_AUTO before calling sysctl_regiser_oid, but i'm unsure about the > > side effects of doing that in sysctl_ctx_free(). > > alternatively, the "old" oid number could be reused, the following patch > > should do, but it's just a workaround. > > > > > > best, > > christian > > > > -- > > "Sorry, no defects found. Please try a different search" > > [http://www.cisco.com/support/bugtools/bugtool.shtml] > > > > > > Index: kern_sysctl.c > > =================================================================== > > RCS file: /usr/cvs/src/sys/kern/kern_sysctl.c,v > > retrieving revision 1.113 > > diff -r1.113 kern_sysctl.c > > 83a84,96 > > > static struct sysctl_oid * > > > sysctl_find_oidnumber(const int number, struct sysctl_oid_list *list) > > > { > > > struct sysctl_oid *oidp; > > > > > > SLIST_FOREACH(oidp, list, oid_link) { > > > if (oidp->oid_number == number) { > > > return (oidp); > > > } > > > } > > > return (NULL); > > > } > > > > > 125c138,139 > > < panic("static sysctl oid too high: %d", oidp->oid_number); > > --- > > > if (sysctl_find_oidnumber(oidp->oid_number, parent)) > > > panic("static sysctl oid too high: %d", oidp->oid_number); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Sep 10 21:32:37 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 B98D537B40D for ; Mon, 10 Sep 2001 21:32:28 -0700 (PDT) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f8B4WJ045470 for ; Tue, 11 Sep 2001 00:32:19 -0400 (EDT) (envelope-from arr@watson.org) Date: Tue, 11 Sep 2001 00:32:18 -0400 (EDT) From: "Andrew R. Reiter" To: freebsd-audit@freebsd.org Subject: select diffs Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-71178614-1000182738=:45198" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-71178614-1000182738=:45198 Content-Type: TEXT/PLAIN; charset=US-ASCII Hey, I am pondering starting on moving alot of the select() usages in src/libexec and src/usr.sbin to using dynamically allocated fd_set bit arrays in order to be extra cautious about fd usage. Therefore, I did a patch for rlogind so that people could review changes that would most likely occur to the sets of code that utilize select(2). I would appreciate comments... if you're wondering why select instead of perhaps moving to kqueue.... After speaking with Jonathan Lemon about whether it was worth moving from select() on all of these to a kqueue-ified system, I believe we/he concluded that probably none of these programs (libexec and usr.sbin) would really require kqueue-ification (except probably inetd), so I decided to move towards doing the fd_set's dyn. alloc'd rather than moving to a kq system. anyway, attached is a patch, but it can also be seen at: http://www.watson.org/~arr/fbsd-audit/libexec/rlogind/rlogin.c.diff This diff was made against current from 9/16/01 (evening pacific time) Andrew *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead --0-71178614-1000182738=:45198 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="rlogind.c.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LS0tIHJsb2dpbmQuYy5vcmlnCU1vbiBTZXAgMTAgMjI6MzI6MjggMjAwMQ0K KysrIHJsb2dpbmQuYwlNb24gU2VwIDEwIDI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7DQogCQkJCXBicCsrLCBwY2MtLTsNCiAj aWZkZWYJQ1JZUFQNCiAJCQkJaWYgKCFkb2VuY3J5cHQpDQogI2VuZGlmDQot CQkJCQlGRF9TRVQoZiwgJm9iaXRzKTsJLyogdHJ5IHdyaXRlICovDQorCQkJ CQlGRF9TRVQoZiwgb2JpdHMpOwkvKiB0cnkgd3JpdGUgKi8NCiAJCQl9IGVs c2Ugew0KIAkJCQlpZiAocGtjb250cm9sKHBpYnVmWzBdKSkgew0KIAkJCQkJ cGlidWZbMF0gfD0gb29iZGF0YVswXTsNCkBAIC00ODksNyArNTI1LDcgQEAN CiAJCQkJcGNjID0gMDsNCiAJCQl9DQogCQl9DQotCQlpZiAoKEZEX0lTU0VU KGYsICZvYml0cykpICYmIHBjYyA+IDApIHsNCisJCWlmICgoRkRfSVNTRVQo Ziwgb2JpdHMpKSAmJiBwY2MgPiAwKSB7DQogI2lmZGVmCUNSWVBUDQogCQkJ aWYgKGRvZW5jcnlwdCkNCiAJCQkJY2MgPSBkZXNfZW5jX3dyaXRlKGYsIHBi cCwgcGNjLA0KQEAgLTUwMyw4ICs1MzksMTEgQEANCiAJCQkJICogZnJvbSBw LCBidXQgc29tZSBvbGQga2VybmVscyBiYWxrIGF0IGxhcmdlDQogCQkJCSAq IHdyaXRlcyBldmVuIHdoZW4gc2VsZWN0IHJldHVybnMgdHJ1ZS4NCiAJCQkJ ICovDQotCQkJCWlmICghRkRfSVNTRVQocCwgJmliaXRzKSkNCisJCQkJaWYg KCFGRF9JU1NFVChwLCBpYml0cykpDQogCQkJCQlzbGVlcCg1KTsNCisJCQkJ ZnJlZShvYml0cyk7DQorCQkJCWZyZWUoaWJpdHMpOw0KKwkJCQlmcmVlKGVi aXRzKTsJDQogCQkJCWNvbnRpbnVlOw0KIAkJCX0NCiAJCQlpZiAoY2MgPiAw KSB7DQo= --0-71178614-1000182738=:45198-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Sep 10 23: 5:57 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 F127C37B401 for ; Mon, 10 Sep 2001 23:05:46 -0700 (PDT) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f8B65ch46102 for ; Tue, 11 Sep 2001 02:05:38 -0400 (EDT) (envelope-from arr@watson.org) Date: Tue, 11 Sep 2001 02:05:32 -0400 (EDT) From: "Andrew R. Reiter" To: freebsd-audit@FreeBSD.ORG Subject: Re: select diffs In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-326324869-1000188332=:46088" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-326324869-1000188332=:46088 Content-Type: TEXT/PLAIN; charset=US-ASCII Thanks to Mike Barcroft for some comments and beating my style(9) skillessness (word?) into helping to clean rlogind.c. Attached is an updated diff for the select "problems" as well as updates to rlogind.c to clean it up in terms of style(9). If I missed something, tips are appreciated -- Im a style(9) retard, to be politically incorrect. Sorry that it's not 2 diffs, one for select and one for style(9) fixes, but such is life. Hope this helps, cheers, andrew On Tue, 11 Sep 2001, Andrew R. Reiter wrote: :Hey, : :I am pondering starting on moving alot of the select() usages in :src/libexec and src/usr.sbin to using dynamically allocated fd_set bit :arrays in order to be extra cautious about fd usage. Therefore, I did a :patch for rlogind so that people could review changes that would most :likely occur to the sets of code that utilize select(2). I would :appreciate comments... : :if you're wondering why select instead of perhaps moving to kqueue.... : :After speaking with Jonathan Lemon about whether it was worth moving from :select() on all of these to a kqueue-ified system, I believe we/he :concluded that probably none of these programs (libexec and usr.sbin) :would really require kqueue-ification (except probably inetd), so I :decided to move towards doing the fd_set's dyn. alloc'd rather than moving :to a kq system. : :anyway, attached is a patch, but it can also be seen at: : : http://www.watson.org/~arr/fbsd-audit/libexec/rlogind/rlogin.c.diff : :This diff was made against current from 9/16/01 (evening pacific time) : :Andrew : :*-------------................................................. :| Andrew R. Reiter :| arr@fledge.watson.org :| "It requires a very unusual mind :| to undertake the analysis of the obvious" -- A.N. Whitehead : *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead --0-326324869-1000188332=:46088 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="rlogind.c.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LS0tIC4vcmxvZ2luZC5jLm9yaWcJTW9uIFNlcCAxMCAyMjozMjoyOCAyMDAx DQorKysgLi9ybG9naW5kLmMJVHVlIFNlcCAxMSAwMDo1OTo0MCAyMDAxDQpA QCAtNzgsNiArNzgsNyBAQA0KICNpbmNsdWRlIDxzdGRsaWIuaD4NCiAjaW5j bHVkZSA8c3RyaW5nLmg+DQogI2luY2x1ZGUgPHVuaXN0ZC5oPg0KKw0KICNp bmNsdWRlICJwYXRobmFtZXMuaCINCiANCiANCkBAIC04Nyw2ICs4OCw4IEBA DQogDQogI2RlZmluZQkJQVJHU1RSCQkJIkRhbG54Ig0KIA0KKyNkZWZpbmUJ ZmRfaG93bWFueSh4LCB5KQkoKCh4KSArICgoeSkgLSAxKSkgLyAoeSkpDQor DQogLyogd3JhcHBlciBmb3IgS0FNRS1zcGVjaWFsIGdldG5hbWVpbmZvKCkg Ki8NCiAjaWZuZGVmIE5JX1dJVEhTQ09QRUlEDQogI2RlZmluZQlOSV9XSVRI U0NPUEVJRAkwDQpAQCAtMTY3LDcgKzE3MCw3IEBADQogCWFyZ2MgLT0gb3B0 aW5kOw0KIAlhcmd2ICs9IG9wdGluZDsNCiANCi0JZnJvbWxlbiA9IHNpemVv ZiAoZnJvbSk7DQorCWZy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AgbHVzZXJuYW1l KSk7DQogfQ0KIA0KIHZvaWQNCg== --0-326324869-1000188332=:46088-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Sep 11 0:29:27 2001 Delivered-To: freebsd-audit@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id F211537B401 for ; Tue, 11 Sep 2001 00:29:17 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f8B7T0E11494; Tue, 11 Sep 2001 10:29:00 +0300 (EEST) (envelope-from ru) Date: Tue, 11 Sep 2001 10:29:00 +0300 From: Ruslan Ermilov To: "Andrew R. Reiter" Cc: freebsd-audit@FreeBSD.ORG Subject: Re: select diffs Message-ID: <20010911102900.C4979@sunbay.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from arr@watson.org on Tue, Sep 11, 2001 at 02:05:32AM -0400 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Sep 11, 2001 at 02:05:32AM -0400, Andrew R. Reiter wrote: > > Thanks to Mike Barcroft for some comments and beating my style(9) > skillessness (word?) into helping to clean rlogind.c. > > Attached is an updated diff for the select "problems" as well as updates > to rlogind.c to clean it up in terms of style(9). If I missed something, > tips are appreciated -- Im a style(9) retard, to be politically incorrect. > > Sorry that it's not 2 diffs, one for select and one for style(9) fixes, > but such is life. > Please don't mix style and functionality fixes!!! These are at least hard to review. 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 Tue Sep 11 1:47:18 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 9EAC837B40B; Tue, 11 Sep 2001 01:47:01 -0700 (PDT) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f8B8kq747716; Tue, 11 Sep 2001 04:46:52 -0400 (EDT) (envelope-from arr@watson.org) Date: Tue, 11 Sep 2001 04:46:51 -0400 (EDT) From: "Andrew R. Reiter" To: Ruslan Ermilov Cc: freebsd-audit@FreeBSD.ORG Subject: Re: select diffs In-Reply-To: <20010911102900.C4979@sunbay.com> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1615358615-1000198011=:47624" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1615358615-1000198011=:47624 Content-Type: TEXT/PLAIN; charset=US-ASCII Ahh yes, I knew this would happen :-) Mike said the same thing -- I cringed since I had just done the entire update without a rcs and sent the patch anyway. Nevertheless, I have the two patches done (and attached). The first (rlogin.c.1.diff) does the style(9) changes... Mike was key in pointing out numerous problems. The second (rlogin.c.2.diff) does the select changes -- dynamic allocation of fd_set bit arrays. Let me know if I missed something in turning it into 2 diffs. thanks, Andrew On Tue, 11 Sep 2001, Ruslan Ermilov wrote: :On Tue, Sep 11, 2001 at 02:05:32AM -0400, Andrew R. Reiter wrote: :> :> Thanks to Mike Barcroft for some comments and beating my style(9) :> skillessness (word?) into helping to clean rlogind.c. :> :> Attached is an updated diff for the select "problems" as well as updates :> to rlogind.c to clean it up in terms of style(9). If I missed something, :> tips are appreciated -- Im a style(9) retard, to be politically incorrect. :> :> Sorry that it's not 2 diffs, one for select and one for style(9) fixes, :> but such is life. :> :Please don't mix style and functionality fixes!!! :These are at least hard to review. : : :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 : *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead --0-1615358615-1000198011=:47624 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="rlogind.c.1.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LS0tIHJsb2dpbmQuYy5vcmlnCU1vbiBTZXAgMTAgMjI6MzI6MjggMjAwMQ0K KysrIHJsb2dpbmQuYwlUdWUgU2VwIDExIDAzOjMwOjQyIDIwMDENCkBAIC03 OCw2ICs3OCw3IEBADQogI2luY2x1ZGUgPHN0ZGxpYi5oPg0KICNpbmNsdWRl IDxzdHJpbmcuaD4NCiAjaW5jbHVkZSA8dW5pc3RkLmg+DQorDQogI2luY2x1 ZGUgInBhdGhuYW1lcy5oIg0KIA0KIA0KQEAgLTEwMyw2ICsxMDQsMTUgQEAN CiANCiBzdHJ1Y3QJcGFzc3dkICpwd2Q7DQogDQoraW50CWNoaWxkOw0KK2lu dAluZXRmOw0KK2NoYXIJbGluZVtNQVhQQVRITEVOXTsNCitpbnQJY29uZmly bWVkOw0KK3N0cnVjdCB3aW5zaXplIHdpbiA9IHsgMCwgMCwgMCwgMCB9Ow0K Kw0KK2NoYXIJbWFnaWNbMl0gPSB7IDAzNzcsIDAzNzcgfTsNCitjaGFyCW9v YmRhdGFbXSA9IHtUSU9DUEtUX1dJTkRPV307DQorDQogdW5pb24gc29ja3Vu aW9uIHsNCiAJc3RydWN0IHNvY2tpbmV0IHsNCiAJCXVfY2hhci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BkZXN0LT5z dV9sZW4sIHB3ZC0+cHdfdWlkID09IDAsIHJ1c2VybmFtZSwNCi0JCQkgICAg bHVzZXJuYW1lKSk7DQorCSAgICBsdXNlcm5hbWUpKTsNCiB9DQogDQogdm9p ZA0K --0-1615358615-1000198011=:47624 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="rlogind.c.2.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LS0tIHJsb2dpbmQuYy5vcmlnCVR1ZSBTZXAgMTEgMDM6NDE6MzEgMjAwMQ0K KysrIHJsb2dpbmQuYwlUdWUgU2VwIDExIDAzOjQxOjA5IDIwMDENCkBAIC04 OCw2ICs4OCw4IEBADQogDQogI2RlZmluZQkJQVJHU1RSCQkJIkRhbG54Ig0K IA0KKyNkZWZpbmUgZmRfaG93bWFueSh4LCB5KSAgICAgICAgKCgoeCkgKyAo KHkpIC0gMSkpIC8gKHkpKQ0KKw0KIC8qIHdyYXBwZXIgZm9yIEtBTUUtc3Bl Y2lhbCBnZXRuYW1laW5mbygpICovDQogI2lmbmRlZiBOSV9XSVRIU0NPUEVJ RA0KICNkZWZpbmUJTklfV0lUSFNDT1BFSUQJMA0KQEAgLTM4Myw3ICszODUs NyBAQA0KIAlpbnQgcGNjID0gMCwgZmNjID0gMDsNCiAJaW50IGNjLCBuZmQs IG47DQogCWNoYXIgY250bDsNCi0JZmRfc2V0IGliaXRzLCBvYml0cywgZWJp dHMsICpvbWFzazsNCisJZmRfc2V0ICppYml0cywgKm9iaXRzLCAqZWJpdHMs ICpvbWFzazsNCiAJcmVnaXN0ZXIgY2hhciAqY3A7DQogCWludCBsZWZ0LCBt Ow0KIA0KQEAgLTQwNCw0NiArNDA2LDY3IEBADQogCX0NCiANCiAJZm9yICg7 Oykgew0KLQkJRkRfWkVSTygmZWJpdHMpOw0KLQkJRkRfWkVSTygmaWJpdHMp Ow0KLQkJRkRfWkVSTygmb2JpdHMpOw0KKwkJaWJpdHMgPSBjYWxsb2MoZmRf aG93bWF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CQkJCWZyZWUoZWJpdHMpOw0KIAkJ CQljb250aW51ZTsNCiAJCQl9DQogCQkJaWYgKGNjID4gMCkgew0K --0-1615358615-1000198011=:47624-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Sep 12 12:38:49 2001 Delivered-To: freebsd-audit@freebsd.org Received: from arb.arb.za.net (mail.powerbox.co.za [196.7.148.4]) by hub.freebsd.org (Postfix) with ESMTP id D205937B405 for ; Wed, 12 Sep 2001 12:37:09 -0700 (PDT) Received: (from uucp@localhost) by arb.arb.za.net (8.11.3/8.11.3) with UUCP id f8CJb7E69532 for audit@freebsd.org; Wed, 12 Sep 2001 21:37:07 +0200 (SAST) (envelope-from mark@grondar.za) Received: from grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.za (8.11.6/8.11.4) with ESMTP id f8CJY6u89490 for ; Wed, 12 Sep 2001 20:34:06 +0100 (BST) (envelope-from mark@grondar.za) Message-Id: <200109121934.f8CJY6u89490@grimreaper.grondar.za> To: audit@freebsd.org Subject: WARNS=2 cleanup for lex and yacc Date: Wed, 12 Sep 2001 20:34:05 +0100 From: Mark Murray Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi Please review Thanks! M Index: lex/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/Makefile,v retrieving revision 1.16 diff -u -d -r1.16 Makefile --- lex/Makefile 27 Mar 2001 10:51:48 -0000 1.16 +++ lex/Makefile 12 Sep 2001 17:04:32 -0000 @@ -22,6 +22,9 @@ MLINKS+= lex.1 flex++.1 MLINKS+= lex.1 lex++.1 +NO_WERROR= true # Flex builds itself; the "unwarned" flex has warnings +WARNS?= 2 + CLEANFILES= scan.c skel.c .if !defined(NOLIB) Index: lex/flex.skl =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/flex.skl,v retrieving revision 1.6 diff -u -d -r1.6 flex.skl --- lex/flex.skl 22 Jul 2001 23:14:33 -0000 1.6 +++ lex/flex.skl 12 Sep 2001 16:06:32 -0000 @@ -240,19 +240,19 @@ */ static int yy_did_buffer_switch_on_eof; -void yyrestart YY_PROTO(( FILE *input_file )); +void yyrestart YY_PROTO(( FILE * )); -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE )); void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *, int )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE, FILE * )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *, yy_size_t )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char * )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *, int )); %* static void *yy_flex_alloc YY_PROTO(( yy_size_t )); @@ -281,9 +281,9 @@ %- Standard (non-C++) definition static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type )); static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); +static void yy_fatal_error YY_PROTO(( yyconst char [] )); %* /* Done after the current pattern has been matched and before the @@ -313,7 +313,7 @@ %- #ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); +static void yyunput YY_PROTO(( int, char * )); #endif %* @@ -340,7 +340,7 @@ static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); +static void yy_push_state YY_PROTO(( int )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); @@ -1257,18 +1257,18 @@ #ifndef YY_NO_SCAN_BUFFER %- #ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer( char *__base, yy_size_t __size ) #else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; +YY_BUFFER_STATE yy_scan_buffer( __base, __size ) +char *__base; +yy_size_t __size; #endif { YY_BUFFER_STATE b; - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) + if ( __size < 2 || + __base[__size-2] != YY_END_OF_BUFFER_CHAR || + __base[__size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; @@ -1276,8 +1276,8 @@ if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_buf_size = __size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = __base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; Index: lex/flexdef.h =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/flexdef.h,v retrieving revision 1.5 diff -u -d -r1.5 flexdef.h --- lex/flexdef.h 27 Oct 1999 07:56:44 -0000 1.5 +++ lex/flexdef.h 12 Sep 2001 16:57:29 -0000 @@ -29,8 +29,9 @@ /* @(#) $Header: /home/daffy/u0/vern/flex/RCS/flexdef.h,v 2.53 95/04/20 11:17:36 vern Exp $ (LBL) */ /* $FreeBSD: src/usr.bin/lex/flexdef.h,v 1.5 1999/10/27 07:56:44 obrien Exp $ */ -#include #include +#include +#include #include "config.h" @@ -432,13 +433,14 @@ extern FILE *skelfile, *yyin, *backing_up_file; extern const char *skel[]; extern int skel_ind; -extern char *infilename, *outfilename; +extern char *infilename; +extern const char *outfilename; extern int did_outfilename; -extern char *prefix, *yyclass; +extern const char *prefix, *yyclass; extern int do_stdinit, use_stdout; extern char **input_files; extern int num_input_files; -extern char *program_name; +extern const char *program_name; extern char *action_array; extern int action_size; @@ -790,10 +792,10 @@ extern void gentabs PROTO((void)); /* Write out a formatted string at the current indentation level. */ -extern void indent_put2s PROTO((char[], char[])); +extern void indent_put2s PROTO((const char[], const char[])); /* Write out a string + newline at the current indentation level. */ -extern void indent_puts PROTO((char[])); +extern void indent_puts PROTO((const char[])); extern void make_tables PROTO((void)); /* generate transition tables */ @@ -808,10 +810,10 @@ /* from file misc.c */ /* Add a #define to the action file. */ -extern void action_define PROTO(( char *defname, int value )); +extern void action_define PROTO(( const char *defname, int value )); /* Add the given text to the stored actions. */ -extern void add_action PROTO(( char *new_text )); +extern void add_action PROTO(( const char *new_text )); /* True if a string is all lower case. */ extern int all_lower PROTO((register char *)); @@ -899,7 +901,7 @@ /* Return a printable version of the given character, which might be * 8-bit. */ -extern char *readable_form PROTO((int)); +extern const char *readable_form PROTO((int)); /* Write out one section of the skeleton file. */ extern void skelout PROTO((void)); @@ -962,23 +964,23 @@ extern void build_eof_action PROTO((void)); /* Write out a message formatted with one string, pinpointing its location. */ -extern void format_pinpoint_message PROTO((char[], char[])); +extern void format_pinpoint_message PROTO((const char[], const char[])); /* Write out a message, pinpointing its location. */ -extern void pinpoint_message PROTO((char[])); +extern void pinpoint_message PROTO((const char[])); /* Write out a warning, pinpointing it at the given line. */ -extern void line_warning PROTO(( char[], int )); +extern void line_warning PROTO(( const char[], int )); /* Write out a message, pinpointing it at the given line. */ -extern void line_pinpoint PROTO(( char[], int )); +extern void line_pinpoint PROTO(( const char[], int )); /* Report a formatted syntax error. */ -extern void format_synerr PROTO((char [], char[])); -extern void synerr PROTO((char [])); /* report a syntax error */ -extern void format_warn PROTO((char [], char[])); -extern void warn PROTO((char [])); /* report a warning */ -extern void yyerror PROTO((char [])); /* report a parse error */ +extern void format_synerr PROTO((const char [], char[])); +extern void synerr PROTO((const char [])); /* report a syntax error */ +extern void format_warn PROTO((const char [], char[])); +extern void warn PROTO((const char [])); /* report a warning */ +extern void yyerror PROTO((const char [])); /* report a parse error */ extern int yyparse PROTO((void)); /* the YACC parser */ @@ -1013,7 +1015,7 @@ /* Increase maximum number of SC's. */ extern void scextend PROTO((void)); -extern void scinstal PROTO((char[], int)); /* make a start condition */ +extern void scinstal PROTO((const char[], int)); /* make a start condition */ /* Lookup the number associated with a start condition. */ extern int sclookup PROTO((char[])); Index: lex/gen.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/gen.c,v retrieving revision 1.5 diff -u -d -r1.5 gen.c --- lex/gen.c 27 Oct 1999 07:56:44 -0000 1.5 +++ lex/gen.c 12 Sep 2001 16:21:07 -0000 @@ -36,8 +36,8 @@ void gen_next_state PROTO((int)); void genecs PROTO((void)); -void indent_put2s PROTO((char [], char [])); -void indent_puts PROTO((char [])); +void indent_put2s PROTO((const char [], const char [])); +void indent_puts PROTO((const char [])); static int indent_level = 0; /* each level is 8 spaces */ @@ -492,11 +492,11 @@ /* NOTE - changes in here should be reflected in gen_next_state() and * gen_NUL_trans(). */ - char *char_map = useecs ? + const char *char_map = useecs ? "yy_ec[YY_SC_TO_UI(*yy_cp)]" : "YY_SC_TO_UI(*yy_cp)"; - char *char_map_2 = useecs ? + const char *char_map_2 = useecs ? "yy_ec[YY_SC_TO_UI(*++yy_cp)]" : "YY_SC_TO_UI(*++yy_cp)"; @@ -1032,7 +1032,7 @@ */ void indent_put2s( fmt, arg ) -char fmt[], arg[]; +const char fmt[], arg[]; { do_indent(); out_str( fmt, arg ); @@ -1045,7 +1045,7 @@ */ void indent_puts( str ) -char str[]; +const char str[]; { do_indent(); outn( str ); @@ -1121,7 +1121,7 @@ * enough to hold the biggest offset. */ int total_table_size = tblend + numecs + 1; - char *trans_offset_type = + const char *trans_offset_type = (total_table_size >= MAX_SHORT || long_align) ? "long" : "short"; Index: lex/main.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/main.c,v retrieving revision 1.7 diff -u -d -r1.7 main.c --- lex/main.c 27 Oct 1999 07:56:45 -0000 1.7 +++ lex/main.c 12 Sep 2001 16:41:36 -0000 @@ -65,9 +65,10 @@ int skel_ind = 0; char *action_array; int action_size, defs1_offset, prolog_offset, action_offset, action_index; -char *infilename = NULL, *outfilename = NULL; +char *infilename = NULL; +const char *outfilename = NULL; int did_outfilename; -char *prefix, *yyclass; +const char *prefix, *yyclass; int do_stdinit, use_stdout; int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE]; int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp; @@ -107,14 +108,14 @@ /* Make sure program_name is initialized so we don't crash if writing * out an error message before getting the program name from argv[0]. */ -char *program_name = "flex"; +const char *program_name = "flex"; #ifndef SHORT_FILE_NAMES -static char *outfile_template = "lex.%s.%s"; -static char *backing_name = "lex.backup"; +static const char *outfile_template = "lex.%s.%s"; +static const char *backing_name = "lex.backup"; #else -static char *outfile_template = "lex%s.%s"; -static char *backing_name = "lex.bck"; +static const char *outfile_template = "lex%s.%s"; +static const char *backing_name = "lex.bck"; #endif #ifdef THINK_C @@ -127,7 +128,7 @@ static char outfile_path[MAXLINE]; static int outfile_created = 0; -static char *skelname = NULL; +static const char *skelname = NULL; int main( argc, argv ) @@ -278,7 +279,7 @@ if ( ! did_outfilename ) { - char *suffix; + const char *suffix; if ( C_plus_plus ) suffix = "cc"; @@ -354,7 +355,6 @@ { int tblsiz; - int unlink(); if ( skelfile != NULL ) { @@ -586,7 +586,7 @@ char **argv; { int i, sawcmpflag; - char *arg; + const char *arg; printstats = syntaxerror = trace = spprdflt = caseins = false; lex_compat = C_plus_plus = backing_up_report = ddebug = fulltbl = false; Index: lex/misc.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/misc.c,v retrieving revision 1.5 diff -u -d -r1.5 misc.c --- lex/misc.c 27 Oct 1999 07:56:45 -0000 1.5 +++ lex/misc.c 12 Sep 2001 16:35:34 -0000 @@ -33,7 +33,7 @@ void action_define( defname, value ) -char *defname; +const char *defname; int value; { char buf[MAXLINE]; @@ -51,7 +51,7 @@ void add_action( new_text ) -char *new_text; +const char *new_text; { int len = strlen( new_text ); @@ -387,7 +387,8 @@ int do_infile; { char directive[MAXLINE], filename[MAXLINE]; - char *s1, *s2, *s3; + const char *s1; + char *s2, *s3; static char line_fmt[] = "#line %d \"%s\"\n"; if ( ! gen_line_dirs ) @@ -711,7 +712,7 @@ * The returned string is in static storage. */ -char *readable_form( c ) +const char *readable_form( c ) register int c; { static char rform[10]; @@ -778,15 +779,15 @@ void skelout() { char buf_storage[MAXLINE]; - char *buf = buf_storage; + const char *buf = buf_storage; int do_copy = 1; /* Loop pulling lines either from the skelfile, if we're using * one, or from the skel[] array. */ while ( skelfile ? - (fgets( buf, MAXLINE, skelfile ) != NULL) : - ((buf = (char *) skel[skel_ind++]) != 0) ) + (fgets( buf_storage, MAXLINE, skelfile ) != NULL) : + ((buf = skel[skel_ind++]) != 0) ) { /* copy from skel array */ if ( buf[0] == '%' ) { /* control line */ Index: lex/nfa.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/nfa.c,v retrieving revision 1.5 diff -u -d -r1.5 nfa.c --- lex/nfa.c 27 Oct 1999 07:56:46 -0000 1.5 +++ lex/nfa.c 12 Sep 2001 16:36:09 -0000 @@ -238,8 +238,8 @@ /* Do trailing context magic to not match the trailing * characters. */ - char *scanner_cp = "yy_c_buf_p = yy_cp"; - char *scanner_bp = "yy_bp"; + const char *scanner_cp = "yy_c_buf_p = yy_cp"; + const char *scanner_bp = "yy_bp"; add_action( "*yy_cp = yy_hold_char; /* undo effects of setting up yytext */\n" ); Index: lex/parse.y =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/parse.y,v retrieving revision 1.3 diff -u -d -r1.3 parse.y --- lex/parse.y 27 Oct 1999 07:56:46 -0000 1.3 +++ lex/parse.y 12 Sep 2001 16:55:30 -0000 @@ -78,7 +78,7 @@ /* Bletch, ^^^^ that was ugly! */ -int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, rulelen; +int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, __i, rulelen; int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule; int *scon_stk; @@ -126,8 +126,8 @@ finish_rule( def_rule, false, 0, 0 ); - for ( i = 1; i <= lastsc; ++i ) - scset[i] = mkbranch( scset[i], def_rule ); + for ( __i = 1; __i <= lastsc; ++__i ) + scset[__i] = mkbranch( scset[__i], def_rule ); if ( spprdflt ) add_action( @@ -225,9 +225,9 @@ if ( scon_stk_ptr > 0 ) { - for ( i = 1; i <= scon_stk_ptr; ++i ) - scbol[scon_stk[i]] = - mkbranch( scbol[scon_stk[i]], + for ( __i = 1; __i <= scon_stk_ptr; ++__i ) + scbol[scon_stk[__i]] = + mkbranch( scbol[scon_stk[__i]], pat ); } @@ -237,9 +237,9 @@ * including the default (0) start condition. */ - for ( i = 1; i <= lastsc; ++i ) - if ( ! scxclu[i] ) - scbol[i] = mkbranch( scbol[i], + for ( __i = 1; __i <= lastsc; ++__i ) + if ( ! scxclu[__i] ) + scbol[__i] = mkbranch( scbol[__i], pat ); } @@ -261,18 +261,18 @@ if ( scon_stk_ptr > 0 ) { - for ( i = 1; i <= scon_stk_ptr; ++i ) - scset[scon_stk[i]] = - mkbranch( scset[scon_stk[i]], + for ( __i = 1; __i <= scon_stk_ptr; ++__i ) + scset[scon_stk[__i]] = + mkbranch( scset[scon_stk[__i]], pat ); } else { - for ( i = 1; i <= lastsc; ++i ) - if ( ! scxclu[i] ) - scset[i] = - mkbranch( scset[i], + for ( __i = 1; __i <= lastsc; ++__i ) + if ( ! scxclu[__i] ) + scset[__i] = + mkbranch( scset[__i], pat ); } } @@ -287,9 +287,9 @@ /* This EOF applies to all start conditions * which don't already have EOF actions. */ - for ( i = 1; i <= lastsc; ++i ) - if ( ! sceof[i] ) - scon_stk[++scon_stk_ptr] = i; + for ( __i = 1; __i <= lastsc; ++__i ) + if ( ! sceof[__i] ) + scon_stk[++scon_stk_ptr] = __i; if ( scon_stk_ptr == 0 ) warn( @@ -315,16 +315,16 @@ { $$ = scon_stk_ptr; - for ( i = 1; i <= lastsc; ++i ) + for ( __i = 1; __i <= lastsc; ++__i ) { int j; for ( j = 1; j <= scon_stk_ptr; ++j ) - if ( scon_stk[j] == i ) + if ( scon_stk[j] == __i ) break; if ( j > scon_stk_ptr ) - scon_stk[++scon_stk_ptr] = i; + scon_stk[++scon_stk_ptr] = __i; } } @@ -348,8 +348,8 @@ nmstr ); else { - for ( i = 1; i <= scon_stk_ptr; ++i ) - if ( scon_stk[i] == scnum ) + for ( __i = 1; __i <= scon_stk_ptr; ++__i ) + if ( scon_stk[__i] == scnum ) { format_warn( "<%s> specified twice", @@ -357,7 +357,7 @@ break; } - if ( i > scon_stk_ptr ) + if ( __i > scon_stk_ptr ) scon_stk[++scon_stk_ptr] = scnum; } } @@ -701,8 +701,8 @@ else { - for ( i = $2; i <= $4; ++i ) - ccladd( $1, i ); + for ( __i = $2; __i <= $4; ++__i ) + ccladd( $1, __i ); /* Keep track if this ccl is staying in * alphabetical order. @@ -816,7 +816,8 @@ /* format_synerr - write out formatted syntax error */ void format_synerr( msg, arg ) -char msg[], arg[]; +const char msg[]; +char arg[]; { char errmsg[MAXLINE]; @@ -828,7 +829,7 @@ /* synerr - report a syntax error */ void synerr( str ) -char str[]; +const char str[]; { syntaxerror = true; pinpoint_message( str ); @@ -838,7 +839,8 @@ /* format_warn - write out formatted warning */ void format_warn( msg, arg ) -char msg[], arg[]; +const char msg[]; +char arg[]; { char warn_msg[MAXLINE]; @@ -850,7 +852,7 @@ /* warn - report a warning, unless -w was given */ void warn( str ) -char str[]; +const char str[]; { line_warning( str, linenum ); } @@ -860,7 +862,7 @@ */ void format_pinpoint_message( msg, arg ) -char msg[], arg[]; +const char msg[], arg[]; { char errmsg[MAXLINE]; @@ -872,7 +874,7 @@ /* pinpoint_message - write out a message, pinpointing its location */ void pinpoint_message( str ) -char str[]; +const char str[]; { line_pinpoint( str, linenum ); } @@ -881,7 +883,7 @@ /* line_warning - report a warning at a given line, unless -w was given */ void line_warning( str, line ) -char str[]; +const char str[]; int line; { char warning[MAXLINE]; @@ -897,7 +899,7 @@ /* line_pinpoint - write out a message, pinpointing it at the given line */ void line_pinpoint( str, line ) -char str[]; +const char str[]; int line; { fprintf( stderr, "\"%s\", line %d: %s\n", infilename, line, str ); @@ -909,6 +911,6 @@ */ void yyerror( msg ) -char msg[]; +const char msg[] __unused; { } Index: lex/scan.l =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/scan.l,v retrieving revision 1.5 diff -u -d -r1.5 scan.l --- lex/scan.l 27 Oct 1999 07:56:46 -0000 1.5 +++ lex/scan.l 12 Sep 2001 16:38:47 -0000 @@ -99,7 +99,7 @@ int doing_codeblock = false; int i; - Char nmdef[MAXLINE], myesc(); + Char nmdef[MAXLINE]; { @@ -160,7 +160,7 @@ [[:digit:]]+ linenum = myctoi( yytext ); \"[^"\n]*\" { - flex_free( (void *) infilename ); + flex_free( infilename ); infilename = copy_string( yytext + 1 ); infilename[strlen( infilename ) - 1] = '\0'; } @@ -435,7 +435,6 @@ "{"{NAME}"}" { register Char *nmdefptr; - Char *ndlookup(); strcpy( nmstr, yytext + 1 ); nmstr[yyleng - 2] = '\0'; /* chop trailing brace */ Index: lex/sym.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/sym.c,v retrieving revision 1.5 diff -u -d -r1.5 sym.c --- lex/sym.c 27 Oct 1999 07:56:47 -0000 1.5 +++ lex/sym.c 12 Sep 2001 17:00:38 -0000 @@ -41,7 +41,7 @@ struct hash_entry *sctbl[START_COND_HASH_SIZE]; struct hash_entry *ccltab[CCL_HASH_SIZE]; -struct hash_entry *findsym(); +struct hash_entry *findsym(char[], hash_table, int); /* addsym - add symbol and definitions to symbol table @@ -106,8 +106,6 @@ /* We don't bother checking the return status because we are not * called unless the symbol is new. */ - Char *copy_unsigned_string(); - (void) addsym( (char *) copy_unsigned_string( ccltxt ), (char *) 0, cclnum, ccltab, CCL_HASH_SIZE ); @@ -180,9 +178,6 @@ char name[]; Char definition[]; { - char *copy_string(); - Char *copy_unsigned_string(); - if ( addsym( copy_string( name ), (char *) copy_unsigned_string( definition ), 0, ndtbl, NAME_TABLE_HASH_SIZE ) ) @@ -225,11 +220,9 @@ */ void scinstal( str, xcluflg ) -char str[]; +const char str[]; int xcluflg; { - char *copy_string(); - /* Generate start condition definition, for use in BEGIN et al. */ action_define( str, lastsc ); Index: lex/tblcmp.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/tblcmp.c,v retrieving revision 1.5 diff -u -d -r1.5 tblcmp.c --- lex/tblcmp.c 27 Oct 1999 07:56:47 -0000 1.5 +++ lex/tblcmp.c 12 Sep 2001 17:01:31 -0000 @@ -643,8 +643,8 @@ * has only one out-transition */ -void mk1tbl( state, sym, onenxt, onedef ) -int state, sym, onenxt, onedef; +void mk1tbl( state, sym, onenxt, onedf ) +int state, sym, onenxt, onedf; { if ( firstfree < sym ) firstfree = sym; @@ -654,7 +654,7 @@ expand_nxt_chk(); base[state] = firstfree - sym; - def[state] = onedef; + def[state] = onedf; chk[firstfree] = state; nxt[firstfree] = onenxt; Index: lex/lib/libmain.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/lib/libmain.c,v retrieving revision 1.3 diff -u -d -r1.3 libmain.c --- lex/lib/libmain.c 27 Oct 1999 07:56:49 -0000 1.3 +++ lex/lib/libmain.c 12 Sep 2001 15:29:32 -0000 @@ -3,14 +3,14 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/libmain.c,v 1.4 95/09/27 12:47:55 vern Exp $ * $FreeBSD: src/usr.bin/lex/lib/libmain.c,v 1.3 1999/10/27 07:56:49 obrien Exp $ */ -extern int yylex(); +#include -int main( argc, argv ) -int argc; -char *argv[]; - { - while ( yylex() != 0 ) - ; +extern int yylex(void); + +int +main(int argc __unused, char *argv[] __unused) +{ + while (yylex() != 0); return 0; - } +} Index: lex/lib/libyywrap.c =================================================================== RCS file: /home/ncvs/src/usr.bin/lex/lib/libyywrap.c,v retrieving revision 1.4 diff -u -d -r1.4 libyywrap.c --- lex/lib/libyywrap.c 27 Oct 1999 07:56:49 -0000 1.4 +++ lex/lib/libyywrap.c 12 Sep 2001 15:31:41 -0000 @@ -3,7 +3,10 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/libyywrap.c,v 1.1 93/10/02 15:23:09 vern Exp $ * $FreeBSD: src/usr.bin/lex/lib/libyywrap.c,v 1.4 1999/10/27 07:56:49 obrien Exp $ */ -int yywrap() - { +int yywrap(void); + +int +yywrap(void) +{ return 1; - } +} Index: yacc/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/Makefile,v retrieving revision 1.10 diff -u -d -r1.10 Makefile --- yacc/Makefile 7 Apr 2001 11:21:26 -0000 1.10 +++ yacc/Makefile 12 Sep 2001 14:20:53 -0000 @@ -8,5 +8,6 @@ MAN= yacc.1 yyfix.1 LINKS= ${BINDIR}/yacc ${BINDIR}/byacc MLINKS= yacc.1 byacc.1 +WARNS?= 2 .include Index: yacc/defs.h =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/defs.h,v retrieving revision 1.9 diff -u -d -r1.9 defs.h --- yacc/defs.h 26 Nov 2000 11:07:45 -0000 1.9 +++ yacc/defs.h 12 Sep 2001 14:55:14 -0000 @@ -225,7 +225,7 @@ extern char rflag; extern char tflag; extern char vflag; -extern char *symbol_prefix; +extern const char *symbol_prefix; extern char *myname; extern char *cptr; @@ -233,16 +233,16 @@ extern int lineno; extern int outline; -extern char *banner[]; -extern char *tables[]; -extern char *header[]; -extern char *body[]; -extern char *trailer[]; +extern const char *banner[]; +extern const char *tables[]; +extern const char *header[]; +extern const char *body[]; +extern const char *trailer[]; extern char *action_file_name; extern char *code_file_name; extern char *defines_file_name; -extern char *input_file_name; +extern const char *input_file_name; extern char *output_file_name; extern char *text_file_name; extern char *union_file_name; @@ -319,7 +319,7 @@ void dollar_error __P((int, char *, char *)); void dollar_warning __P((int, int)); void done __P((int)); -void fatal __P((char *msg)); +void fatal __P((const char *msg)); void finalize_closure __P((void)); void free_parser __P((void)); void free_symbols __P((void)); @@ -329,11 +329,11 @@ void lalr __P((void)); bucket *lookup __P((char *)); void lr0 __P((void)); -bucket *make_bucket __P((char *)); +bucket *make_bucket __P((const char *)); void make_parser __P((void)); void no_grammar __P((void)); void no_space __P((void)); -void open_error __P((char *)); +void open_error __P((const char *)); void output __P((void)); void over_unionized __P((char *)); void prec_redeclared __P((void)); @@ -361,4 +361,4 @@ void untyped_rhs __P((int, char *)); void used_reserved __P((char *)); void verbose __P((void)); -void write_section __P((char **)); +void write_section __P((const char **)); Index: yacc/error.c =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/error.c,v retrieving revision 1.7 diff -u -d -r1.7 error.c --- yacc/error.c 28 Aug 1999 01:07:59 -0000 1.7 +++ yacc/error.c 12 Sep 2001 14:33:23 -0000 @@ -50,7 +50,7 @@ void fatal(msg) -char *msg; +const char *msg; { warnx("f - %s", msg); done(2); @@ -67,7 +67,7 @@ void open_error(filename) -char *filename; +const char *filename; { warnx("f - cannot open \"%s\"", filename); done(2); Index: yacc/lalr.c =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/lalr.c,v retrieving revision 1.7 diff -u -d -r1.7 lalr.c --- yacc/lalr.c 28 Aug 1999 01:07:59 -0000 1.7 +++ yacc/lalr.c 12 Sep 2001 14:26:19 -0000 @@ -415,7 +415,7 @@ register shifts *sp; register int length; register int nedges; - register int done; + register int isdone; register int state1; register int stateno; register int symbol1; @@ -459,16 +459,16 @@ add_lookback_edge(stateno, *rulep, i); length--; - done = 0; - while (!done) + isdone = 0; + while (!isdone) { - done = 1; + isdone = 1; rp--; if (ISVAR(*rp)) { stateno = states[--length]; edge[nedges++] = map_goto(stateno, *rp); - if (nullable[*rp] && length > 0) done = 0; + if (nullable[*rp] && length > 0) isdone = 0; } } } @@ -526,12 +526,12 @@ static short ** -transpose(R, n) -short **R; +transpose(r, n) +short **r; int n; { - register short **new_R; - register short **temp_R; + register short **new_r; + register short **temp_r; register short *nedges; register short *sp; register int i; @@ -541,7 +541,7 @@ for (i = 0; i < n; i++) { - sp = R[i]; + sp = r[i]; if (sp) { while (*sp >= 0) @@ -549,8 +549,8 @@ } } - new_R = NEW2(n, short *); - temp_R = NEW2(n, short *); + new_r = NEW2(n, short *); + temp_r = NEW2(n, short *); for (i = 0; i < n; i++) { @@ -558,8 +558,8 @@ if (k > 0) { sp = NEW2(k + 1, short); - new_R[i] = sp; - temp_R[i] = sp; + new_r[i] = sp; + temp_r[i] = sp; sp[k] = -1; } } @@ -568,17 +568,17 @@ for (i = 0; i < n; i++) { - sp = R[i]; + sp = r[i]; if (sp) { while (*sp >= 0) - *temp_R[*sp++]++ = i; + *temp_r[*sp++]++ = i; } } - FREE(temp_R); + FREE(temp_r); - return (new_R); + return (new_r); } Index: yacc/lr0.c =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/lr0.c,v retrieving revision 1.6 diff -u -d -r1.6 lr0.c --- yacc/lr0.c 28 Aug 1999 01:08:00 -0000 1.6 +++ yacc/lr0.c 12 Sep 2001 14:28:04 -0000 @@ -611,7 +611,7 @@ { register int i, j; register int empty; - int done; + int isdone; nullable = MALLOC(nsyms); if (nullable == 0) no_space(); @@ -619,10 +619,10 @@ for (i = 0; i < nsyms; ++i) nullable[i] = 0; - done = 0; - while (!done) + isdone = 0; + while (!isdone) { - done = 1; + isdone = 1; for (i = 1; i < nitems; i++) { empty = 1; @@ -638,7 +638,7 @@ if (!nullable[j]) { nullable[j] = 1; - done = 0; + isdone = 0; } } } Index: yacc/main.c =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/main.c,v retrieving revision 1.12 diff -u -d -r1.12 main.c --- yacc/main.c 10 Jan 2000 20:26:24 -0000 1.12 +++ yacc/main.c 12 Sep 2001 14:40:50 -0000 @@ -60,9 +60,9 @@ char tflag; char vflag; -char *symbol_prefix; -char *file_prefix = "y"; -char *temp_form = "yacc.XXXXXXXXXXX"; +const char *symbol_prefix; +const char *file_prefix = "y"; +const char *temp_form = "yacc.XXXXXXXXXXX"; int lineno; int outline; @@ -70,7 +70,7 @@ char *action_file_name; char *code_file_name; char *defines_file_name; -char *input_file_name = ""; +const char *input_file_name = ""; char *output_file_name; char *text_file_name; char *union_file_name; @@ -130,7 +130,7 @@ static void onintr(signo) - int signo; + int signo __unused; { done(1); } @@ -298,7 +298,7 @@ create_file_names() { int i, len; - char *tmpdir; + const char *tmpdir; tmpdir = getenv("TMPDIR"); if (tmpdir == 0) tmpdir = "/tmp"; Index: yacc/mkpar.c =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/mkpar.c,v retrieving revision 1.10 diff -u -d -r1.10 mkpar.c --- yacc/mkpar.c 28 Aug 1999 01:08:01 -0000 1.10 +++ yacc/mkpar.c 12 Sep 2001 14:39:00 -0000 @@ -107,7 +107,7 @@ { register action *actions, *temp; register shifts *sp; - register short *to_state; + register short *tostate; register int i, k; register int symbol; @@ -115,10 +115,10 @@ sp = shift_table[stateno]; if (sp) { - to_state = sp->shift; + tostate = sp->shift; for (i = sp->nshifts - 1; i >= 0; i--) { - k = to_state[i]; + k = tostate[i]; symbol = accessing_symbol[k]; if (ISTOKEN(symbol)) { @@ -207,15 +207,15 @@ find_final_state() { register int goal, i; - register short *to_state; + register short *tostate; register shifts *p; p = shift_table[0]; - to_state = p->shift; + tostate = p->shift; goal = ritem[1]; for (i = p->nshifts - 1; i >= 0; --i) { - final_state = to_state[i]; + final_state = tostate[i]; if (accessing_symbol[final_state] == goal) break; } } Index: yacc/output.c =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/output.c,v retrieving revision 1.15 diff -u -d -r1.15 output.c --- yacc/output.c 26 Nov 2000 11:07:45 -0000 1.15 +++ yacc/output.c 12 Sep 2001 14:45:30 -0000 @@ -954,6 +954,7 @@ { register int i, j, k, max; char **symnam, *s; + static char eof[]="end-of-file"; ++outline; fprintf(code_file, "#define YYFINAL %d\n", final_state); @@ -980,7 +981,7 @@ symnam[i] = 0; for (i = ntokens - 1; i >= 2; --i) symnam[symbol_value[i]] = symbol_name[i]; - symnam[0] = "end-of-file"; + symnam[0] = eof; if (!rflag) ++outline; fprintf(output_file, "#if YYDEBUG\n"); Index: yacc/reader.c =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/reader.c,v retrieving revision 1.9 diff -u -d -r1.9 reader.c --- yacc/reader.c 26 Nov 2000 11:07:45 -0000 1.9 +++ yacc/reader.c 12 Sep 2001 14:48:42 -0000 @@ -113,6 +113,7 @@ static void read_grammar __P((void)); static void skip_comment __P((void)); static void start_rule __P((bucket *, int)); +static void declare_expect __P((int)); static void cachec(c) @@ -1818,7 +1819,7 @@ pack_grammar() { register int i, j; - int assoc, prec; + int assoc, pre; ritem = (short *) MALLOC(nitems*sizeof(short)); if (ritem == 0) no_space(); @@ -1848,13 +1849,13 @@ rlhs[i] = plhs[i]->index; rrhs[i] = j; assoc = TOKEN; - prec = 0; + pre = 0; while (pitem[j]) { ritem[j] = pitem[j]->index; if (pitem[j]->class == TERM) { - prec = pitem[j]->prec; + pre = pitem[j]->prec; assoc = pitem[j]->assoc; } ++j; @@ -1863,7 +1864,7 @@ ++j; if (rprec[i] == UNDEFINED) { - rprec[i] = prec; + rprec[i] = pre; rassoc[i] = assoc; } } Index: yacc/skeleton.c =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/skeleton.c,v retrieving revision 1.29 diff -u -d -r1.29 skeleton.c --- yacc/skeleton.c 19 Feb 2001 01:10:01 -0000 1.29 +++ yacc/skeleton.c 12 Sep 2001 15:47:52 -0000 @@ -52,7 +52,7 @@ /* the body either are not useful outside of semantic actions or */ /* are conditional. */ -char *banner[] = +const char *banner[] = { "#ifndef lint", "static char const ", @@ -76,7 +76,7 @@ }; -char *tables[] = +const char *tables[] = { "extern const short yylhs[];", "extern const short yylen[];", @@ -95,7 +95,7 @@ }; -char *header[] = +const char *header[] = { "#if YYDEBUG", "#include ", @@ -128,10 +128,10 @@ }; -char *body[] = +const char *body[] = { "/* allocate initial stack or double stack size, up to YYMAXDEPTH */", - "static int yygrowstack()", + "static int yygrowstack(void)", "{", " int newsize, i;", " short *newss;", @@ -330,7 +330,7 @@ }; -char *trailer[] = +const char *trailer[] = { " }", " yyssp -= yym;", @@ -394,11 +394,11 @@ void write_section(section) -char *section[]; +const char *section[]; { register int c; register int i; - register char *s; + register const char *s; register FILE *f; f = code_file; Index: yacc/symtab.c =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/symtab.c,v retrieving revision 1.6 diff -u -d -r1.6 symtab.c --- yacc/symtab.c 28 Aug 1999 01:08:03 -0000 1.6 +++ yacc/symtab.c 12 Sep 2001 14:56:37 -0000 @@ -49,7 +49,7 @@ #define TABLE_SIZE 1024 -static int hash __P((char *)); +static int hash __P((const char *)); bucket **symbol_table; bucket *first_symbol; @@ -58,9 +58,9 @@ static int hash(name) -char *name; +const char *name; { - register char *s; + register const char *s; register int c, k; assert(name && *name); @@ -75,7 +75,7 @@ bucket * make_bucket(name) -char *name; +const char *name; { register bucket *bp; Index: yacc/verbose.c =================================================================== RCS file: /home/ncvs/src/usr.bin/yacc/verbose.c,v retrieving revision 1.6 diff -u -d -r1.6 verbose.c --- yacc/verbose.c 28 Aug 1999 01:08:03 -0000 1.6 +++ yacc/verbose.c 12 Sep 2001 14:59:22 -0000 @@ -331,9 +331,9 @@ static void -print_reductions(p, defred) +print_reductions(p, def) register action *p; -register int defred; +register int def; { register int k, anyreds; register action *q; @@ -354,7 +354,7 @@ { for (; p; p = p->next) { - if (p->action_code == REDUCE && p->number != defred) + if (p->action_code == REDUCE && p->number != def) { k = p->number - 2; if (p->suppressed == 0) @@ -363,8 +363,8 @@ } } - if (defred > 0) - fprintf(verbose_file, "\t. reduce %d\n", defred - 2); + if (def > 0) + fprintf(verbose_file, "\t. reduce %d\n", def - 2); } } @@ -375,15 +375,15 @@ { register int i, k; register int as; - register short *to_state; + register short *tostate; register shifts *sp; putc('\n', verbose_file); sp = shift_table[stateno]; - to_state = sp->shift; + tostate = sp->shift; for (i = 0; i < sp->nshifts; ++i) { - k = to_state[i]; + k = tostate[i]; as = accessing_symbol[k]; if (ISVAR(as)) fprintf(verbose_file, "\t%s goto %d\n", symbol_name[as], k); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Sep 13 2:46:23 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 3A6D837B410 for ; Thu, 13 Sep 2001 02:46:11 -0700 (PDT) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f8D9k1m93774 for ; Thu, 13 Sep 2001 05:46:01 -0400 (EDT) (envelope-from arr@watson.org) Date: Thu, 13 Sep 2001 05:46:00 -0400 (EDT) From: "Andrew R. Reiter" To: freebsd-audit@freebsd.org Subject: inetd fd_set patch Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1488729123-1000374360=:93735" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1488729123-1000374360=:93735 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, Attached is a patch that moves to dynamically allocated fd_set bit arrays. It can also be found at: http://www.watson.org/~arr/fbsd-audit/usr.sbin/inetd/inetd.c.diff Hope it helps, Andrew *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead --0-1488729123-1000374360=:93735 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="inetd.c.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LS0tIGluZXRkLmMub3JpZwlUaHUgU2VwIDEzIDAxOjQ2OjExIDIwMDENCisr KyBpbmV0ZC5jCVRodSBTZXAgMTMgMDM6Mzg6MDkgMjAwMQ0KQEAgLTIwNCw2 ICsyMDQsOCBAQA0KIA0KICNkZWZpbmUJU0lHQkxPQ0sJKHNpZ21hc2soU0lH Q0hMRCl8c2lnbWFzayhTSUdIVVApfHNpZ21hc2soU0lHQUxSTSkpDQogDQor I2RlZmluZQlmZF9ob3dtYW55KHgsIHkpCSgoKHgpICsgKCh5KSAtIDEpKSAv ICh5KSkNCisNCiB2b2lkCQljbG9zZV9zZXAgX19QKChzdHJ1Y3Qgc2VydnRh YiAqKSk7DQogdm9pZAkJZmxhZ19zaWduYWwgX19QKChpbnQpKTsNCiB2b2lk CQlmbGFnX2NvbmZpZyBfX1AoKGludCkpOw0KQEAgLTIzNiw3ICsyMzgsOCBA QA0KIGludAlkZWJ1ZyA9IDA7DQogaW50CWxvZyA9IDA7DQogaW50CW1heHNv Y2s7CQkJLyogaGlnaGVzdC1udW1iZXJlZCBkZXNjcmlwdG9yICovDQotZmRf c2V0CWFsbHNvY2s7DQorZmRfc2V0CSphbGxzb2NrOw0KK2ludAlhbGxzb2Nr X2xlbjsNCiBpbnQJb3B0aW9uczsNCiBpbn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bMF07DQogCWlmIChzaWdu YWxwaXBlWzFdID4gbWF4c29jaykNCiAJICAgIG1heHNvY2sgPSBzaWduYWxw aXBlWzFdOw0KKwlpZiAobWF4c29jayA+PSBhbGxzb2NrX2xlbikgew0KKwkg ICAgYWxsc29ja19sZW4gPSBtYXhzb2NrICsgMTsNCisJICAgIGlmIChyZWFs bG9jZihhbGxzb2NrLCBhbGxzb2NrX2xlbiAqIHNpemVvZihmZF9tYXNrKSkg PT0gTlVMTCkNCisJCWVycngoMSwgInJlYWxsb2NmIik7DQorCX0gDQorCQ0K KwlGRF9TRVQoc2lnbmFscGlwZVswXSwgYWxsc29jayk7DQogDQogCWZvciAo OzspIHsNCiAJICAgIGludCBuLCBjdHJsOw0KLQkgICAgZmRfc2V0IHJlYWRh YmxlOw0KKwkgICAgZmRfc2V0ICpyZWFkYWJsZTsNCiANCiAjaWZkZWYgU0FO SVRZX0NIRUNLDQogCSAgICBpZiAobnNvY2sgPT0gMCkgew0KIAkJc3lzbG9n KExPR19FUlIsICIlczogbnNvY2s9MCIsIF9fRlVOQ1RJT05fXyk7DQorCQlp ZiAoYWxsc29jaykNCisJCQlmcmVlKGFsbHNvY2spOw0KIAkJZXhpdChFWF9T T0ZUV0FSRSk7DQogCSAgICB9DQogI2VuZGlmDQogCSAgICByZWFkYWJsZSA9 IGFsbHNvY2s7DQotCSAgICBpZiAoKG4gPSBzZWxlY3QobWF4c29jayArIDEs ICZyZWFkYWJsZSwgKGZkX3NldCAqKTAsDQorCSAgICBpZiAoKG4gPSBzZWxl Y3QobWF4c29jayArIDEsIHJlYWRhYmxlLCAoZmRfc2V0ICopMCwNCiAJCShm ZF9zZXQgKikwLCAoc3RydWN0IHRpbWV2YWwgKikwKSkgPD0gMCkgew0KIAkJ ICAgIGlmIChuIDwgMCAmJiBlcnJubyAhPSBFSU5UUikgew0KIAkJCXN5c2xv ZyhMT0dfV0FSTklORywgInNlbGVjdDogJW0iKTsNCkBAIC01MTAsMTUgKzUy NSwxOSBAQ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D.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Sep 13 2:48:18 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 F242637B403 for ; Thu, 13 Sep 2001 02:48:15 -0700 (PDT) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f8D9m6K93800 for ; Thu, 13 Sep 2001 05:48:06 -0400 (EDT) (envelope-from arr@watson.org) Date: Thu, 13 Sep 2001 05:48:06 -0400 (EDT) From: "Andrew R. Reiter" To: freebsd-audit@FreeBSD.ORG Subject: Re: inetd fd_set patch In-Reply-To: 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 As a futile follow-up, it really may be wise to actually do this patch as a move from select() to kqueue() considering it is inetd. Thoughts? Andrew On Thu, 13 Sep 2001, Andrew R. Reiter wrote: :Hi, : :Attached is a patch that moves to dynamically allocated fd_set bit arrays. :It can also be found at: : http://www.watson.org/~arr/fbsd-audit/usr.sbin/inetd/inetd.c.diff : :Hope it helps, :Andrew : : :*-------------................................................. :| Andrew R. Reiter :| arr@fledge.watson.org :| "It requires a very unusual mind :| to undertake the analysis of the obvious" -- A.N. Whitehead : *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Sep 13 11: 1:54 2001 Delivered-To: freebsd-audit@freebsd.org Received: from basm.cerias.purdue.edu (basm.cerias.purdue.edu [128.10.243.21]) by hub.freebsd.org (Postfix) with ESMTP id 911A437B406 for ; Thu, 13 Sep 2001 11:01:47 -0700 (PDT) Received: (from raj@localhost) by basm.cerias.purdue.edu (8.9.3+Sun/8.9.3) id NAA06393 for freebsd-audit@freebsd.org; Thu, 13 Sep 2001 13:01:46 -0500 (EST) Date: Thu, 13 Sep 2001 13:01:46 -0500 From: Brian Poole To: freebsd-audit@freebsd.org Subject: Cleanup in adduser.perl Message-ID: <20010913130145.L1855@basm.cerias.purdue.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Hello, Cleaned up many similar problems in OpenBSD's adduser which was originally from Free, decided to mirror the changes where possible in FreeBSD's adduser. This patch hasn't been tested, but the changes are all relatively minor and should be correct. If someone could review & possibly commit, would be appreciated. Corrects: - grammar/spelling - correct initing of hashes (they were not being inited, scalars with the same names were) - optimization of file checking (eliminates multiple stat calls) - removal of unused variables - initializing $last before using it (just something I noticed when running with -w ) - removal of copyright sub (it is a null function, does nothing) - fix another misnamed variable ($verb -> $verbose) - flock goes before close, can't flock a closed handle - fix config_read's handling of $opt (it was taking a one element slice of the array, which means that if the -noconfig option was passed as the second or later option, it would not be detected even though it should have been.) Enjoy, -b --- adduser.perl.orig Fri Sep 7 16:05:14 2001 +++ adduser.perl Fri Sep 7 16:11:08 2001 @@ -62,9 +62,9 @@ # global variables # passwd - $username = ''; # $username{username} = uid - $uid = ''; # $uid{uid} = username - $pwgid = ''; # $pwgid{pwgid} = username; gid from passwd db + %username = (); # $username{username} = uid + %uid = (); # $uid{uid} = username + %pwgid = (); # $pwgid{pwgid} = username; gid from passwd db $password = ''; # password for new users $usepassword = ''; # use password-based auth @@ -72,13 +72,13 @@ $enableaccount = ''; # enable or disable account password at creation # group - $groupname =''; # $groupname{groupname} = gid - $groupmembers = ''; # $groupmembers{gid} = members of group/kommalist - $gid = ''; # $gid{gid} = groupname; gid form group db + %groupname = (); # $groupname{groupname} = gid + %groupmembers = (); # $groupmembers{gid} = members of group/kommalist + %gid = (); # $gid{gid} = groupname; gid form group db @group_comments; # Comments in the group file # shell - $shell = ''; # $shell{`basename sh`} = sh + %shell = (); # $shell{`basename sh`} = sh umask 022; # don't give login group write access @@ -96,7 +96,7 @@ local($err) = 0; print "Check $etc_shells\n" if $verbose; - open(S, $etc_shells) || die "$etc_shells:$!\n"; + open(S, $etc_shells) || die "$etc_shells: $!\n"; while() { if (/^\s*\//) { @@ -203,7 +203,7 @@ $h = &stripdir($h); # all right (I hope) - return $h if $h =~ "^/" && -e $h && -w $h && (-d $h || -l $h); + return $h if $h =~ "^/" && -e $h && -w _ && (-d _ || -l $h); # Errors or todo if ($h !~ "^/") { @@ -232,7 +232,7 @@ # read /etc/passwd sub passwd_read { - local($p_username, $pw, $p_uid, $p_gid, $sh, %shlist); + local($p_username, $pw, $p_uid, $p_gid, $sh); print "Check $etc_passwd\n" if $verbose; open(P, "$etc_passwd") || die "$etc_passwd: $!\n"; @@ -328,7 +328,7 @@ local($name) = @_; if ($name !~ /^[a-z0-9_][a-z0-9_\-]*$/ || $name eq "a-z0-9_-") { - warn "Wrong username. " . + warn "Illegal username. " . "Please use only lowercase characters or digits\a\n"; return 0; } elsif ($username{$name}) { @@ -878,7 +878,7 @@ # uniq(1) sub uniq { local(@list) = @_; - local($e, $last, @array); + local($e, $last = "", @array); foreach $e (sort @list) { push(@array, $e) unless $e eq $last; @@ -905,12 +905,6 @@ return $salt; } - -# print banner -sub copyright { - return; -} - # hints sub hints { if ($verbose) { @@ -972,7 +966,7 @@ # return 1 if $file is a readable file or link sub filetest { - local($file, $verb) = @_; + local($file, $verbose) = @_; if (-e $file) { if (-f $file || -l $file) { @@ -1314,9 +1308,9 @@ unless &confirm_yn("Try again?", "yes"); } print F join("\n", @list) . "\n"; - close F; print "Unlock $file.\n" if $verbose > 1; flock(F, $LOCK_UN); + close F; } # return free uid+gid @@ -1338,7 +1332,7 @@ $gid_start = $groupname{$group}; } # gid is in use, looking for another gid. - # Note: uid an gid are not equal + # Note: uid and gid are not equal elsif ($gid{$uid_start}) { while($gid{$gid_start} || $uid{$gid_start}) { $gid_start--; @@ -1350,7 +1344,7 @@ # read config file sub config_read { - local($opt) = @_; + local($opt) = join " ", @_; local($user_flag) = 0; # don't read config file @@ -1486,7 +1480,7 @@ &parse_arguments(@ARGV); # parse arguments if (!$check_only) { - ©right; &hints; + &hints; } # check To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Sep 13 14:51:53 2001 Delivered-To: freebsd-audit@freebsd.org Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.162.213]) by hub.freebsd.org (Postfix) with ESMTP id D1BBE37B406 for ; Thu, 13 Sep 2001 14:51:49 -0700 (PDT) Received: from dagger.cc.vt.edu (IDENT:mirapoint@dagger.cc.vt.edu [198.82.161.182]) by lennier.cc.vt.edu (8.11.4/8.11.4) with ESMTP id f8DLpmE484488; Thu, 13 Sep 2001 17:51:48 -0400 (EDT) Received: from enterprise.muriel.penguinpowered.com (hc652647d.dhcp.vt.edu [198.82.100.125]) by dagger.cc.vt.edu (Mirapoint) with ESMTP id AEU00924; Thu, 13 Sep 2001 17:46:33 -0400 (EDT) Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.5.0.FreeBSD:20010913174400:420=_"; micalg=pgp-md5; protocol="application/pgp-signature" In-Reply-To: <20010913130145.L1855@basm.cerias.purdue.edu> Date: Thu, 13 Sep 2001 17:44:00 -0400 (EDT) From: Mike Heffner To: Brian Poole Subject: RE: Cleanup in adduser.perl Cc: freebsd-audit@FreeBSD.ORG Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format --_=XFMail.1.5.0.FreeBSD:20010913174400:420=_ Content-Type: text/plain; charset=us-ascii On 13-Sep-2001 Brian Poole wrote: | Hello, | | Cleaned up many similar problems in OpenBSD's adduser which was | originally from Free, decided to mirror the changes where | possible in FreeBSD's adduser. This patch hasn't been tested, | but the changes are all relatively minor and should be correct. | | If someone could review & possibly commit, would be appreciated. | It looks pretty good, however I'm not too Perl knowledgeable, so I can't say for sure. While on the subject of adduser, I've had the following similar patch to a local admin script here for awhile. The patch adds '.' and '/' to the salt string, and makes it match that in src/usr.bin/passwd/local_passwd.c and crypt(3). Is there any negative effect of the following? Index: adduser.perl =================================================================== RCS file: /home/ncvs/src/usr.sbin/adduser/adduser.perl,v retrieving revision 1.49 diff -u -r1.49 adduser.perl --- adduser.perl 2001/09/06 12:21:21 1.49 +++ adduser.perl 2001/09/13 21:33:35 @@ -891,7 +891,7 @@ sub salt { local($salt); # initialization local($i, $rand); - local(@itoa64) = ( '0' .. '9', 'a' .. 'z', 'A' .. 'Z' ); # 0 .. 63 + local(@itoa64) = ( '.', '/', '0' .. '9', 'A' .. 'Z', 'a' .. 'z' ); # 0..63 warn "calculate salt\n" if $verbose > 1; # to64 Mike -- Mike Heffner Blacksburg, VA --_=XFMail.1.5.0.FreeBSD:20010913174400:420=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7oSifFokZQs3sv5kRAuqqAJ0WqQBjdYYdCRi57FbV94drziZL2gCfbTTe 880JVWfV/ZVJc5GABJJKWlI= =Ve8u -----END PGP SIGNATURE----- --_=XFMail.1.5.0.FreeBSD:20010913174400:420=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Thu Sep 13 21: 8:51 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 A257B37B406 for ; Thu, 13 Sep 2001 21:08:46 -0700 (PDT) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f8E48Z511346 for ; Fri, 14 Sep 2001 00:08:36 -0400 (EDT) (envelope-from arr@watson.org) Date: Fri, 14 Sep 2001 00:08:35 -0400 (EDT) From: "Andrew R. Reiter" To: freebsd-audit@freebsd.org Subject: dungeon master patch Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-161585195-1000440515=:11262" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-161585195-1000440515=:11262 Content-Type: TEXT/PLAIN; charset=US-ASCII hey, I just started to go through -current (seemingly on default) s{g,u}id bins and their source for security vulns. I found a few definet coding problems in dungeon master (setgid games ;-)), however, since you can't specify the config file, they are probably non-exploitable. but, hey, it's being installed setgid (even if it is games), might as well use good coding practice. the patch is attached, and also can be found at: http://www.watson.org/~arr/fbsd-audit/games/dm/dm.c.diff cheers, andrew *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead --0-161585195-1000440515=:11262 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="dm.c.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LS0tIGRtLmMub3JpZwlUaHUgU2VwIDEzIDIyOjQ0OjI1IDIwMDENCisrKyBk bS5jCVRodSBTZXAgMTMgMjM6MDI6NDMgMjAwMQ0KQEAgLTExMSwxNSArMTEx LDE2IEBADQogcGxheShhcmdzKQ0KIAljaGFyICoqYXJnczsNCiB7DQotCWNo YXIgcGJ1ZltNQVhQQVRITEVOXTsNCisJY2hhciBwYnVmW01BWFBBVEhMRU4r MV07DQogDQotCWlm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gIHN0cmNhc2VjbXAo ZjEsICJ0aW1lIikpDQorCQkJaWYgKHNzY2FuZihsYnVmLCAiJTM5cyUzOXMl MzlzJTM5cyIsIA0KKwkJCSAgICBmMSwgZjIsIGYzLCBmNCkgIT0gNCB8fCBz dHJjYXNlY21wKGYxLCAidGltZSIpKQ0KIAkJCQlicmVhazsNCiAJCQljX2Rh eShmMiwgZjMsIGY0KTsNCiAJCX0NCisJCWJ6ZXJvKCZsYnVmLCBzaXplb2Yo bGJ1ZikpOw0KKwl9DQogCSh2b2lkKWZjbG9zZShjZnApOw0KIH0NCiANCg== --0-161585195-1000440515=:11262-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Sep 14 2:16:41 2001 Delivered-To: freebsd-audit@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 3C89537B407 for ; Fri, 14 Sep 2001 02:16:37 -0700 (PDT) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id LAA29139; Fri, 14 Sep 2001 11:16:27 +0200 (CEST) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: "Andrew R. Reiter" Cc: freebsd-audit@FreeBSD.ORG Subject: Re: dungeon master patch References: From: Dag-Erling Smorgrav Date: 14 Sep 2001 11:16:26 +0200 In-Reply-To: Message-ID: Lines: 43 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "Andrew R. Reiter" writes: > --- dm.c.orig Thu Sep 13 22:44:25 2001 > +++ dm.c Thu Sep 13 23:02:43 2001 > @@ -111,15 +111,16 @@ > play(args) > char **args; > { > - char pbuf[MAXPATHLEN]; > + char pbuf[MAXPATHLEN+1]; The "+1" is incorrect, and PATH_MAX misspelled MAXPATHLEN. > - if (sizeof(_PATH_HIDE) + strlen(game) > sizeof(pbuf)) { > + if (sizeof(_PATH_HIDE) + strlen(game) + 1 > sizeof(pbuf)) { > (void)fprintf(stderr, "dm: %s/%s: %s\n", _PATH_HIDE, game, > strerror(ENAMETOOLONG)); > exit(1); > } No +1 is needed. > - (void)strcpy(pbuf, _PATH_HIDE); > - (void)strcpy(pbuf + sizeof(_PATH_HIDE) - 1, game); > + bzero((void *)&pbuf, MAXPATHLEN+1); > + strlcpy(pbuf, _PATH_HIDE, sizeof(pbuf)); > + strlcat(pbuf+strlen(_PATH_HIDE), game, sizeof(pbuf)-strlen(_PATH_HIDE)); Replace bzero(), strlcpy() and strlcat() with snprintf(). > - if (sscanf(lbuf, "%s%s", f1, f2) != 2 || > + if (sscanf(lbuf, "%39s%39s", f1, f2) != 2 || > strcasecmp(f1, "badtty")) The return value from strcmp() and friends should always be explicitly compared to 0. Someone[tm] should write an snscanf() function that allows the length of the line to be specified so it can be used in conjunction with fgetln(). DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Sep 14 2:27:20 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 E78B737B411 for ; Fri, 14 Sep 2001 02:27:01 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f8E9QEV02656; Fri, 14 Sep 2001 12:26:14 +0300 (EEST) (envelope-from ru) Date: Fri, 14 Sep 2001 12:26:14 +0300 From: Ruslan Ermilov To: "Andrew R. Reiter" Cc: freebsd-audit@FreeBSD.ORG Subject: Re: dungeon master patch Message-ID: <20010914122614.A82568@sunbay.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from arr@watson.org on Fri, Sep 14, 2001 at 12:08:35AM -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, Sep 14, 2001 at 12:08:35AM -0400, Andrew R. Reiter wrote: > hey, > > I just started to go through -current (seemingly on default) s{g,u}id bins > and their source for security vulns. I found a few definet coding > problems in dungeon master (setgid games ;-)), however, since you can't > specify the config file, they are probably non-exploitable. but, hey, > it's being installed setgid (even if it is games), might as well use good > coding practice. > > the patch is attached, and also can be found at: > At a quick glance. > --- dm.c.orig Thu Sep 13 22:44:25 2001 > +++ dm.c Thu Sep 13 23:02:43 2001 > @@ -111,15 +111,16 @@ > play(args) > char **args; > { > - char pbuf[MAXPATHLEN]; > + char pbuf[MAXPATHLEN+1]; > Err, the correct value is MAXPATHLEN. Search intro(2) for more details. > - if (sizeof(_PATH_HIDE) + strlen(game) > sizeof(pbuf)) { > + if (sizeof(_PATH_HIDE) + strlen(game) + 1 > sizeof(pbuf)) { Err, sizeof("foo") is 4, not 3. Hence the space for final '\0' is already accumulated with sizeof(_PATH_HIDE). > (void)fprintf(stderr, "dm: %s/%s: %s\n", _PATH_HIDE, game, > strerror(ENAMETOOLONG)); > exit(1); > } > - (void)strcpy(pbuf, _PATH_HIDE); > - (void)strcpy(pbuf + sizeof(_PATH_HIDE) - 1, game); > + bzero((void *)&pbuf, MAXPATHLEN+1); > + strlcpy(pbuf, _PATH_HIDE, sizeof(pbuf)); > + strlcat(pbuf+strlen(_PATH_HIDE), game, sizeof(pbuf)-strlen(_PATH_HIDE)); There was nothing wrong with this. > if (priority > 0) /* < 0 requires root */ > (void)setpriority(PRIO_PROCESS, 0, priority); > execv(pbuf, args); > @@ -135,30 +136,37 @@ > read_config() > { > FILE *cfp; > - char lbuf[BUFSIZ], f1[40], f2[40], f3[40], f4[40], f5[40]; > + char lbuf[BUFSIZ+1], f1[40], f2[40], f3[40], f4[40], f5[40]; > > if (!(cfp = fopen(_PATH_CONFIG, "r"))) > return; > - while (fgets(lbuf, sizeof(lbuf), cfp)) > + while (fgets(lbuf, sizeof(lbuf)-1, cfp)) { The fgets() function reads at most one less than the number of characters specified by size from the given stream and stores them in the string str. > + bzero(&f1, sizeof(f1)); > + bzero(&f2, sizeof(f2)); > + bzero(&f3, sizeof(f3)); > + bzero(&f4, sizeof(f4)); > + bzero(&f5, sizeof(f5)); Umm, sscanf(3) places a trailing NUL character: : s Matches a sequence of non-white-space characters; the next pointer : must be a pointer to char, and the array must be large enough to : accept all the sequence and the terminating NUL character. The : input string stops at white space or at the maximum field width, : whichever occurs first. > switch(*lbuf) { > case 'b': /* badtty */ > - if (sscanf(lbuf, "%s%s", f1, f2) != 2 || > + if (sscanf(lbuf, "%39s%39s", f1, f2) != 2 || Use "%.s" and "sizeof(f1) - 1", don't hardcode. > strcasecmp(f1, "badtty")) > break; > c_tty(f2); > break; > case 'g': /* game */ > - if (sscanf(lbuf, "%s%s%s%s%s", > + if (sscanf(lbuf, "%39s%39s%39s%39s%39s", > f1, f2, f3, f4, f5) != 5 || strcasecmp(f1, "game")) > break; > c_game(f2, f3, f4, f5); > break; > case 't': /* time */ > - if (sscanf(lbuf, "%s%s%s%s", f1, f2, f3, f4) != 4 || > - strcasecmp(f1, "time")) > + if (sscanf(lbuf, "%39s%39s%39s%39s", > + f1, f2, f3, f4) != 4 || strcasecmp(f1, "time")) > break; > c_day(f2, f3, f4); > } > + bzero(&lbuf, sizeof(lbuf)); > + } > (void)fclose(cfp); > } > -- 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 Sep 14 2:35:33 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 2A0CD37B406 for ; Fri, 14 Sep 2001 02:35:20 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f8E9YsB03688; Fri, 14 Sep 2001 12:34:54 +0300 (EEST) (envelope-from ru) Date: Fri, 14 Sep 2001 12:34:54 +0300 From: Ruslan Ermilov To: "Andrew R. Reiter" Cc: freebsd-audit@FreeBSD.ORG Subject: Re: dungeon master patch Message-ID: <20010914123454.B82568@sunbay.com> References: <20010914122614.A82568@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: <20010914122614.A82568@sunbay.com>; from ru@FreeBSD.org on Fri, Sep 14, 2001 at 12:26:14PM +0300 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Sep 14, 2001 at 12:26:14PM +0300, Ruslan Ermilov wrote: [...] > > switch(*lbuf) { > > case 'b': /* badtty */ > > - if (sscanf(lbuf, "%s%s", f1, f2) != 2 || > > + if (sscanf(lbuf, "%39s%39s", f1, f2) != 2 || > > Use "%.s" and "sizeof(f1) - 1", don't hardcode. > Ahh, this isn't the printf(3), sorry. -- 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 Sep 14 4:55:26 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 81AF537B414 for ; Fri, 14 Sep 2001 04:55:17 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id VAA05333; Fri, 14 Sep 2001 21:54:51 +1000 Date: Fri, 14 Sep 2001 21:54:28 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mark Murray Cc: Subject: Re: WARNS=2 cleanup for lex and yacc In-Reply-To: <200109121934.f8CJY6u89490@grimreaper.grondar.za> Message-ID: <20010914211123.O18340-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 12 Sep 2001, Mark Murray wrote: > Please review > Index: lex/Makefile > ... Lex is gnu flex so it shouldn't be maintained by FreeBSD. > ... > Index: yacc/Makefile > =================================================================== > RCS file: /home/ncvs/src/usr.bin/yacc/Makefile,v > retrieving revision 1.10 > diff -u -d -r1.10 Makefile > --- yacc/Makefile 7 Apr 2001 11:21:26 -0000 1.10 > +++ yacc/Makefile 12 Sep 2001 14:20:53 -0000 > @@ -8,5 +8,6 @@ > MAN= yacc.1 yyfix.1 > LINKS= ${BINDIR}/yacc ${BINDIR}/byacc > MLINKS= yacc.1 byacc.1 > +WARNS?= 2 Don't blindly add to the end of sorted lists. Definitions in Makefiles are mostly sorted in the order in which they are used in the build, and this Makefile was no exception. (WARNS goes after CFLAGS which goes after SRCS.) > Index: yacc/defs.h > ... > Index: yacc/error.c > ... OK > Index: yacc/lalr.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/yacc/lalr.c,v > retrieving revision 1.7 > diff -u -d -r1.7 lalr.c > --- yacc/lalr.c 28 Aug 1999 01:07:59 -0000 1.7 > +++ yacc/lalr.c 12 Sep 2001 14:26:19 -0000 > @@ -415,7 +415,7 @@ > register shifts *sp; > register int length; > register int nedges; > - register int done; > + register int isdone; Might shadow something in someday, though not currently invalid since is not included. Maybe rename it to done1. > ... > Index: yacc/lr0.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/yacc/lr0.c,v > retrieving revision 1.6 > diff -u -d -r1.6 lr0.c > --- yacc/lr0.c 28 Aug 1999 01:08:00 -0000 1.6 > +++ yacc/lr0.c 12 Sep 2001 14:28:04 -0000 > @@ -611,7 +611,7 @@ > { > register int i, j; > register int empty; > - int done; > + int isdone; As above. > ... > Index: yacc/main.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/yacc/main.c,v > retrieving revision 1.12 > diff -u -d -r1.12 main.c > --- yacc/main.c 10 Jan 2000 20:26:24 -0000 1.12 > +++ yacc/main.c 12 Sep 2001 14:40:50 -0000 > @@ -60,9 +60,9 @@ > char tflag; > char vflag; > > -char *symbol_prefix; > -char *file_prefix = "y"; > -char *temp_form = "yacc.XXXXXXXXXXX"; > +const char *symbol_prefix; > +const char *file_prefix = "y"; > +const char *temp_form = "yacc.XXXXXXXXXXX"; Use an array for things like this. > ... > Index: yacc/output.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/yacc/output.c,v > retrieving revision 1.15 > diff -u -d -r1.15 output.c > --- yacc/output.c 26 Nov 2000 11:07:45 -0000 1.15 > +++ yacc/output.c 12 Sep 2001 14:45:30 -0000 > @@ -954,6 +954,7 @@ > { > register int i, j, k, max; > char **symnam, *s; > + static char eof[]="end-of-file"; Missing spaces. > ... > Index: yacc/reader.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/yacc/reader.c,v > retrieving revision 1.9 > diff -u -d -r1.9 reader.c > --- yacc/reader.c 26 Nov 2000 11:07:45 -0000 1.9 > +++ yacc/reader.c 12 Sep 2001 14:48:42 -0000 > @@ -113,6 +113,7 @@ > static void read_grammar __P((void)); > static void skip_comment __P((void)); > static void start_rule __P((bucket *, int)); > +static void declare_expect __P((int)); Don't blindly add to the end of sorted lists! > @@ -1818,7 +1819,7 @@ > pack_grammar() > { > register int i, j; > - int assoc, prec; > + int assoc, pre; Rename it something like "preced". > ... > Index: yacc/skeleton.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/yacc/skeleton.c,v > retrieving revision 1.29 > diff -u -d -r1.29 skeleton.c > --- yacc/skeleton.c 19 Feb 2001 01:10:01 -0000 1.29 > +++ yacc/skeleton.c 12 Sep 2001 15:47:52 -0000 > ... > @@ -128,10 +128,10 @@ > }; > > > -char *body[] = > +const char *body[] = > { > "/* allocate initial stack or double stack size, up to YYMAXDEPTH */", > - "static int yygrowstack()", > + "static int yygrowstack(void)", > "{", > " int newsize, i;", > " short *newss;", Gratuitous breakage of K&R support. The prototype for yygrowstack() is still correctly ifdefed. > ... > Index: yacc/symtab.c > ... > Index: yacc/verbose.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/yacc/verbose.c,v > retrieving revision 1.6 > diff -u -d -r1.6 verbose.c > --- yacc/verbose.c 28 Aug 1999 01:08:03 -0000 1.6 > +++ yacc/verbose.c 12 Sep 2001 14:59:22 -0000 > @@ -331,9 +331,9 @@ > > > static void > -print_reductions(p, defred) > +print_reductions(p, def) > register action *p; > -register int defred; > +register int def; Rename it something like "defreduct". Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Sep 14 8:30:44 2001 Delivered-To: freebsd-audit@freebsd.org Received: from arb.arb.za.net (arb.arb.za.net [196.7.148.4]) by hub.freebsd.org (Postfix) with ESMTP id 16E7037B40B for ; Fri, 14 Sep 2001 08:30:34 -0700 (PDT) Received: (from uucp@localhost) by arb.arb.za.net (8.11.3/8.11.3) with UUCP id f8EFTne09687; Fri, 14 Sep 2001 17:29:49 +0200 (SAST) (envelope-from mark@grondar.za) Received: from grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.za (8.11.6/8.11.4) with ESMTP id f8EEsPu95327; Fri, 14 Sep 2001 15:54:26 +0100 (BST) (envelope-from mark@grondar.za) Message-Id: <200109141454.f8EEsPu95327@grimreaper.grondar.za> To: Bruce Evans Cc: audit@FreeBSD.ORG Subject: Re: WARNS=2 cleanup for lex and yacc References: <20010914211123.O18340-100000@delplex.bde.org> In-Reply-To: <20010914211123.O18340-100000@delplex.bde.org> ; from Bruce Evans "Fri, 14 Sep 2001 21:54:28 +1000." Date: Fri, 14 Sep 2001 15:54:25 +0100 From: Mark Murray Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi Thanks for the comments! > On Wed, 12 Sep 2001, Mark Murray wrote: > > > Please review > > > Index: lex/Makefile > > ... > > Lex is gnu flex so it shouldn't be maintained by FreeBSD. Damn. :-(. OK. What lex(1) did CSRG originally use? > > +WARNS?= 2 > > Don't blindly add to the end of sorted lists. Definitions in Makefiles > are mostly sorted in the order in which they are used in the build, and > this Makefile was no exception. (WARNS goes after CFLAGS which goes > after SRCS.) Aaah. I get the order approach. That notwitstanding, I am doing a "WARNS?=2" sweep through _all_ of src/usr.bin/*, and I am removing all the "-Wall"'s and WARNS?=2, on the grounds that a "WARNS?=2" ins src/usr.bin/Makefile.inc will cover that. In the case of src/contrib code or (other)(currently) "difficult" fixes, I am explicitly adding a "WARNS?=[01]". > > Index: yacc/main.c > > =================================================================== > > RCS file: /home/ncvs/src/usr.bin/yacc/main.c,v > > retrieving revision 1.12 > > diff -u -d -r1.12 main.c > > --- yacc/main.c 10 Jan 2000 20:26:24 -0000 1.12 > > +++ yacc/main.c 12 Sep 2001 14:40:50 -0000 > > @@ -60,9 +60,9 @@ > > char tflag; > > char vflag; > > > > -char *symbol_prefix; > > -char *file_prefix = "y"; > > -char *temp_form = "yacc.XXXXXXXXXXX"; > > +const char *symbol_prefix; > > +const char *file_prefix = "y"; > > +const char *temp_form = "yacc.XXXXXXXXXXX"; > > Use an array for things like this. I wish I could :-(. These pointers have something else assigned to them later. M -- o Mark Murray \_ FreeBSD Services Limited O.\_ Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Sep 14 8:56:23 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 B6DF837B40D; Fri, 14 Sep 2001 08:55:33 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f8EFro955889; Fri, 14 Sep 2001 18:53:50 +0300 (EEST) (envelope-from ru) Date: Fri, 14 Sep 2001 18:53:50 +0300 From: Ruslan Ermilov To: Bruce Evans Cc: Mike Barcroft , audit@FreeBSD.ORG Subject: Re: cmp(1) warns patch Message-ID: <20010914185350.B52001@sunbay.com> References: <20010804144439.A8069@coffee.q9media.com> <20010805235106.Y27651-100000@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010805235106.Y27651-100000@besplex.bde.org>; from bde@zeta.org.au on Mon, Aug 06, 2001 at 12:16:56AM +1000 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Aug 06, 2001 at 12:16:56AM +1000, Bruce Evans wrote: > On Sat, 4 Aug 2001, Mike Barcroft wrote: > > > On Sat, Aug 04, 2001 at 12:59:56PM +1000, Bruce Evans wrote: > > > On Fri, 3 Aug 2001, Mike Barcroft wrote: > > > > ... > > > > Index: cmp/regular.c > > > > =================================================================== > > > > RCS file: /home/ncvs/src/usr.bin/cmp/regular.c,v > > > > retrieving revision 1.10 > > > > diff -u -r1.10 regular.c > > > > --- cmp/regular.c 2000/06/20 20:28:40 1.10 > > > > +++ cmp/regular.c 2001/08/04 01:02:33 > > > > ... > > > > @@ -81,7 +81,7 @@ > > > > off2 = ROUNDPAGE(skip2); > > > > > > > > length = MIN(len1, len2); > > > > - if (length > SIZE_T_MAX) > > > > + if (length > (off_t)SIZE_T_MAX) > > > > > > This is broken on many machines, including alphas. On alphas, > > > (off_t)SIZE_MAX overflows to -1, so `length' is always larger and the > > > pessimized cspecial() method is always used. > > ... > > I guess I should have looked at the types a little more closely. Do > > you have any suggestions for overcoming the comparison between signed > > and unsigned warning on alpha? > > None very good. In general, the signed type must be promoted to a suitable > unsigned type, but to do that you have to know too much about the signed > type if that type is a typedefed type. Here we can't do anything better > than promote to "unsigned long long". This assumes that "unsigned long > long" can represent all possible file sizes. In the kernel, we could use > uoff_t. I introduced uoff_t because promoting off_t's to an unsigned type > is useful in other contexts. > It would be great if we had the "largest [un]signed int type" typedef'ed somehow to make such conversions possible. 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 Sep 14 10:24:13 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id D28C237B407 for ; Fri, 14 Sep 2001 10:24:09 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id DAA21690; Sat, 15 Sep 2001 03:23:28 +1000 Date: Sat, 15 Sep 2001 03:23:03 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mark Murray Cc: Subject: Re: WARNS=2 cleanup for lex and yacc In-Reply-To: <200109141454.f8EEsPu95327@grimreaper.grondar.za> Message-ID: <20010915031508.C20847-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 14 Sep 2001, Mark Murray wrote: > > Lex is gnu flex so it shouldn't be maintained by FreeBSD. > > Damn. :-(. OK. What lex(1) did CSRG originally use? Lite2, at least, seems to have only contrib/flex-2.5.2. > > > Index: yacc/main.c > > > =================================================================== > > > RCS file: /home/ncvs/src/usr.bin/yacc/main.c,v > > > retrieving revision 1.12 > > > diff -u -d -r1.12 main.c > > > --- yacc/main.c 10 Jan 2000 20:26:24 -0000 1.12 > > > +++ yacc/main.c 12 Sep 2001 14:40:50 -0000 > > > @@ -60,9 +60,9 @@ > > > char tflag; > > > char vflag; > > > > > > -char *symbol_prefix; > > > -char *file_prefix = "y"; > > > -char *temp_form = "yacc.XXXXXXXXXXX"; > > > +const char *symbol_prefix; > > > +const char *file_prefix = "y"; > > > +const char *temp_form = "yacc.XXXXXXXXXXX"; > > > > Use an array for things like this. > > I wish I could :-(. These pointers have something else assigned to them > later. Oops. Make that "This pointer" (temp_form). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Sep 14 11:53:47 2001 Delivered-To: freebsd-audit@freebsd.org Received: from front2.chartermi.net (24.213.60.124.up.mi.chartermi.net [24.213.60.124]) by hub.freebsd.org (Postfix) with ESMTP id 3E77D37B407 for ; Fri, 14 Sep 2001 11:53:45 -0700 (PDT) Received: from [24.247.81.122] (HELO rain.hill.hom) by front2.chartermi.net (CommuniGate Pro SMTP 3.5b2) with SMTP id 18507911 for audit@freebsd.org; Fri, 14 Sep 2001 14:53:44 -0400 Date: Fri, 14 Sep 2001 14:52:17 -0400 From: David Hill To: audit@freebsd.org Subject: documentation for inet_aton Message-Id: <20010914145217.03fbec79.david@phobia.ms> X-Mailer: Sylpheed version 0.6.1 (GTK+ 1.2.10; i386--freebsd5.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello - While reading my Network Programming book by Stevens, on page 71 says I can pass NULL instead of struct in_addr to just perform a validation on the input string. I noticed this was not in inet_aton(3). Would it be a waste to document this feature in the man page? - David To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Sep 14 12: 3:34 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 6920237B403; Fri, 14 Sep 2001 12:03:28 -0700 (PDT) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f8EJ3HB20191; Fri, 14 Sep 2001 15:03:17 -0400 (EDT) (envelope-from arr@watson.org) Date: Fri, 14 Sep 2001 15:03:17 -0400 (EDT) From: "Andrew R. Reiter" To: Ruslan Ermilov Cc: freebsd-audit@FreeBSD.ORG Subject: Re: dungeon master patch In-Reply-To: <20010914123454.B82568@sunbay.com> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1352907239-1000494197=:20183" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1352907239-1000494197=:20183 Content-Type: TEXT/PLAIN; charset=US-ASCII new patch -- only adds %39's Andrew *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead --0-1352907239-1000494197=:20183 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="dm.c.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LS0tIGRtLmMub3JpZwlGcmkgU2VwIDE0IDE0OjAwOjEyIDIwMDENCisrKyBk bS5jCUZyaSBTZXAgMTQgMTQ6MDM6MDcgMjAwMQ0KQEAgLTE0MiwyMCArMTQy LDIwIEBADQogCXdoaWxlIChmZ2V0cyhsYnVmLCBzaXplb2YobGJ1ZiksIGNm cCkpDQogCQlzd2l0Y2goKmxidWYpIHsNCiAJCWNhc2UgJ2InOgkJLyogYmFk dHR5ICovDQotCQkJaWYgKHNzY2FuZihsYnVmLCAiJXMlcyIsIGYxLCBmMikg IT0gMiB8fA0KKwkJCWlmIChzc2NhbmYobGJ1ZiwgIiUzOXMlMzlzIiwgZjEs IGYyKSAhPSAyIHx8DQogCQkJICAgIHN0cmNhc2VjbXAoZjEsICJiYWR0dHki KSkNCiAJCQkJYnJlYWs7DQogCQkJY190dHkoZjIpOw0KIAkJCWJyZWFrOw0K IAkJY2FzZSAnZyc6CQkvKiBnYW1lICovDQotCQkJaWYgKHNzY2FuZihsYnVm LCAiJXMlcyVzJXMlcyIsDQorCQkJaWYgKHNzY2FuZihsYnVmLCAiJTM5cyUz OXMlMzlzJTM5cyUzOXMiLA0KIAkJCSAgICBmMSwgZjIsIGYzLCBmNCwgZjUp ICE9IDUgfHwgc3RyY2FzZWNtcChmMSwgImdhbWUiKSkNCiAJCQkJYnJlYWs7 DQogCQkJY19nYW1lKGYyLCBmMywgZjQsIGY1KTsNCiAJCQlicmVhazsNCiAJ CWNhc2UgJ3QnOgkJLyogdGltZSAqLw0KLQkJCWlmIChzc2NhbmYobGJ1Ziwg IiVzJXMlcyVzIiwgZjEsIGYyLCBmMywgZjQpICE9IDQgfHwNCi0JCQkgICAg c3RyY2FzZWNtcChmMSwgInRpbWUiKSkNCisJCQlpZiAoc3NjYW5mKGxidWYs ICIlMzlzJTM5cyUzOXMlMzlzIiwgDQorCQkgCSAgICBmMSwgZjIsIGYzLCBm NCkgIT0gNCB8fCBzdHJjYXNlY21wKGYxLCAidGltZSIpKQ0KIAkJCQlicmVh azsNCiAJCQljX2RheShmMiwgZjMsIGY0KTsNCiAJCX0NCg== --0-1352907239-1000494197=:20183-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Sep 14 12:10:40 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id E462237B412; Fri, 14 Sep 2001 12:10:37 -0700 (PDT) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.3) id f8EJEMd32165; Fri, 14 Sep 2001 15:14:22 -0400 (EDT) (envelope-from mike) Date: Fri, 14 Sep 2001 15:14:22 -0400 From: Mike Barcroft To: Ruslan Ermilov Cc: Bruce Evans , audit@FreeBSD.ORG Subject: Re: cmp(1) warns patch Message-ID: <20010914151422.B31975@coffee.q9media.com> Mail-Followup-To: Mike Barcroft , Ruslan Ermilov , Bruce Evans , audit@FreeBSD.ORG References: <20010804144439.A8069@coffee.q9media.com> <20010805235106.Y27651-100000@besplex.bde.org> <20010914185350.B52001@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: <20010914185350.B52001@sunbay.com>; from ru@FreeBSD.ORG on Fri, Sep 14, 2001 at 06:53:50PM +0300 Organization: The 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 Ruslan Ermilov writes: > It would be great if we had the "largest [un]signed int type" typedef'ed > somehow to make such conversions possible. Yes, C99 has the intmax_t type available. I had intended to work on bringing in some of the C99 work from NetBSD, but David had asked me to hold off until GCC 3 was in the tree. Since he is no longer maintaining GCC, this would probably be a good time for me to start working on the patchset again. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Sep 14 18:19:29 2001 Delivered-To: freebsd-audit@freebsd.org Received: from enigma.jaded.net (enigma.jaded.net [216.94.132.9]) by hub.freebsd.org (Postfix) with ESMTP id 78A9237B412 for ; Fri, 14 Sep 2001 18:19:18 -0700 (PDT) Received: from spirit.jaded.net (unknown [24.141.6.76]) by enigma.jaded.net (Postfix) with ESMTP id DCB5366B04; Fri, 14 Sep 2001 21:19:21 -0400 (EDT) Received: (from dan@localhost) by spirit.jaded.net (8.11.6/8.11.4) id f8F1IY616558; Fri, 14 Sep 2001 21:18:34 -0400 (EDT) (envelope-from dan) Date: Fri, 14 Sep 2001 21:18:34 -0400 From: Dan Moschuk To: David Hill Cc: audit@FreeBSD.ORG Subject: Re: documentation for inet_aton Message-ID: <20010914211834.A14919@spirit.jaded.net> References: <20010914145217.03fbec79.david@phobia.ms> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010914145217.03fbec79.david@phobia.ms>; from david@phobia.ms on Fri, Sep 14, 2001 at 02:52:17PM -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 | | While reading my Network Programming book by Stevens, on page 71 says I can pass NULL instead of struct in_addr to just perform a validation on the input string. | | I noticed this was not in inet_aton(3). Would it be a waste to document this feature in the man page? If it indeed works, I can't see why you wouldn't want to document it in the man page. -Dan -- rm -f /bin/laden To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Sep 14 20:59:44 2001 Delivered-To: freebsd-audit@freebsd.org Received: from Veronica.wmol.com (veronica.wmol.com [208.242.83.241]) by hub.freebsd.org (Postfix) with ESMTP id 9957037B407 for ; Fri, 14 Sep 2001 20:59:42 -0700 (PDT) Received: from rain (24.247.81.122.bay.mi.chartermi.net [24.247.81.122]) by Veronica.wmol.com (Vircom SMTPRS 5.0.193) with ESMTP id for ; Fri, 14 Sep 2001 23:57:15 -0400 Message-ID: <005901c13d9a$a2dc77a0$0201a8c0@hill.hom> From: "David Hill" To: Subject: posix and C99 Date: Fri, 14 Sep 2001 23:58:09 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 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 Hello - Does FreeBSD keep up with C99 and POSIX 1.g standards? There are functions in each that are not implemented in FreeBSD. - David To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Sep 14 22:41: 7 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id CB20637B40C for ; Fri, 14 Sep 2001 22:41:04 -0700 (PDT) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.3) id f8F5irS33196; Sat, 15 Sep 2001 01:44:53 -0400 (EDT) (envelope-from mike) Date: Sat, 15 Sep 2001 01:44:53 -0400 From: Mike Barcroft To: David Hill Cc: audit@FreeBSD.ORG Subject: Re: posix and C99 Message-ID: <20010915014453.A32559@coffee.q9media.com> Mail-Followup-To: Mike Barcroft , David Hill , audit@FreeBSD.ORG References: <005901c13d9a$a2dc77a0$0201a8c0@hill.hom> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <005901c13d9a$a2dc77a0$0201a8c0@hill.hom>; from david@phobia.ms on Fri, Sep 14, 2001 at 11:58:09PM -0400 Organization: The 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 David Hill writes: > Does FreeBSD keep up with C99 and POSIX 1.g standards? There are > functions in each that are not implemented in FreeBSD. It's hard to see why this was posted to -audit, but yes we generally try to be as standards compliant as possible. Patches are welcome. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Sep 15 20:31:57 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 CB3CD37B40A for ; Sat, 15 Sep 2001 20:31:36 -0700 (PDT) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f8G3VPn41563 for ; Sat, 15 Sep 2001 23:31:26 -0400 (EDT) (envelope-from arr@watson.org) Date: Sat, 15 Sep 2001 23:31:25 -0400 (EDT) From: "Andrew R. Reiter" To: freebsd-audit@freebsd.org Subject: sliplogin patches Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1702233122-1000611085=:41506" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1702233122-1000611085=:41506 Content-Type: TEXT/PLAIN; charset=US-ASCII Hey, I was looking at sliplogin() and noticed that the signal handler usage was kinda poor (bad functions in hup_handler()). So I wanted to make patches for it. After getting style 9'd (kinda like slashdotted, but you get beaten up for not fully style(9)'ing something prepatch), i decided to write the style(9) patch for good measure; hopefully it's good :-). So, sliplogin.c.style-diff is the style(9) patch. the security patch is sliplogin.c.sec-diff. this patch fixes the signal race problem in the essence of the kkenn fix in syslogd (mark the signal, check if it's been marked and execute -- to put it very pseudo-like). also, I fixed probably some unnecesary things but thought it should be done for "good measure" -- those are: - moving strncpy() + buf[sizeof-1] = '\0' -> strlcpy() - remove sizeof(blah) - 1 in fgets() where there _shouldn't_ be a -1 (man 3 fgets). anyway, like usual, comments are appreciated and probably needed (slowly becomming style(9)-ful). cheers, Andrew btw -- patches can also be seen at: http://www.watson.org/~arr/fbsd-audit/usr.sbin/sliplogin/ *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead --0-1702233122-1000611085=:41506 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="sliplogin.c.style-diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LS0tIHNsaXBsb2dpbi5jLm9yaWcJU2F0IFNlcCAxNSAyMDo0Njo0NCAyMDAx DQorKysgc2xpcGxvZ2luLmMuMQlTYXQgU2VwIDE1IDIxOjIxOjIyIDIwMDEN CkBAIC05Nyw2ICs5NywxNyBAQA0KIAlOVUxMDQogfTsNCiANCitzdHJ1Y3Qg c2xpcF9tb2RlcyB7DQorCWNoYXIJKnNtX25hbWU7DQorCWludAlzbV9vcl9m bGFnOw0KKwlpbnQJc21fYW5kX2ZsYWc7DQorfSBtb2Rlc1tdID0gew0KKwl7 Im5vcm1hbCIsCTAsCQkwfSwNCisJeyJjb21wcmVzcyIsCUlGRl9MSU5LMCwg CUlGRl9MSU5LMn0sDQorCXsibm9pY21wIiwJSUZGX0xJTksxLCAJMH0sDQor CXsiYXV0b2NvbXAiLAlJRkZfTElOSzIsIAlJRkZfTElOSzB9DQorfTsNCisN CiBpbnQJdW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set=US-ASCII; name="sliplogin.c.sec-diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LS0tIHNsaXBsb2dpbi5jLjEJU2F0IFNlcCAxNSAyMToyMToyMiAyMDAxDQor Kysgc2xpcGxvZ2luLmMJU2F0IFNlcCAxNSAyMjoxOToxNiAyMDAxDQpAQCAt MTI0LDYgKzEyNCw4IEBADQogc3RhdGljIAljaGFyIGlmZmlsZW5hbWVbTUFY UEFUSExFTl07ICAgIC8qIG5hbWUgb2YgaWYgZmlsZSAqLw0KIHN0YXRpYwlw aWRfdAlwaWQ7CQkJLyogb3VyIHBpZCAqLw0KIA0KK3ZvbGF0aWxlIHNpZ19h dG9taWNfdAlzaWdfaHVwOw0KKw0KIGNoYXIgKg0KIG1ha2VfaXBhZGRyKHZv aWQpDQogew0KQEAgLTE1OCwxNSArMTYwLDE0IEBADQogDQogCWVudmlyb24g PSByZXN0cmljdGVkX2Vudmlyb247IC8qIG1pbmltYWwgcHJvdGVjdGlvbiBm b3Igc3lzdGVtKCkgKi8NCiANCi0JKHZvaWQpc3RybmNweShsb2dpbm5hbWUs IG5hbWUsIHNpemVvZihsb2dpbm5hbWUpLTEpOw0KLQlsb2dpbm5hbWVbc2l6 ZW9mKGxvZ2lubmFtZSktMV0gPSAnXDAnOw0KKwkodm9pZClzdHJsY3B5KGxv Z2lubmFtZSwgbmFtZSwgc2l6ZW9mKGxvZ2lubmFtZSkpOw0KIA0KIAlpZiAo KGZwID0gZm9wZW4oX1BBVEhfQUNDRVNTLCAiciIpKSA9PSBOVUxMKSB7DQog CWFjY2ZpbGVfZXJyOg0KIAkJc3lzbG9nKExPR19FUlIsICIlczogJW1cbiIs IF9QQVRIX0FDQ0VTUyk7DQogCQlleGl0KDEpOw0KIAl9DQotCXdoaWxlIChm Z2V0cyhsb2dpbmFyZ3MsIHNpemVvZihsb2dpbmFyZ3MpIC0gMSwgZnApKSB7 DQorCXdoaWxlIChmZ2V0cyhsb2dpbmFyZ3MsIHNpemVvZihsb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vZyhMT0dfRVJSLCAiaW9jdGwoU0xJT0NT S0VFUEFMKTogJW0iKTsNCiAJCQlleGl0KDEpOw0KQEAgLTU0NSw3ICs1NTAs MTAgQEANCiAJLyogcmVzZXQgdWlkIHRvIHVzZXJzJyB0byBhbGxvdyB0aGUg dXNlciB0byBnaXZlIGEgc2lnbmFsLiAqLw0KIAlzZXRldWlkKHVpZCk7DQog CS8qIHR3aWRkbGUgdGh1bWJzIHVudGlsIHdlIGdldCBhIHNpZ25hbCAqLw0K LQl3aGlsZSAoMSkNCisJd2hpbGUgKDEpIHsNCisJCWlmIChzaWdfaHVwKQ0K KwkJCWh1cF9oYW5kbGVyKHNpZ19odXApOw0KIAkJc2lncGF1c2UoMCk7DQor CX0NCiAJLyogTk9UUkVBQ0hFRCAqLw0KIH0NCg== --0-1702233122-1000611085=:41506-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message