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
This commit is contained in:
John Baldwin 2008-07-28 18:58:16 +00:00
parent f7f1cc1518
commit 2e38385526
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180931
2 changed files with 11 additions and 7 deletions

View File

@ -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

View File

@ -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