CVS commit: src/usr.bin/finger
Module Name:src Committed By: kim Date: Thu May 7 13:40:20 UTC 2020 Modified Files: src/usr.bin/finger: finger.1 util.c Log Message: Add lastlogx support To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/usr.bin/finger/finger.1 cvs rdiff -u -r1.29 -r1.30 src/usr.bin/finger/util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/finger.1 diff -u src/usr.bin/finger/finger.1:1.21 src/usr.bin/finger/finger.1:1.22 --- src/usr.bin/finger/finger.1:1.21 Thu Jan 30 23:59:59 2020 +++ src/usr.bin/finger/finger.1 Thu May 7 13:40:20 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: finger.1,v 1.21 2020/01/30 23:59:59 sevan Exp $ +.\" $NetBSD: finger.1,v 1.22 2020/05/07 13:40:20 kim Exp $ .\" .\" Copyright (c) 1989, 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)finger.1 8.3 (Berkeley) 5/5/94 .\" -.Dd January 30, 2020 +.Dd May 7, 2020 .Dt FINGER 1 .Os .Sh NAME @@ -199,9 +199,23 @@ The .Fl l option is the only option that may be passed to a remote machine. .Sh FILES -.Bl -tag -width /var/log/lastlog -compact +.Bl -tag -width /var/log/lastlogx -compact +.It Pa /var/run/utmpx +The +.Nm utmpx +file. +.It Pa /var/log/lastlogx +The +.Nm lastlogx +file. +.It Pa /var/run/utmp +The +.Nm utmp +file. .It Pa /var/log/lastlog -last login data base +The +.Nm lastlog +file. .El .Sh SEE ALSO .Xr chpass 1 , Index: src/usr.bin/finger/util.c diff -u src/usr.bin/finger/util.c:1.29 src/usr.bin/finger/util.c:1.30 --- src/usr.bin/finger/util.c:1.29 Wed Mar 9 16:12:14 2016 +++ src/usr.bin/finger/util.c Thu May 7 13:40:20 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.29 2016/03/09 16:12:14 chs Exp $ */ +/* $NetBSD: util.c,v 1.30 2020/05/07 13:40:20 kim Exp $ */ /* * Copyright (c) 1989, 1993 @@ -72,7 +72,7 @@ #if 0 static char sccsid[] = "@(#)util.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: util.c,v 1.29 2016/03/09 16:12:14 chs Exp $"); +__RCSID("$NetBSD: util.c,v 1.30 2020/05/07 13:40:20 kim Exp $"); #endif #endif /* not lint */ @@ -90,7 +90,6 @@ __RCSID("$NetBSD: util.c,v 1.29 2016/03/ #include #include #include -#include #include "utmpentry.h" @@ -160,15 +159,40 @@ void enter_lastlog(PERSON *pn) { WHERE *w; - static int opened, fd; + static int opened; +#ifdef SUPPORT_UTMPX +# define ll_time ll_tv.tv_sec +# define UT_LINESIZE _UTX_LINESIZE +# define UT_HOSTSIZE _UTX_HOSTSIZE + static DB *lldb = NULL; + DBT key, data; + struct lastlogx ll; +#else + static int fd; struct lastlog ll; +#endif char doit = 0; + (void)memset(&ll, 0, sizeof(ll)); + /* some systems may not maintain lastlog, don't report errors. */ if (!opened) { +#ifdef SUPPORT_UTMPX + lldb = dbopen(_PATH_LASTLOGX, O_RDONLY|O_SHLOCK, 0, DB_HASH, NULL); +#else fd = open(_PATH_LASTLOG, O_RDONLY, 0); +#endif opened = 1; } +#ifdef SUPPORT_UTMPX + if (lldb != NULL) { + key.data = &pn->uid; + key.size = sizeof(pn->uid); + if ((*lldb->get)(lldb, &key, &data, 0) == 0 && + data.size == sizeof(ll)) + (void)memcpy(&ll, data.data, sizeof(ll)); + } +#else if (fd == -1 || lseek(fd, (off_t)pn->uid * sizeof(ll), SEEK_SET) != (off_t)pn->uid * (off_t)sizeof(ll) || @@ -177,6 +201,7 @@ enter_lastlog(PERSON *pn) ll.ll_line[0] = ll.ll_host[0] = '\0'; ll.ll_time = 0; } +#endif if ((w = pn->whead) == NULL) doit = 1; else if (ll.ll_time != 0) {
CVS commit: src/usr.bin/finger
Module Name:src Committed By: sevan Date: Thu Jan 30 23:59:59 UTC 2020 Modified Files: src/usr.bin/finger: finger.1 Log Message: finish with a full stop To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/usr.bin/finger/finger.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/finger.1 diff -u src/usr.bin/finger/finger.1:1.20 src/usr.bin/finger/finger.1:1.21 --- src/usr.bin/finger/finger.1:1.20 Thu Jan 30 23:50:23 2020 +++ src/usr.bin/finger/finger.1 Thu Jan 30 23:59:59 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: finger.1,v 1.20 2020/01/30 23:50:23 sevan Exp $ +.\" $NetBSD: finger.1,v 1.21 2020/01/30 23:59:59 sevan Exp $ .\" .\" Copyright (c) 1989, 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -212,4 +212,4 @@ last login data base The .Nm command appeared in -.Bx 2.0 +.Bx 2.0 .
CVS commit: src/usr.bin/finger
Module Name:src Committed By: sevan Date: Thu Jan 30 23:50:23 UTC 2020 Modified Files: src/usr.bin/finger: finger.1 Log Message: Drop url which is now invalid, see CSRG archive or mirrors on TUHS.org or svnweb.FreeBSD.org To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/usr.bin/finger/finger.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/finger.1 diff -u src/usr.bin/finger/finger.1:1.19 src/usr.bin/finger/finger.1:1.20 --- src/usr.bin/finger/finger.1:1.19 Thu Dec 22 12:39:40 2016 +++ src/usr.bin/finger/finger.1 Thu Jan 30 23:50:23 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: finger.1,v 1.19 2016/12/22 12:39:40 abhinav Exp $ +.\" $NetBSD: finger.1,v 1.20 2020/01/30 23:50:23 sevan Exp $ .\" .\" Copyright (c) 1989, 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)finger.1 8.3 (Berkeley) 5/5/94 .\" -.Dd December 25, 2014 +.Dd January 30, 2020 .Dt FINGER 1 .Os .Sh NAME @@ -212,5 +212,4 @@ last login data base The .Nm command appeared in -.Bx 2.0 : -.Lk ftp://ftp.tuhs.org.ua/PDP-11/Distributions/ucb/2bsd.tar.gz +.Bx 2.0
CVS commit: src/usr.bin/finger
Module Name:src Committed By: abhinav Date: Thu Dec 22 12:39:40 UTC 2016 Modified Files: src/usr.bin/finger: finger.1 Log Message: Instead of saying "The finger displays information..." say "The finger utility" (not sure if it was intentionally written like that :) Also, add an xref to fingerd(8) To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.bin/finger/finger.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/finger.1 diff -u src/usr.bin/finger/finger.1:1.18 src/usr.bin/finger/finger.1:1.19 --- src/usr.bin/finger/finger.1:1.18 Fri Dec 26 12:45:57 2014 +++ src/usr.bin/finger/finger.1 Thu Dec 22 12:39:40 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: finger.1,v 1.18 2014/12/26 12:45:57 christos Exp $ +.\" $NetBSD: finger.1,v 1.19 2016/12/22 12:39:40 abhinav Exp $ .\" .\" Copyright (c) 1989, 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -43,7 +43,7 @@ .Sh DESCRIPTION The .Nm -displays information about the system users. +utility displays information about the system users. .Pp Options are: .Bl -tag -width flag @@ -180,8 +180,9 @@ If no arguments are specified, .Nm will print an entry for each user currently logged into the system. .Pp +The .Nm -may be used to look up users on a remote machine. +utility may be used to look up users on a remote machine. The format is to specify a .Ar user as @@ -205,7 +206,8 @@ last login data base .Sh SEE ALSO .Xr chpass 1 , .Xr w 1 , -.Xr who 1 +.Xr who 1 , +.Xr fingerd 8 .Sh HISTORY The .Nm
CVS commit: src/usr.bin/finger
Module Name:src Committed By: chs Date: Wed Mar 9 16:12:14 UTC 2016 Modified Files: src/usr.bin/finger: util.c Log Message: in find_idle_and_ttywrite(), initialize idletime and writable to 0 when stat() fails. this prevents a coredump later in stimeprint() due to gmtime() returning NULL for an uninitialized idletime. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/usr.bin/finger/util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/util.c diff -u src/usr.bin/finger/util.c:1.28 src/usr.bin/finger/util.c:1.29 --- src/usr.bin/finger/util.c:1.28 Sun Apr 12 06:18:54 2009 +++ src/usr.bin/finger/util.c Wed Mar 9 16:12:14 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.28 2009/04/12 06:18:54 lukem Exp $ */ +/* $NetBSD: util.c,v 1.29 2016/03/09 16:12:14 chs Exp $ */ /* * Copyright (c) 1989, 1993 @@ -72,7 +72,7 @@ #if 0 static char sccsid[] = "@(#)util.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: util.c,v 1.28 2009/04/12 06:18:54 lukem Exp $"); +__RCSID("$NetBSD: util.c,v 1.29 2016/03/09 16:12:14 chs Exp $"); #endif #endif /* not lint */ @@ -358,6 +358,8 @@ find_idle_and_ttywrite(WHERE *w) (void)snprintf(tbuf, sizeof(tbuf), "%s/%s", _PATH_DEV, w->tty); if (stat(tbuf, &sb) < 0) { warn("%s", tbuf); + w->idletime = 0; + w->writable = 0; return; } w->idletime = now < sb.st_atime ? 0 : now - sb.st_atime;
CVS commit: src/usr.bin/finger
Module Name:src Committed By: christos Date: Sat Nov 21 15:22:17 UTC 2015 Modified Files: src/usr.bin/finger: sprint.c Log Message: fix format To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.bin/finger/sprint.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/sprint.c diff -u src/usr.bin/finger/sprint.c:1.17 src/usr.bin/finger/sprint.c:1.18 --- src/usr.bin/finger/sprint.c:1.17 Tue Jan 3 20:17:54 2006 +++ src/usr.bin/finger/sprint.c Sat Nov 21 10:22:17 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sprint.c,v 1.17 2006/01/04 01:17:54 perry Exp $ */ +/* $NetBSD: sprint.c,v 1.18 2015/11/21 15:22:17 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)sprint.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: sprint.c,v 1.17 2006/01/04 01:17:54 perry Exp $"); +__RCSID("$NetBSD: sprint.c,v 1.18 2015/11/21 15:22:17 christos Exp $"); #endif #endif /* not lint */ @@ -92,7 +92,7 @@ sflag_print(void) * office phone */ #define MAXREALNAME 18 - (void)printf("%-*s %-*s %s %s\n", maxname, "Login", MAXREALNAME, + (void)printf("%-*s %-*s %s %s\n", (int)maxname, "Login", MAXREALNAME, "Name", " Tty Idle Login Time ", (gflag) ? "" : (oflag) ? "Office Office Phone" : "Where");
CVS commit: src/usr.bin/finger
Module Name:src Committed By: christos Date: Fri Dec 26 12:45:57 UTC 2014 Modified Files: src/usr.bin/finger: finger.1 Log Message: And correct it. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.bin/finger/finger.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/finger.1 diff -u src/usr.bin/finger/finger.1:1.17 src/usr.bin/finger/finger.1:1.18 --- src/usr.bin/finger/finger.1:1.17 Thu Dec 25 22:49:00 2014 +++ src/usr.bin/finger/finger.1 Fri Dec 26 07:45:57 2014 @@ -1,4 +1,4 @@ -.\" $NetBSD: finger.1,v 1.17 2014/12/26 03:49:00 christos Exp $ +.\" $NetBSD: finger.1,v 1.18 2014/12/26 12:45:57 christos Exp $ .\" .\" Copyright (c) 1989, 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -210,5 +210,5 @@ last login data base The .Nm command appeared in -.Bx 3.0 : +.Bx 2.0 : .Lk ftp://ftp.tuhs.org.ua/PDP-11/Distributions/ucb/2bsd.tar.gz
CVS commit: src/usr.bin/finger
Module Name:src Committed By: christos Date: Fri Dec 26 03:49:00 UTC 2014 Modified Files: src/usr.bin/finger: finger.1 Log Message: Correct the provenance of finger.1 and show the link that it was part of 2BSD (from Marcin F. Michalski) To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/usr.bin/finger/finger.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/finger.1 diff -u src/usr.bin/finger/finger.1:1.16 src/usr.bin/finger/finger.1:1.17 --- src/usr.bin/finger/finger.1:1.16 Sun Jun 10 13:45:59 2012 +++ src/usr.bin/finger/finger.1 Thu Dec 25 22:49:00 2014 @@ -1,4 +1,4 @@ -.\" $NetBSD: finger.1,v 1.16 2012/06/10 17:45:59 dholland Exp $ +.\" $NetBSD: finger.1,v 1.17 2014/12/26 03:49:00 christos Exp $ .\" .\" Copyright (c) 1989, 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)finger.1 8.3 (Berkeley) 5/5/94 .\" -.Dd June 10, 2012 +.Dd December 25, 2014 .Dt FINGER 1 .Os .Sh NAME @@ -210,4 +210,5 @@ last login data base The .Nm command appeared in -.Bx 3.0 . +.Bx 3.0 : +.Lk ftp://ftp.tuhs.org.ua/PDP-11/Distributions/ucb/2bsd.tar.gz
CVS commit: src/usr.bin/finger
Module Name:src Committed By: christos Date: Fri Jan 18 22:10:31 UTC 2013 Modified Files: src/usr.bin/finger: lprint.c Log Message: - Don't dump core or print random junk on corrupt utmp entries. - Factor out duplicated code in the process. - The actual code is now smaller and does error checking, and encoding. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.bin/finger/lprint.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/lprint.c diff -u src/usr.bin/finger/lprint.c:1.22 src/usr.bin/finger/lprint.c:1.23 --- src/usr.bin/finger/lprint.c:1.22 Sun Apr 12 02:18:54 2009 +++ src/usr.bin/finger/lprint.c Fri Jan 18 17:10:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: lprint.c,v 1.22 2009/04/12 06:18:54 lukem Exp $ */ +/* $NetBSD: lprint.c,v 1.23 2013/01/18 22:10:31 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)lprint.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID( "$NetBSD: lprint.c,v 1.22 2009/04/12 06:18:54 lukem Exp $"); +__RCSID( "$NetBSD: lprint.c,v 1.23 2013/01/18 22:10:31 christos Exp $"); #endif #endif /* not lint */ @@ -111,16 +111,71 @@ lflag_print(void) } } +static size_t +visify(char *buf, size_t blen, const char *str) +{ + int len = strnvisx(buf, blen, str, strlen(str), VIS_WHITE|VIS_CSTYLE); + if (len == -1) { + buf[0] = '\0'; + return 0; + } + return len; +} + +static void +fmt_time(char *buf, size_t blen, time_t ti, time_t n) +{ + struct tm *tp = localtime(&ti); + if (tp != NULL) { + char *t = asctime(tp); + char *tzn = TIMEZONE(tp); + if (n == (time_t)-1 || + n - ti > SECSPERDAY * DAYSPERNYEAR / 2) + snprintf(buf, blen, "%.16s %.4s (%s)", t, t + 20, tzn); + else + snprintf(buf, blen, "%.16s (%s)", t, tzn); + } else + snprintf(buf, blen, "[*bad time 0x%llx*]", (long long)ti); +} + +/* + * idle time is tough; if have one, print a comma, + * then spaces to pad out the device name, then the + * idle time. Follow with a comma if a remote login. + */ +static int +print_idle(time_t t, int maxlen, size_t hostlen, size_t ttylen) { + + int cpr; + struct tm *delta = gmtime(&t); + + if (delta == NULL) + return printf("Bad idle 0x%llx", (long long)t); + + if (delta->tm_yday == 0 && delta->tm_hour == 0 && delta->tm_min == 0) + return 0; + + cpr = printf("%-*s idle ", (int)(maxlen - ttylen + 1), ","); + if (delta->tm_yday > 0) { + cpr += printf("%d day%s ", delta->tm_yday, + delta->tm_yday == 1 ? "" : "s"); + } + cpr += printf("%d:%02d", delta->tm_hour, delta->tm_min); + if (hostlen) { + putchar(','); + ++cpr; + } + return cpr; +} + static void lprint(PERSON *pn) { - struct tm *delta; WHERE *w; int cpr, len, maxlen; - struct tm *tp; int oddfield; - char *t; - const char *tzn; + char timebuf[128], ttybuf[64], hostbuf[512]; + size_t ttylen, hostlen; cpr = 0; /* @@ -148,25 +203,25 @@ lprint(PERSON *pn) if (pn->office && pn->officephone && strlen(pn->office) + strlen(pn->officephone) + sizeof(OFFICE_TAG) + 2 <= 5 * TAB_LEN) { - (void)snprintf(tbuf, sizeof(tbuf), "%s: %s, %s", + (void)snprintf(timebuf, sizeof(timebuf), "%s: %s, %s", OFFICE_TAG, pn->office, prphone(pn->officephone)); - oddfield = demi_print(tbuf, oddfield); + oddfield = demi_print(timebuf, oddfield); } else { if (pn->office) { - (void)snprintf(tbuf, sizeof(tbuf), "%s: %s", + (void)snprintf(timebuf, sizeof(timebuf), "%s: %s", OFFICE_TAG, pn->office); - oddfield = demi_print(tbuf, oddfield); + oddfield = demi_print(timebuf, oddfield); } if (pn->officephone) { - (void)snprintf(tbuf, sizeof(tbuf), "%s: %s", + (void)snprintf(timebuf, sizeof(timebuf), "%s: %s", OFFICE_PHONE_TAG, prphone(pn->officephone)); - oddfield = demi_print(tbuf, oddfield); + oddfield = demi_print(timebuf, oddfield); } } if (pn->homephone) { - (void)snprintf(tbuf, sizeof(tbuf), "%s: %s", "Home Phone", + (void)snprintf(timebuf, sizeof(timebuf), "%s: %s", "Home Phone", prphone(pn->homephone)); - oddfield = demi_print(tbuf, oddfield); + oddfield = demi_print(timebuf, oddfield); } if (oddfield) putchar('\n'); @@ -183,39 +238,23 @@ no_gecos: * when last logged in */ /* find out longest device name for this user for formatting */ - for (w = pn->whead, maxlen = -1; w != NULL; w = w->next) - if ((len = strlen(w->tty)) > maxlen) + for (w = pn->whead, maxlen = -1; w != NULL; w = w->next) { + visify(ttybuf, sizeof(ttybuf), w->tty); + if ((len = strlen(ttybuf)) > maxlen) maxlen = len; + } /* find rest of entries for user */ for (w = pn->whead; w != NULL; w = w->next) { + ttylen = visify(ttybuf, sizeof(ttybuf), w->tty); + hostlen = visify(hostbuf, sizeof(hostbuf), w->host); switch (w->info) { case LOGGEDIN: - tp = localtime(&w->loginat); - t = asctime(tp); - tzn = TIMEZONE(tp); - cpr = printf("On since %.16s (%s) on %s",
CVS commit: src/usr.bin/finger
Module Name:src Committed By: dholland Date: Sun Jun 10 17:45:59 UTC 2012 Modified Files: src/usr.bin/finger: finger.1 Log Message: Fix description of -o option. Noted by Snader_LB on freenode. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.bin/finger/finger.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/finger.1 diff -u src/usr.bin/finger/finger.1:1.15 src/usr.bin/finger/finger.1:1.16 --- src/usr.bin/finger/finger.1:1.15 Thu Aug 7 11:13:44 2003 +++ src/usr.bin/finger/finger.1 Sun Jun 10 17:45:59 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: finger.1,v 1.15 2003/08/07 11:13:44 agc Exp $ +.\" $NetBSD: finger.1,v 1.16 2012/06/10 17:45:59 dholland Exp $ .\" .\" Copyright (c) 1989, 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)finger.1 8.3 (Berkeley) 5/5/94 .\" -.Dd September 12, 2002 +.Dd June 10, 2012 .Dt FINGER 1 .Os .Sh NAME @@ -121,8 +121,8 @@ is case insensitive. .It Fl o When used in conjunction with the .Fl s -option, the office location and office phone information is displayed -instead of the name of the remote host. +option, the office location and office phone information is displayed. +This is the default. .It Fl p Prevents the
CVS commit: src/usr.bin/finger
Module Name:src Committed By: lukem Date: Sun Apr 12 06:18:54 UTC 2009 Modified Files: src/usr.bin/finger: finger.c lprint.c net.c util.c Log Message: Fix WARNS=4 issues (-Wshadow, -Wcast-qual, -Wsign-compare) To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/usr.bin/finger/finger.c cvs rdiff -u -r1.21 -r1.22 src/usr.bin/finger/lprint.c cvs rdiff -u -r1.22 -r1.23 src/usr.bin/finger/net.c cvs rdiff -u -r1.27 -r1.28 src/usr.bin/finger/util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/finger/finger.c diff -u src/usr.bin/finger/finger.c:1.28 src/usr.bin/finger/finger.c:1.29 --- src/usr.bin/finger/finger.c:1.28 Mon Jul 21 14:19:22 2008 +++ src/usr.bin/finger/finger.c Sun Apr 12 06:18:54 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: finger.c,v 1.28 2008/07/21 14:19:22 lukem Exp $ */ +/* $NetBSD: finger.c,v 1.29 2009/04/12 06:18:54 lukem Exp $ */ /* * Copyright (c) 1989, 1993 @@ -52,7 +52,7 @@ #if 0 static char sccsid[] = "@(#)finger.c 8.5 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: finger.c,v 1.28 2008/07/21 14:19:22 lukem Exp $"); +__RCSID("$NetBSD: finger.c,v 1.29 2009/04/12 06:18:54 lukem Exp $"); #endif #endif /* not lint */ @@ -192,7 +192,7 @@ PERSON *pn; DBT data, key; struct passwd *pw; - int r, sflag; + int r, seqflag; struct utmpentry *ep; for (ep = ehead; ep; ep = ep->next) { @@ -204,10 +204,10 @@ enter_where(ep, pn); } if (db && lflag) - for (sflag = R_FIRST;; sflag = R_NEXT) { + for (seqflag = R_FIRST;; seqflag = R_NEXT) { PERSON *tmp; - r = (*db->seq)(db, &key, &data, sflag); + r = (*db->seq)(db, &key, &data, seqflag); if (r == -1) err(1, "db seq"); if (r == 1) @@ -223,7 +223,7 @@ PERSON *pn; DBT data, key; struct passwd *pw; - int r, sflag, *used, *ip; + int r, seqflag, *used, *ip; char **ap, **nargv, **np, **p; struct utmpentry *ep; @@ -284,10 +284,10 @@ enter_where(ep, pn); } if (db != NULL) - for (sflag = R_FIRST;; sflag = R_NEXT) { + for (seqflag = R_FIRST;; seqflag = R_NEXT) { PERSON *tmp; - r = (*db->seq)(db, &key, &data, sflag); + r = (*db->seq)(db, &key, &data, seqflag); if (r == -1) err(1, "db seq"); if (r == 1) Index: src/usr.bin/finger/lprint.c diff -u src/usr.bin/finger/lprint.c:1.21 src/usr.bin/finger/lprint.c:1.22 --- src/usr.bin/finger/lprint.c:1.21 Wed Jan 4 01:17:54 2006 +++ src/usr.bin/finger/lprint.c Sun Apr 12 06:18:54 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: lprint.c,v 1.21 2006/01/04 01:17:54 perry Exp $ */ +/* $NetBSD: lprint.c,v 1.22 2009/04/12 06:18:54 lukem Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)lprint.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID( "$NetBSD: lprint.c,v 1.21 2006/01/04 01:17:54 perry Exp $"); +__RCSID( "$NetBSD: lprint.c,v 1.22 2009/04/12 06:18:54 lukem Exp $"); #endif #endif /* not lint */ @@ -68,9 +68,9 @@ #define _PATH_PLAN ".plan" #define _PATH_PROJECT ".project" -static int demi_print(char *, int); +static int demi_print(const char *, int); static void lprint(PERSON *); -static int show_text(char *, char *, char *); +static int show_text(const char *, const char *, const char *); static void vputc(int); #ifdef __SVR4 @@ -263,7 +263,7 @@ } static int -demi_print(char *str, int oddfield) +demi_print(const char *str, int oddfield) { static int lenlast; int lenthis, maxlen; @@ -301,7 +301,7 @@ } static int -show_text(char *directory, char *file_name, char *header) +show_text(const char *directory, const char *file_name, const char *header) { struct stat sb; FILE *fp; @@ -316,7 +316,7 @@ return(0); /* If short enough, and no newlines, show it on a single line.*/ - if (sb.st_size <= LINE_LEN - strlen(header) - 5) { + if (sb.st_size <= (off_t)(LINE_LEN - strlen(header) - 5)) { nr = read(fd, tbuf, sizeof(tbuf)); if (nr <= 0) { (void)close(fd); Index: src/usr.bin/finger/net.c diff -u src/usr.bin/finger/net.c:1.22 src/usr.bin/finger/net.c:1.23 --- src/usr.bin/finger/net.c:1.22 Wed Jan 4 01:17:54 2006 +++ src/usr.bin/finger/net.c Sun Apr 12 06:18:54 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: net.c,v 1.22 2006/01/04 01:17:54 perry Exp $ */ +/* $NetBSD: net.c,v 1.23 2009/04/12 06:18:54 lukem Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)net.c 8.4 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: net.c,v 1.22 2006/01/04 01:17:54 perry Exp $"); +__RCSID("$NetBSD: net.c,v 1.23 2009/04/12 06:18:54 lukem Exp $"); #endif #endif /* not lint */ @@ -72,7 +72,7 @@ char *host; struct addrinfo hints, *res, *res0; int error; - char *emsg = NULL; + const char *emsg = NULL; lastc = 0; if (!(host = strrchr(name, '@'))) Index: src/usr.bin/finger/util.c diff -u src/usr.bin/finger/util.c:1.27 src/usr.bin/finger/util.c:1.28 --- src/usr.bin/finger/util.c:1.27 Sat May 5 16:55:17 2007 +++ src/us