aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/telnet/telnet/commands.c6
-rw-r--r--crypto/telnet/telnet/commands.c6
-rw-r--r--usr.bin/telnet/commands.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/contrib/telnet/telnet/commands.c b/contrib/telnet/telnet/commands.c
index 8380c2969bda7..bd671f8145dbb 100644
--- a/contrib/telnet/telnet/commands.c
+++ b/contrib/telnet/telnet/commands.c
@@ -2475,6 +2475,12 @@ tn(argc, argv)
(void) strncpy(_hostname, hostp, sizeof(_hostname) - 1);
_hostname[sizeof(_hostname)-1] = '\0';
hostname = _hostname;
+ } else if (error != 0) {
+ fprintf(stderr, "%s: %s\n", hostname, gai_strerror(error));
+ if (error == EAI_SYSTEM)
+ fprintf(stderr, "%s: %s\n", hostname, strerror(errno));
+ setuid(getuid());
+ return 0;
}
if (srcroute != 0) {
srp = 0;
diff --git a/crypto/telnet/telnet/commands.c b/crypto/telnet/telnet/commands.c
index 8380c2969bda7..bd671f8145dbb 100644
--- a/crypto/telnet/telnet/commands.c
+++ b/crypto/telnet/telnet/commands.c
@@ -2475,6 +2475,12 @@ tn(argc, argv)
(void) strncpy(_hostname, hostp, sizeof(_hostname) - 1);
_hostname[sizeof(_hostname)-1] = '\0';
hostname = _hostname;
+ } else if (error != 0) {
+ fprintf(stderr, "%s: %s\n", hostname, gai_strerror(error));
+ if (error == EAI_SYSTEM)
+ fprintf(stderr, "%s: %s\n", hostname, strerror(errno));
+ setuid(getuid());
+ return 0;
}
if (srcroute != 0) {
srp = 0;
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index 33a45481667da..b7e81c4935e7e 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -2298,6 +2298,12 @@ tn(argc, argv)
(void) strncpy(_hostname, hostp, sizeof(_hostname) - 1);
_hostname[sizeof(_hostname)-1] = '\0';
hostname = _hostname;
+ } else if (error != 0) {
+ fprintf(stderr, "%s: %s\n", hostname, gai_strerror(error));
+ if (error == EAI_SYSTEM)
+ fprintf(stderr, "%s: %s\n", hostname, strerror(errno));
+ setuid(getuid());
+ return 0;
}
if (srcroute != 0) {
srp = 0;