-.\" $OpenBSD: finger.1,v 1.2 1996/06/26 05:33:15 deraadt Exp $
+.\" $OpenBSD: finger.1,v 1.3 1996/12/08 13:29:19 downsj Exp $
+.\"
.\" Copyright (c) 1989, 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.Nd user information lookup program
.Sh SYNOPSIS
.Nm finger
-.Op Fl lmsp
+.Op Fl lmMsp
.Op Ar user ...
.Op Ar user@host ...
.Sh DESCRIPTION
All name matching performed by
.Nm finger
is case insensitive.
+.It Fl M
+Enable matching of
+.Ar user
+names. This is disabled by default on systems running YP.
.El
.Pp
If no options are specified,
-/* $OpenBSD: finger.c,v 1.3 1996/08/30 11:39:36 deraadt Exp $ */
+/* $OpenBSD: finger.c,v 1.4 1996/12/08 13:29:19 downsj Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
#ifndef lint
/*static char sccsid[] = "from: @(#)finger.c 5.22 (Berkeley) 6/29/90";*/
-static char rcsid[] = "$OpenBSD: finger.c,v 1.3 1996/08/30 11:39:36 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: finger.c,v 1.4 1996/12/08 13:29:19 downsj Exp $";
#endif /* not lint */
/*
#include "finger.h"
time_t now;
-int lflag, sflag, mflag, pplan;
+int lflag, sflag, mflag, pplan, Mflag;
char tbuf[1024];
int loginlist __P((void));
{
extern int optind;
int ch;
+ char domain[256];
time_t time();
- while ((ch = getopt(argc, argv, "lmps")) != EOF)
+ while ((ch = getopt(argc, argv, "lmMps")) != EOF)
switch(ch) {
case 'l':
lflag = 1; /* long format */
case 'm':
mflag = 1; /* force exact match of names */
break;
+ case 'M':
+ Mflag = 1; /* allow name matching */
+ break;
case 'p':
pplan = 1; /* don't show .plan/.project */
break;
case '?':
default:
(void)fprintf(stderr,
- "usage: finger [-lmps] [login ...]\n");
+ "usage: finger [-lmMps] [login ...]\n");
exit(1);
}
argc -= optind;
argv += optind;
+ /* if a domainname is set, increment mflag. */
+ if ((getdomainname(&domain, sizeof(domain)) == 0) && domain[0])
+ mflag++;
+
(void)time(&now);
setpassent(1);
if (!*argv) {
* traverse the list of possible login names and check the login name
* and real name against the name specified by the user.
*/
- if (mflag) {
+ if ((mflag - Mflag) > 0) {
for (i = 0; i < argc; i++)
if (used[i] >= 0 && (pw = getpwnam(argv[i]))) {
enter_person(pw);