Date: Mon, 9 Jul 2001 07:20:04 -0700 (PDT) From: Ruslan Ermilov <ru@FreeBSD.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/28789: /usr/bin/last does not filter for uucp connects Message-ID: <200107091420.f69EK4l70765@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/28789; it has been noted by GNATS.
From: Ruslan Ermilov <ru@FreeBSD.org>
To: wolfgang@lyxys.ka.sub.org
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/28789: /usr/bin/last does not filter for uucp connects
Date: Mon, 9 Jul 2001 17:18:04 +0300
On Sat, Jul 07, 2001 at 12:08:15PM +0200, wolfgang@lyxys.ka.sub.org wrote:
>
> Suggested fix is to introduce a new option "-T ttytype" to
> /usr/bin/last. This option would allow to filter for entries
> with tty name fields starting with the specified string.
>
> Suggested implementation is attached as diff to last.c and last.1,
> I hope it is not garbled by send-pr.
>
An alternate solution would be to add the concept of wildcard tty
match, e.g., ``last -t ftp*'' (modulo the shell expansion).
Index: last.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/last/last.c,v
retrieving revision 1.10.6.2
diff -u -r1.10.6.2 last.c
--- last.c 2001/03/04 08:39:25 1.10.6.2
+++ last.c 2001/07/09 14:11:59
@@ -333,6 +333,7 @@
struct utmp *bp;
{
ARG *step;
+ char *c;
if (!arglist)
return (YES);
@@ -344,7 +345,9 @@
return (YES);
break;
case TTY_TYPE:
- if (!strncmp(step->name, bp->ut_line, UT_LINESIZE))
+ if (!strncmp(step->name, bp->ut_line,
+ (c = strchr(step->name, '*')) != NULL ?
+ c - step->name : UT_LINESIZE))
return (YES);
break;
case USER_TYPE:
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-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107091420.f69EK4l70765>
