Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

import freebsd-51

  • Loading branch information...
commit 4577535d737835fccee9a383abba202967128fdb 1 parent 6af3825
suz authored
View
16 freebsd5/usr.bin/telnet/commands.c
@@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD: src/usr.bin/telnet/commands.c,v 1.39 2002/11/20 17:59:20 eric Exp $");
-
+#if 0
#ifndef lint
static const char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95";
#endif
+#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/telnet/commands.c,v 1.40 2003/05/11 18:27:49 markm Exp $");
#include <sys/param.h>
#include <sys/un.h>
@@ -517,11 +517,11 @@ togdebug(void)
{
#ifndef NOT43
if (net > 0 &&
- (SetSockOpt(net, SOL_SOCKET, SO_DEBUG, debug)) < 0) {
+ (SetSockOpt(net, SOL_SOCKET, SO_DEBUG, telnet_debug)) < 0) {
perror("setsockopt (SO_DEBUG)");
}
#else /* NOT43 */
- if (debug) {
+ if (telnet_debug) {
if (net > 0 && SetSockOpt(net, SOL_SOCKET, SO_DEBUG, 1) < 0)
perror("setsockopt (SO_DEBUG)");
} else
@@ -692,7 +692,7 @@ static struct togglelist Togglelist[] = {
{ "debug",
"debugging",
(int (*)(int))togdebug,
- &debug,
+ &telnet_debug,
"turn on socket level debugging" },
{ "netdata",
"printing of hexadecimal network data (debugging)",
@@ -2146,7 +2146,7 @@ tn(int argc, char *argv[])
}
#endif /* defined(IPPROTO_IP) && defined(IP_TOS) */
- if (debug && SetSockOpt(net, SOL_SOCKET, SO_DEBUG, 1) < 0) {
+ if (telnet_debug && SetSockOpt(net, SOL_SOCKET, SO_DEBUG, 1) < 0) {
perror("setsockopt (SO_DEBUG)");
}
View
4 freebsd5/usr.bin/telnet/externs.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)externs.h 8.3 (Berkeley) 5/30/95
- * $FreeBSD: src/usr.bin/telnet/externs.h,v 1.10 2001/11/30 22:37:28 markm Exp $
+ * $FreeBSD: src/usr.bin/telnet/externs.h,v 1.11 2003/05/11 18:27:49 markm Exp $
*/
#ifndef BSD
@@ -127,7 +127,7 @@ extern int
netdata, /* Print out network data flow */
prettydump, /* Print "netdata" output in user readable format */
termdata, /* Print out terminal data flow */
- debug, /* Debug level */
+ telnet_debug, /* Debug level */
doaddrlookup, /* do a reverse lookup? */
clienteof; /* Client received EOF */
View
10 freebsd5/usr.bin/telnet/main.c
@@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD: src/usr.bin/telnet/main.c,v 1.19 2002/09/25 07:53:29 markm Exp $");
-
+#if 0
#ifndef lint
static const char sccsid[] = "@(#)main.c 8.3 (Berkeley) 5/30/95";
#endif
+#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/telnet/main.c,v 1.20 2003/05/11 18:27:49 markm Exp $");
#include <sys/types.h>
#include <sys/socket.h>
@@ -180,7 +180,7 @@ main(int argc, char *argv[])
skiprc = 1;
break;
case 'd':
- debug = 1;
+ telnet_debug = 1;
break;
case 'e':
set_escape_char(optarg);
View
8 freebsd5/usr.bin/telnet/network.c
@@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD: src/usr.bin/telnet/network.c,v 1.5 2002/09/25 07:53:29 markm Exp $");
-
+#if 0
#ifndef lint
static const char sccsid[] = "@(#)network.c 8.2 (Berkeley) 12/15/93";
#endif
+#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/telnet/network.c,v 1.6 2003/05/11 18:27:49 markm Exp $");
#include <sys/types.h>
#include <sys/socket.h>
View
8 freebsd5/usr.bin/telnet/ring.c
@@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD: src/usr.bin/telnet/ring.c,v 1.5 2001/11/30 22:09:10 markm Exp $");
-
+#if 0
#ifndef lint
static const char sccsid[] = "@(#)ring.c 8.2 (Berkeley) 5/30/95";
#endif
+#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/telnet/ring.c,v 1.6 2003/05/11 18:27:49 markm Exp $");
/*
* This defines a structure for a ring buffer.
View
12 freebsd5/usr.bin/telnet/sys_bsd.c
@@ -31,15 +31,13 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#include <stdlib.h>
-#include <err.h>
-
-__FBSDID("$FreeBSD: src/usr.bin/telnet/sys_bsd.c,v 1.10 2002/09/25 07:53:29 markm Exp $");
-
+#if 0
#ifndef lint
static const char sccsid[] = "@(#)sys_bsd.c 8.4 (Berkeley) 5/30/95";
#endif
+#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/telnet/sys_bsd.c,v 1.11 2003/05/11 18:27:49 markm Exp $");
/*
* The following routines try to encapsulate what is system dependent
@@ -49,9 +47,11 @@ static const char sccsid[] = "@(#)sys_bsd.c 8.4 (Berkeley) 5/30/95";
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/time.h>
+#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
+#include <stdlib.h>
#include <unistd.h>
#include <arpa/telnet.h>
View
4 freebsd5/usr.bin/telnet/telnet.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)telnet.1 8.6 (Berkeley) 6/1/94
-.\" $FreeBSD: src/usr.bin/telnet/telnet.1,v 1.27 2002/04/20 12:17:17 charnier Exp $
+.\" $FreeBSD: src/usr.bin/telnet/telnet.1,v 1.28 2002/12/27 12:15:35 schweikh Exp $
.\"
.Dd January 27, 2000
.Dt TELNET 1
@@ -588,7 +588,7 @@ The host specification may be either a host name (see
.Xr hosts 5 ) ,
an Internet address specified in the \*(Lqdot notation\*(Rq (see
.Xr inet 3 ) ,
-or IPv6 host name or IPv6 coloned-hexadecimal addreess.
+or IPv6 host name or IPv6 coloned-hexadecimal address.
The
.Fl l
option may be used to specify the user name
View
51 freebsd5/usr.bin/telnet/telnet.c
@@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD: src/usr.bin/telnet/telnet.c,v 1.14 2002/10/02 00:37:01 dd Exp $");
-
+#if 0
#ifndef lint
static const char sccsid[] = "@(#)telnet.c 8.4 (Berkeley) 5/30/95";
#endif
+#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/telnet/telnet.c,v 1.16 2003/05/11 18:27:49 markm Exp $");
#include <sys/types.h>
@@ -89,7 +89,7 @@ int
connected,
showoptions,
ISend, /* trying to send network data in */
- debug = 0,
+ telnet_debug = 0,
crmod,
netdata, /* Print out network data flow */
crlf, /* Should '\r' be mapped to <CR><LF> (or <CR><NUL>)? */
@@ -1946,6 +1946,47 @@ telnet(char *user __unusedhere)
}
}
+#if 0 /* XXX - this not being in is a bug */
+/*
+ * nextitem()
+ *
+ * Return the address of the next "item" in the TELNET data
+ * stream. This will be the address of the next character if
+ * the current address is a user data character, or it will
+ * be the address of the character following the TELNET command
+ * if the current address is a TELNET IAC ("I Am a Command")
+ * character.
+ */
+
+static char *
+nextitem(char *current)
+{
+ if ((*current&0xff) != IAC) {
+ return current+1;
+ }
+ switch (*(current+1)&0xff) {
+ case DO:
+ case DONT:
+ case WILL:
+ case WONT:
+ return current+3;
+ case SB: /* loop forever looking for the SE */
+ {
+ char *look = current+2;
+
+ for (;;) {
+ if ((*look++&0xff) == IAC) {
+ if ((*look++&0xff) == SE) {
+ return look;
+ }
+ }
+ }
+ }
+ default:
+ return current+2;
+ }
+}
+#endif /* 0 */
/*
* netclear()
View
8 freebsd5/usr.bin/telnet/terminal.c
@@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD: src/usr.bin/telnet/terminal.c,v 1.6 2002/09/25 07:53:29 markm Exp $");
-
+#if 0
#ifndef lint
static const char sccsid[] = "@(#)terminal.c 8.2 (Berkeley) 2/16/95";
#endif
+#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/telnet/terminal.c,v 1.7 2003/05/11 18:27:49 markm Exp $");
#include <arpa/telnet.h>
#include <sys/types.h>
View
8 freebsd5/usr.bin/telnet/utilities.c
@@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD: src/usr.bin/telnet/utilities.c,v 1.6 2002/09/25 07:53:29 markm Exp $");
-
+#if 0
#ifndef lint
static const char sccsid[] = "@(#)utilities.c 8.3 (Berkeley) 5/30/95";
#endif
+#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/telnet/utilities.c,v 1.7 2003/05/11 18:27:49 markm Exp $");
#define TELOPTS
#define TELCMDS
View
7 freebsd5/usr.bin/wall/wall.c
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/wall/wall.c,v 1.22 2001/12/11 22:22:15 markm Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/wall/wall.c,v 1.23 2003/02/21 08:46:44 tjr Exp $");
#ifndef lint
static const char copyright[] =
@@ -72,8 +72,6 @@ static const char sccsid[] = "@(#)wall.c 8.2 (Berkeley) 11/16/93";
static void makemsg(char *);
static void usage(void);
-#define IGNOREUSER "sleeper"
-
struct wallgroup {
struct wallgroup *next;
char *name;
@@ -140,8 +138,7 @@ main(int argc, char *argv[])
iov.iov_len = mbufsize;
/* NOSTRICT */
while (fread((char *)&utmp, sizeof(utmp), 1, fp) == 1) {
- if (!utmp.ut_name[0] ||
- !strncmp(utmp.ut_name, IGNOREUSER, sizeof(utmp.ut_name)))
+ if (!utmp.ut_name[0])
continue;
if (grouplist) {
ingroup = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.