summaryrefslogtreecommitdiffstats
path: root/contrib/telnet
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-07-28 18:58:16 +0000
committerjhb <jhb@FreeBSD.org>2008-07-28 18:58:16 +0000
commit3bc77fdd97f49077e9a19c9e4f98a4d4026e379a (patch)
treeae9c44d4e92792fa99bd52b1eaae503e6f679d93 /contrib/telnet
parent421b41fe8c8f841f86d9032fa3cf7c9726f7bd96 (diff)
downloadFreeBSD-src-3bc77fdd97f49077e9a19c9e4f98a4d4026e379a.zip
FreeBSD-src-3bc77fdd97f49077e9a19c9e4f98a4d4026e379a.tar.gz
Don't attempt authentication at all if it has been disabled via '-a off'.
This works around a bug in HP-UX's telnet client and also gives a much saner user experience when using FreeBSD's telnet client. PR: bin/19405 Submitted by: Joel Ray Holveck joelh of gnu.org MFC after: 1 month
Diffstat (limited to 'contrib/telnet')
-rw-r--r--contrib/telnet/telnetd/state.c6
-rw-r--r--contrib/telnet/telnetd/telnetd.c12
2 files changed, 11 insertions, 7 deletions
diff --git a/contrib/telnet/telnetd/state.c b/contrib/telnet/telnetd/state.c
index 9db4516..300421f 100644
--- a/contrib/telnet/telnetd/state.c
+++ b/contrib/telnet/telnetd/state.c
@@ -553,8 +553,10 @@ willoption(int option)
#ifdef AUTHENTICATION
case TELOPT_AUTHENTICATION:
- func = auth_request;
- changeok++;
+ if (auth_level >= 0) {
+ func = auth_request;
+ changeok++;
+ }
break;
#endif
diff --git a/contrib/telnet/telnetd/telnetd.c b/contrib/telnet/telnetd/telnetd.c
index a790c89..ad1e459 100644
--- a/contrib/telnet/telnetd/telnetd.c
+++ b/contrib/telnet/telnetd/telnetd.c
@@ -481,11 +481,13 @@ getterminaltype(char *name undef2)
/*
* Handle the Authentication option before we do anything else.
*/
- send_do(TELOPT_AUTHENTICATION, 1);
- while (his_will_wont_is_changing(TELOPT_AUTHENTICATION))
- ttloop();
- if (his_state_is_will(TELOPT_AUTHENTICATION)) {
- retval = auth_wait(name);
+ if (auth_level >= 0) {
+ send_do(TELOPT_AUTHENTICATION, 1);
+ while (his_will_wont_is_changing(TELOPT_AUTHENTICATION))
+ ttloop();
+ if (his_state_is_will(TELOPT_AUTHENTICATION)) {
+ retval = auth_wait(name);
+ }
}
#endif
OpenPOWER on IntegriCloud