From 3bc77fdd97f49077e9a19c9e4f98a4d4026e379a Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 28 Jul 2008 18:58:16 +0000 Subject: 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 --- contrib/telnet/telnetd/state.c | 6 ++++-- contrib/telnet/telnetd/telnetd.c | 12 +++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'contrib/telnet') 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 -- cgit v1.1