diff --git a/telnetd/state.c b/telnetd/state.c index 9db4516..300421f 100644 --- a/telnetd/state.c +++ b/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/telnetd/telnetd.c b/telnetd/telnetd.c index a790c89..ad1e459 100644 --- a/telnetd/telnetd.c +++ b/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