summaryrefslogtreecommitdiffstats
path: root/usr.bin/who/who.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>1998-04-26 19:10:51 +0000
committerdes <des@FreeBSD.org>1998-04-26 19:10:51 +0000
commitb7cdb32ea97447b8883d350f191123252d45c934 (patch)
treeb0380c24d7ad599d74a835c58b6e23e19c867a1f /usr.bin/who/who.c
parent73748688878b231e077a74a859a3c8504c173ade (diff)
downloadFreeBSD-src-b7cdb32ea97447b8883d350f191123252d45c934.zip
FreeBSD-src-b7cdb32ea97447b8883d350f191123252d45c934.tar.gz
Check that user really typed "who am {I,i}", and that no stray
arguments are given. Note that usage() and the manpage disagree... PR: bin/6294 Suggested by: Ruslan Ermilov and Bruce Evans Submitted by: Ruslan Ermilov (partly)
Diffstat (limited to 'usr.bin/who/who.c')
-rw-r--r--usr.bin/who/who.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c
index 13b6552..90cde1a 100644
--- a/usr.bin/who/who.c
+++ b/usr.bin/who/who.c
@@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: who.c,v 1.5 1997/08/26 11:14:57 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -90,6 +90,10 @@ main(argc, argv)
output(&usr);
break;
case 3: /* who am i */
+ if (strcmp(argv[1], "am")
+ || (strcmp(argv[2], "I") && strcmp(argv[2], "i")))
+ usage();
+
ufp = file(_PATH_UTMP);
/* search through the utmp and find an entry for this tty */
OpenPOWER on IntegriCloud