summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-03 02:09:34 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-03 02:09:34 +0000
commitfa672040d4bcd239100aa9ce92d7185b167fae32 (patch)
tree9f6a4546401caa27538e8152d46eaf5bb441a687
parent74c36eff0b16782e6f21359aa9263488bd7330cd (diff)
finger can either do local users only, or in in remote users. (who
still runs fingerd? not many places, it took a while to find a server) tame "stdio getpw rpath inet" is possible early on, then later when the network lookups list is consumed, tame "stddio getpw rpath"
-rw-r--r--usr.bin/finger/finger.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c
index 5ec24c144bf..1f065d865fe 100644
--- a/usr.bin/finger/finger.c
+++ b/usr.bin/finger/finger.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: finger.c,v 1.20 2015/08/20 22:32:41 deraadt Exp $ */
+/* $OpenBSD: finger.c,v 1.21 2015/10/03 02:09:33 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -126,6 +126,9 @@ main(int argc, char *argv[])
mflag++;
}
+ if (tame("stdio getpw rpath inet", NULL) == -1)
+ err(1, "tame");
+
(void)time(&now);
setpassent(1);
if (!*argv) {
@@ -134,6 +137,8 @@ main(int argc, char *argv[])
* not selected. Force the -s BEFORE we get names so proper
* screening will be done.
*/
+ if (tame("stdio getpw rpath", NULL) == -1)
+ err(1, "tame");
if (!lflag)
sflag = 1; /* if -l not explicit, force -s */
loginlist();
@@ -214,6 +219,10 @@ userlist(int argc, char **argv)
if (!dolocal)
goto net;
+ if (nettail == &nethead)
+ if (tame("stdio getpw rpath", NULL) == -1)
+ err(1, "tame");
+
/*
* traverse the list of possible login names and check the login name
* and real name against the name specified by the user.