summaryrefslogtreecommitdiffstats
path: root/usr.bin/finger
diff options
context:
space:
mode:
authorolah <olah@FreeBSD.org>1996-03-15 16:41:49 +0000
committerolah <olah@FreeBSD.org>1996-03-15 16:41:49 +0000
commit4bc23fada7ceabb4bc4e4a493c6bb8bd570304b3 (patch)
tree9fe9faa95cdc47f0c3c3d2944c0af1992ad1171a /usr.bin/finger
parenta219c408e342f4eb2be1fd79a7f13afe6183ca45 (diff)
downloadFreeBSD-src-4bc23fada7ceabb4bc4e4a493c6bb8bd570304b3.zip
FreeBSD-src-4bc23fada7ceabb4bc4e4a493c6bb8bd570304b3.tar.gz
Allow the user to disable the use of T/TCP by setting the -T option.
This option becomes useless when all TCP stacks are fixed out there.
Diffstat (limited to 'usr.bin/finger')
-rw-r--r--usr.bin/finger/finger.18
-rw-r--r--usr.bin/finger/finger.c9
-rw-r--r--usr.bin/finger/net.c7
3 files changed, 20 insertions, 4 deletions
diff --git a/usr.bin/finger/finger.1 b/usr.bin/finger/finger.1
index 6c64920..272cb17 100644
--- a/usr.bin/finger/finger.1
+++ b/usr.bin/finger/finger.1
@@ -39,7 +39,7 @@
.Nd user information lookup program
.Sh SYNOPSIS
.Nm finger
-.Op Fl lmpsho
+.Op Fl lmpshoT
.Op Ar user ...
.Op Ar user@host ...
.Sh DESCRIPTION
@@ -140,6 +140,11 @@ option is supplied.
All name matching performed by
.Nm finger
is case insensitive.
+.Pp
+.It Fl T
+Disable the use of T/TCP (see
+.Xr ttcp 4 ).
+This option is needed to finger hosts with a broken TCP implementation.
.El
.Pp
If no options are specified,
@@ -191,6 +196,7 @@ This variable may be set with favored options to
.Xr chpass 1 ,
.Xr w 1 ,
.Xr who 1 ,
+.Xr ttcp 4 .
.Sh HISTORY
The
.Nm finger
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c
index 578d164..657426f 100644
--- a/usr.bin/finger/finger.c
+++ b/usr.bin/finger/finger.c
@@ -83,7 +83,7 @@ static char sccsid[] = "@(#)finger.c 8.2 (Berkeley) 9/30/93";
DB *db;
time_t now;
-int entries, lflag, mflag, pplan, sflag, oflag;
+int entries, lflag, mflag, pplan, sflag, oflag, Tflag;
char tbuf[1024];
static void loginlist __P((void));
@@ -98,7 +98,7 @@ option(argc, argv)
optind = 1; /* reset getopt */
- while ((ch = getopt(argc, argv, "lmpsho")) != EOF)
+ while ((ch = getopt(argc, argv, "lmpshoT")) != EOF)
switch(ch) {
case 'l':
lflag = 1; /* long format */
@@ -118,10 +118,13 @@ option(argc, argv)
case 'o':
oflag = 1; /* office info */
break;
+ case 'T':
+ Tflag = 1; /* disable T/TCP */
+ break;
case '?':
default:
(void)fprintf(stderr,
- "usage: finger [-lmpsho] [login ...]\n");
+ "usage: finger [-lmpshoT] [login ...]\n");
exit(1);
}
diff --git a/usr.bin/finger/net.c b/usr.bin/finger/net.c
index 697e862..4f04c04 100644
--- a/usr.bin/finger/net.c
+++ b/usr.bin/finger/net.c
@@ -58,6 +58,7 @@ netfinger(name)
char *name;
{
extern int lflag;
+ extern int Tflag;
register FILE *fp;
register int c, lastc;
struct in_addr defaddr;
@@ -119,6 +120,12 @@ netfinger(name)
iov[msg.msg_iovlen].iov_base = "\r\n";
iov[msg.msg_iovlen++].iov_len = 2;
+ /* -T disables T/TCP: compatibility option to finger broken hosts */
+ if (Tflag && connect(s, (struct sockaddr *)&sin, sizeof (sin))) {
+ perror("finger: connect");
+ return;
+ }
+
if (sendmsg(s, &msg, MSG_EOF) < 0) {
perror("finger: sendmsg");
close(s);
OpenPOWER on IntegriCloud