From owner-freebsd-stable Mon Sep 6 1:45:25 1999 Delivered-To: freebsd-stable@freebsd.org Received: from relay.ucb.crimea.ua (relay.ucb.crimea.ua [212.110.138.1]) by hub.freebsd.org (Postfix) with ESMTP id AA74E14CC3 for ; Mon, 6 Sep 1999 01:44:01 -0700 (PDT) (envelope-from ru@ucb.crimea.ua) Received: (from ru@localhost) by relay.ucb.crimea.ua (8.9.3/8.9.3/UCB) id JAA15974; Mon, 6 Sep 1999 09:52:46 +0300 (EEST) (envelope-from ru) Date: Mon, 6 Sep 1999 09:52:46 +0300 From: Ruslan Ermilov To: Evren Yurtesen Cc: freebsd-stable@FreeBSD.ORG Subject: Re: finger changed? Message-ID: <19990906095246.A11485@relay.ucb.crimea.ua> Mail-Followup-To: Evren Yurtesen , freebsd-stable@FreeBSD.ORG References: <37D01BA7.F9419E2C@ispro.net.tr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=6c2NcOVqGQ03X4Wi X-Mailer: Mutt 0.95.3i In-Reply-To: <37D01BA7.F9419E2C@ispro.net.tr>; from Evren Yurtesen on Fri, Sep 03, 1999 at 10:04:08PM +0300 X-Operating-System: FreeBSD 3.2-STABLE i386 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii On Fri, Sep 03, 1999 at 10:04:08PM +0300, Evren Yurtesen wrote: > Hello, > I have recently cvsupped 3.2-STABLE and after the make world > the finger command was working differently... > When I search for somebody it was not looking at the real name field > only the username field just like if I was using -m option but the > searches > are made case insensitive... > > What is the problem? I have copied the finger binary from 3.2-RELEASE > and it was working just fine... > > for example in the old one when I search something like > finger daemon > then I was getting 2 entries, now when I search for the same thing > I get only 1 result which was the username daemon > > Evren A typo was introduced in finger/util.c, rev 1.6 (CURRENT) and then imported into RELENG_3 branch in rev 1.5.2.1. The attached patch fixes the problem and will be committed later today. Thanks for the report. Cheers, -- Ruslan Ermilov Sysadmin and DBA of the ru@ucb.crimea.ua United Commercial Bank, ru@FreeBSD.org FreeBSD committer, +380.652.247.647 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: util.c =================================================================== RCS file: /usr/FreeBSD-CVS/src/usr.bin/finger/util.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- util.c 1999/08/21 18:25:38 1.6 +++ util.c 1999/08/22 17:24:25 1.7 @@ -80,7 +80,7 @@ * Why do we skip asterisks!?!? */ (void)strncpy(p = tbuf, pw->pw_gecos, sizeof(tbuf)); - p[sizeof(tbuf) - 1] = '\0'; + tbuf[sizeof(tbuf) - 1] = '\0'; if (*p == '*') ++p; @@ -88,12 +88,13 @@ if ((p = strtok(p, ",")) == NULL) return(0); - for (t = name; (*t = *p) != '\0' && t - name > sizeof(name); ++p) { + for (t = name; t < &name[sizeof(name) - 1] && (*t = *p) != '\0'; ++p) { if (*t == '&') { (void)strncpy(t, pw->pw_name, sizeof(name) - (t - name)); name[sizeof(name) - 1] = '\0'; - while (*++t); + while (t < &name[sizeof(name) - 1] && *++t) + continue; } else { ++t; } @@ -352,21 +353,22 @@ /* why do we skip asterisks!?!? */ (void)strncpy(bp = tbuf, pw->pw_gecos, sizeof(tbuf)); - bp[sizeof(tbuf) - 1] = '\0'; + tbuf[sizeof(tbuf) - 1] = '\0'; if (*bp == '*') ++bp; /* ampersands get replaced by the login name */ if (!(p = strsep(&bp, ","))) return; - for (t = name; (*t = *p) != '\0' && t < name + sizeof(name); ++p) { + for (t = name; t < &name[sizeof(name) - 1] && (*t = *p) != '\0'; ++p) { if (*t == '&') { (void)strncpy(t, pw->pw_name, sizeof(name) - (t - name)); name[sizeof(name) - 1] = '\0'; if (islower(*t)) *t = toupper(*t); - while (*++t); + while (t < &name[sizeof(name) - 1] && *++t) + continue; } else { ++t; } --6c2NcOVqGQ03X4Wi-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message