summaryrefslogtreecommitdiffstats
path: root/usr.bin/finger/finger.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-01-04 01:02:43 +0000
committerjkh <jkh@FreeBSD.org>1995-01-04 01:02:43 +0000
commit9bea03d7a26d452c81e8828059f2788a53a2540e (patch)
tree5b6f4838073f5bd352bf7130f1d5900bdfa266cf /usr.bin/finger/finger.c
parente90dae4bf6773c9ad9f6ae1d2a703c480e098973 (diff)
downloadFreeBSD-src-9bea03d7a26d452c81e8828059f2788a53a2540e.zip
FreeBSD-src-9bea03d7a26d452c81e8828059f2788a53a2540e.tar.gz
Add Sean Eric Fagan's support for a ~/.nofinger file for user who prefer
their privacy. Submitted by: sef
Diffstat (limited to 'usr.bin/finger/finger.c')
-rw-r--r--usr.bin/finger/finger.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c
index 4421507..3305e9f 100644
--- a/usr.bin/finger/finger.c
+++ b/usr.bin/finger/finger.c
@@ -202,6 +202,8 @@ loginlist()
bcopy(user.ut_name, name, UT_NAMESIZE);
if ((pw = getpwnam(name)) == NULL)
continue;
+ if (hide(pw))
+ continue;
pn = enter_person(pw);
}
enter_where(&user, pn);
@@ -252,18 +254,21 @@ userlist(argc, argv)
*/
if (mflag)
for (p = argv; *p; ++p)
- if (pw = getpwnam(*p))
+ if ((pw = getpwnam(*p)) && !hide(pw))
enter_person(pw);
else
(void)fprintf(stderr,
"finger: %s: no such user\n", *p);
else {
- while (pw = getpwent())
+ while (pw = getpwent()) {
+ if (hide (pw))
+ continue;
for (p = argv, ip = used; *p; ++p, ++ip)
if (match(pw, *p)) {
enter_person(pw);
*ip = 1;
}
+ }
for (p = argv, ip = used; *p; ++p, ++ip)
if (!*ip)
(void)fprintf(stderr,
OpenPOWER on IntegriCloud