diff -uNr busybox.old/debian/config-static busybox/debian/config-static
--- busybox.old/debian/config-static	Wed Feb 11 13:01:04 2004
+++ busybox/debian/config-static	Wed Feb 11 10:52:00 2004
@@ -367,6 +367,7 @@
 CONFIG_ROUTE=y
 CONFIG_TELNET=y
 CONFIG_FEATURE_TELNET_TTYPE=y
+CONFIG_FEATURE_TELNET_AUTOLOGIN=y
 CONFIG_TELNETD=y
 # CONFIG_FEATURE_TELNETD_INETD is not set
 CONFIG_TFTP=y
diff -uNr busybox.old/include/usage.h busybox/include/usage.h
--- busybox.old/include/usage.h	Wed Feb 11 13:01:04 2004
+++ busybox/include/usage.h	Wed Feb 11 10:48:49 2004
@@ -2414,11 +2414,26 @@
 	"$ cat /tmp/foo\n" \
 	"Hello\n"
 
+#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
+#define telnet_trivial_usage \
+	"[-a] [-l USER] HOST [PORT]"
+#define telnet_full_usage \
+	"Telnet is used to establish interactive communication with another\n" \
+	"computer over a network using the TELNET protocol.\n\n" \
+	"Options:\n" \
+	"\t-a\t\tAttempt an automatic login with the USER variable.\n" \
+	"\t-l USER\t\tAttempt an automatic login with the USER argument.\n" \
+	"\tHOST\t\tThe official name, alias or the IP address of the\n" \
+	"\t\t\tremote host.\n" \
+	"\tPORT\t\tThe remote port number to connect to. If it is not\n" \
+	"\t\t\tspecified, the default telnet (23) port is used.\n"
+#else
 #define telnet_trivial_usage \
 	"HOST [PORT]"
 #define telnet_full_usage \
 	"Telnet is used to establish interactive communication with another\n"\
 	"computer over a network using the TELNET protocol."
+#endif
 
 #ifdef CONFIG_FEATURE_TELNETD_INETD
 #define telnetd_trivial_usage \
diff -uNr busybox.old/networking/Config.in busybox/networking/Config.in
--- busybox.old/networking/Config.in	Wed Feb 11 13:01:04 2004
+++ busybox/networking/Config.in	Wed Feb 11 10:57:39 2004
@@ -491,6 +491,16 @@
 	  remote host you are connecting to.  This is useful to make sure that
 	  things like ANSI colors and other control sequences behave.
 
+config CONFIG_FEATURE_TELNET_AUTOLOGIN
+	bool "  Pass USER type to remote host"
+	default y
+	depends on CONFIG_TELNET
+	help
+	  Setting this option will forward the USER environment variable to the
+	  remote host you are connecting to. This is useful when you need to
+	  log into a machine without telling the username (autologin). This
+	  option enables `-a' and `-l USER' arguments.
+
 config CONFIG_TELNETD
 	bool "telnetd"
 	default n
diff -uNr busybox.old/networking/telnet.c busybox/networking/telnet.c
--- busybox.old/networking/telnet.c	Wed Feb 11 13:01:04 2004
+++ busybox/networking/telnet.c	Wed Feb 11 11:11:10 2004
@@ -28,6 +28,8 @@
  * Modified 2000/06/13 for inclusion into BusyBox by Erik Andersen <andersen@codepoet.org>
  * Modified 2001/05/07 to add ability to pass TTYPE to remote host by Jim McQuillan
  * <jam@ltsp.org>
+ * Modified 2004/02/11 to add ability to pass the USER variable to remote host
+ * by Fernando Silveira <swrh@gmx.net>
  *
  */
 
@@ -129,6 +131,10 @@
 static char *ttype;
 #endif
 
+#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
+static char *autologin;
+#endif
+
 #ifdef CONFIG_FEATURE_AUTOWIDTH
 static int win_width, win_height;
 #endif
@@ -355,6 +361,34 @@
 }
 #endif
 
+#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
+static void putiac_subopt_autologin(void)
+{
+	int len = strlen(autologin) + 6;	// (2 + 1 + 1 + strlen + 2)
+	char *user = "USER";
+
+	if (G.iaclen + len > IACBUFSIZE)
+		iacflush();
+
+	putiac(IAC);
+	putiac(SB);
+	putiac(TELOPT_NEW_ENVIRON);
+	putiac(TELQUAL_IS);
+	putiac(NEW_ENV_VAR);
+
+	while(*user)
+		putiac(*user++);
+
+	putiac(NEW_ENV_VALUE);
+
+	while(*autologin)
+		putiac(*autologin++);
+
+	putiac(IAC);
+	putiac(SE);
+}
+#endif
+
 #ifdef CONFIG_FEATURE_AUTOWIDTH
 static void putiac_naws(byte c, int x, int y)
 {
@@ -495,6 +529,20 @@
 }
 #endif
 
+#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
+static inline void to_new_environ(void)
+{
+	/* Tell server we will (or will not) do AUTOLOGIN */
+
+	if (autologin)
+		putiac2(WILL, TELOPT_NEW_ENVIRON);
+	else
+		putiac2(WONT, TELOPT_NEW_ENVIRON);
+
+	return;
+}
+#endif
+
 #ifdef CONFIG_FEATURE_AUTOWIDTH
 static inline void to_naws(void)
 { 
@@ -513,6 +561,9 @@
 #ifdef CONFIG_FEATURE_TELNET_TTYPE
 		case TELOPT_TTYPE:		to_ttype();break;
 #endif
+#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
+		case TELOPT_NEW_ENVIRON:	to_new_environ();	break;
+#endif
 #ifdef CONFIG_FEATURE_AUTOWIDTH
 		case TELOPT_NAWS:		to_naws();
 								putiac_naws(c, win_width, win_height);
@@ -540,6 +591,11 @@
 		if (c == TELOPT_TTYPE)
 			putiac_subopt(TELOPT_TTYPE,ttype);
 #endif
+#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
+		else
+		if (c == TELOPT_NEW_ENVIRON)
+			putiac_subopt_autologin();
+#endif
 		break;
 	case TS_SUB2:
 		if (c == SE)
@@ -579,6 +635,10 @@
 	int maxfd;
 #endif	
 
+#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
+	int opt;
+#endif
+
 #ifdef CONFIG_FEATURE_AUTOWIDTH
 	get_terminal_width_height(0, &win_width, &win_height);
 #endif
@@ -598,8 +658,33 @@
 	if (argc < 2)
 		bb_show_usage();
 	
+#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
+	autologin = NULL;
+	while ((opt = getopt(argc, argv, "al:")) != EOF) {
+		switch (opt) {
+			case 'l':
+				autologin = bb_xstrdup(optarg);
+				break;
+			case 'a':
+				autologin = getenv("USER");
+				break;
+			case '?':
+				bb_show_usage();
+				break;
+		}
+	}
+	if (optind < argc) {
+		bb_lookup_host(&s_in, argv[optind++]);
+		s_in.sin_port = bb_lookup_port((optind < argc) ? argv[optind++] :
+				"telnet", "tcp", 23);
+		if (optind < argc)
+			bb_show_usage();
+	} else
+		bb_show_usage();
+#else
 	bb_lookup_host(&s_in, argv[1]);
 	s_in.sin_port = bb_lookup_port((argc == 3) ? argv[2] : "telnet", "tcp", 23);
+#endif
 	
 	G.netfd = xconnect(&s_in);
 
