aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/finger/finger.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2000-10-02 22:27:34 +0000
committerBrian Somers <brian@FreeBSD.org>2000-10-02 22:27:34 +0000
commit7ce8924adb6357c35189c1b054380751b7517b59 (patch)
tree26e41048099fa945df52b042b3cba9588e3fdaf0 /usr.bin/finger/finger.c
parentf234c674c1d744da8fccb72396977401538373a1 (diff)
downloadsrc-7ce8924adb6357c35189c1b054380751b7517b59.tar.gz
src-7ce8924adb6357c35189c1b054380751b7517b59.zip
Don't allow finger /somefile, only allow filname expansions from
inside /etc/finger.conf PR: 21704
Notes
Notes: svn path=/head/; revision=66563
Diffstat (limited to 'usr.bin/finger/finger.c')
-rw-r--r--usr.bin/finger/finger.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c
index 006c67d11f23..3ad3a3f84689 100644
--- a/usr.bin/finger/finger.c
+++ b/usr.bin/finger/finger.c
@@ -293,6 +293,16 @@ userlist(argc, argv)
goto net;
/*
+ * Mark any arguments beginning with '/' as invalid so that we
+ * don't accidently confuse them with expansions from finger.conf
+ */
+ for (p = argv, ip = used; *p; ++p, ++ip)
+ if (**p == '/') {
+ *ip = 1;
+ warnx("%s: no such user", *p);
+ }
+
+ /*
* Traverse the finger alias configuration file of the form
* alias:(user|alias), ignoring comment lines beginning '#'.
*/