aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-17 13:37:51 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-17 13:37:51 +0200
commitfb8348b36457e5287646e11c1ec45365c112fd3c (patch)
tree9f9975a3fda29f271d33eb8d31299ce1afa6301e
parent048491fbdccc35edd481218baeedb31c5253aa12 (diff)
downloadbusybox-w32-fb8348b36457e5287646e11c1ec45365c112fd3c.tar.gz
busybox-w32-fb8348b36457e5287646e11c1ec45365c112fd3c.tar.bz2
busybox-w32-fb8348b36457e5287646e11c1ec45365c112fd3c.zip
telnet: "-a" + "-l USER" should respect USER
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/telnet.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/networking/telnet.c b/networking/telnet.c
index e1c259579..1f8a44466 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -44,7 +44,7 @@
44//config: Setting this option will forward the USER environment variable to the 44//config: Setting this option will forward the USER environment variable to the
45//config: remote host you are connecting to. This is useful when you need to 45//config: remote host you are connecting to. This is useful when you need to
46//config: log into a machine without telling the username (autologin). This 46//config: log into a machine without telling the username (autologin). This
47//config: option enables '-a' and '-l USER' arguments. 47//config: option enables '-a' and '-l USER' options.
48//config: 48//config:
49//config:config FEATURE_TELNET_WIDTH 49//config:config FEATURE_TELNET_WIDTH
50//config: bool "Enable window size autodetection" 50//config: bool "Enable window size autodetection"
@@ -643,8 +643,10 @@ int telnet_main(int argc UNUSED_PARAM, char **argv)
643 } 643 }
644 644
645#if ENABLE_FEATURE_TELNET_AUTOLOGIN 645#if ENABLE_FEATURE_TELNET_AUTOLOGIN
646 if (1 & getopt32(argv, "al:", &G.autologin)) 646 if (1 == getopt32(argv, "al:", &G.autologin)) {
647 /* Only -a without -l USER picks $USER from envvar */
647 G.autologin = getenv("USER"); 648 G.autologin = getenv("USER");
649 }
648 argv += optind; 650 argv += optind;
649#else 651#else
650 argv++; 652 argv++;