summaryrefslogtreecommitdiff
path: root/usr.bin/finger
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1999-12-22 22:30:21 +0000
committerJason Downs <downsj@cvs.openbsd.org>1999-12-22 22:30:21 +0000
commit4b8455d9a08427e138a1db3a540389143e5cabe1 (patch)
tree8296cdfa169350099a1a5af5a19ecd985b14df22 /usr.bin/finger
parent68bcea50da3d19a35d62587234c3a7b6dde3d928 (diff)
Add yet another case when user matching is disabled.
Diffstat (limited to 'usr.bin/finger')
-rw-r--r--usr.bin/finger/finger.15
-rw-r--r--usr.bin/finger/finger.c13
2 files changed, 13 insertions, 5 deletions
diff --git a/usr.bin/finger/finger.1 b/usr.bin/finger/finger.1
index c11e4a9b422..eb55846b87d 100644
--- a/usr.bin/finger/finger.1
+++ b/usr.bin/finger/finger.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: finger.1,v 1.10 1999/07/04 11:53:54 aaron Exp $
+.\" $OpenBSD: finger.1,v 1.11 1999/12/22 22:30:20 downsj Exp $
.\"
.\" Copyright (c) 1989, 1990 The Regents of the University of California.
.\" All rights reserved.
@@ -146,7 +146,8 @@ is case insensitive.
.It Fl M
Enable matching of
.Ar user
-names. This is disabled by default on systems running YP.
+names. This is disabled by default on systems running YP or with large
+password databases.
.El
.Pp
If no options are specified,
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c
index 487aea33852..cee017d39a6 100644
--- a/usr.bin/finger/finger.c
+++ b/usr.bin/finger/finger.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: finger.c,v 1.8 1998/07/10 15:45:15 mickey Exp $ */
+/* $OpenBSD: finger.c,v 1.9 1999/12/22 22:30:20 downsj Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -54,7 +54,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)finger.c 5.22 (Berkeley) 6/29/90";*/
-static char rcsid[] = "$OpenBSD: finger.c,v 1.8 1998/07/10 15:45:15 mickey Exp $";
+static char rcsid[] = "$OpenBSD: finger.c,v 1.9 1999/12/22 22:30:20 downsj Exp $";
#endif /* not lint */
/*
@@ -73,6 +73,7 @@ static char rcsid[] = "$OpenBSD: finger.c,v 1.8 1998/07/10 15:45:15 mickey Exp $
#include <sys/param.h>
#include <sys/file.h>
+#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -94,6 +95,7 @@ main(argc, argv)
extern char *__progname;
int ch;
char domain[256];
+ struct stat sb;
oflag = 1; /* default to old "office" behavior */
@@ -129,9 +131,14 @@ main(argc, argv)
argc -= optind;
argv += optind;
- /* if a domainname is set, increment mflag. */
+ /* If a domainname is set, increment mflag. */
if ((getdomainname(&domain, sizeof(domain)) == 0) && domain[0])
mflag++;
+ /* If _PATH_MP_DB is larger than 1MB, increment mflag. */
+ if (stat(_PATH_MP_DB, &sb) == 0) {
+ if (sb.st_size > 1048576)
+ mflag++;
+ }
(void)time(&now);
setpassent(1);