diff options
author | no author <devnull@mit.edu> | 2003-04-09 00:10:14 +0000 |
---|---|---|
committer | no author <devnull@mit.edu> | 2003-04-09 00:10:14 +0000 |
commit | 9dc0f646d42648fbbde44799c00b25d97d9cbc98 (patch) | |
tree | d7e1bad8215f92673f94df55881b676002da7e8b /src/appl/telnet/telnetd/state.c | |
parent | 38037332d7af42124646c268874e0833bd8ec30e (diff) | |
download | krb5-9dc0f646d42648fbbde44799c00b25d97d9cbc98.zip krb5-9dc0f646d42648fbbde44799c00b25d97d9cbc98.tar.gz krb5-9dc0f646d42648fbbde44799c00b25d97d9cbc98.tar.bz2 |
This commit was manufactured by cvs2svn to create tagkrb5-1.2.8-final
'krb5-1-2-8-final'.
git-svn-id: svn://anonsvn.mit.edu/krb5/tags/krb5-1-2-8-final@15331 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl/telnet/telnetd/state.c')
-rw-r--r-- | src/appl/telnet/telnetd/state.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/appl/telnet/telnetd/state.c b/src/appl/telnet/telnetd/state.c index 0f3b161..d783ed6 100644 --- a/src/appl/telnet/telnetd/state.c +++ b/src/appl/telnet/telnetd/state.c @@ -86,7 +86,7 @@ static void sb_auth_complete() if (!auth_negotiated) { static char *error = "An environment option was sent before authentication negotiation completed.\r\nThis may create a security hazard. Connection dropped.\r\n"; - writenet(error, strlen(error)); + netputs(error); netflush(); exit(1); } @@ -102,7 +102,7 @@ telrcv() #endif while (ncc > 0) { - if ((&ptyobuf[BUFSIZ] - pfrontp) < 2) + if ((&ptyobuf[BUFSIZ] - pfrontp) < 1) break; c = *netip++ & 0377, ncc--; #ifdef ENCRYPTION @@ -209,9 +209,7 @@ gotiac: switch (c) { } netclear(); /* clear buffer back */ - *nfrontp++ = IAC; - *nfrontp++ = DM; - neturg = nfrontp-1; /* off by one XXX */ + netprintf_urg("%c%c", IAC, DM); DIAG(TD_OPTIONS, printoption("td: send IAC", DM)); break; @@ -381,9 +379,12 @@ gotiac: switch (c) { pfrontp = opfrontp; pfrontp += term_input(xptyobuf, pfrontp, n, BUFSIZ+NETSLOP, xbuf2, &oc, BUFSIZ); - for (cp = xbuf2; oc > 0; --oc) - if ((*nfrontp++ = *cp++) == IAC) - *nfrontp++ = IAC; + for (cp = xbuf2; oc > 0; --oc) { + if (*cp == IAC) + netprintf("%c%c", *cp++, IAC); + else + netprintf("%c", *cp++); + } } #endif /* defined(CRAY2) && defined(UNICOS5) */ } /* end of telrcv */ @@ -463,8 +464,7 @@ send_do(option, init) set_his_want_state_will(option); do_dont_resp[option]++; } - (void) sprintf(nfrontp, (char *)doopt, option); - nfrontp += sizeof (dont) - 2; + netprintf((char *)doopt, option); DIAG(TD_OPTIONS, printoption("td: send do", option)); } @@ -683,8 +683,7 @@ send_dont(option, init) set_his_want_state_wont(option); do_dont_resp[option]++; } - (void) sprintf(nfrontp, (char *)dont, option); - nfrontp += sizeof (doopt) - 2; + netprintf((char *)dont, option); DIAG(TD_OPTIONS, printoption("td: send dont", option)); } @@ -833,8 +832,7 @@ send_will(option, init) set_my_want_state_will(option); will_wont_resp[option]++; } - (void) sprintf(nfrontp, (char *)will, option); - nfrontp += sizeof (doopt) - 2; + netprintf((char *)will, option); DIAG(TD_OPTIONS, printoption("td: send will", option)); } @@ -993,8 +991,7 @@ send_wont(option, init) set_my_want_state_wont(option); will_wont_resp[option]++; } - (void) sprintf(nfrontp, (char *)wont, option); - nfrontp += sizeof (wont) - 2; + netprintf((char *)wont, option); DIAG(TD_OPTIONS, printoption("td: send wont", option)); } @@ -1393,10 +1390,8 @@ suboption() env_ovar_wrong: env_ovar = OLD_ENV_VALUE; env_ovalue = OLD_ENV_VAR; - DIAG(TD_OPTIONS, {sprintf(nfrontp, - "ENVIRON VALUE and VAR are reversed!\r\n"); - nfrontp += strlen(nfrontp);}); - + DIAG(TD_OPTIONS, + netputs("ENVIRON VALUE and VAR are reversed!\r\n")); } } SB_RESTORE(); @@ -1633,7 +1628,7 @@ send_status() ADD(IAC); ADD(SE); - writenet(statusbuf, ncp - statusbuf); + netwrite(statusbuf, ncp - statusbuf); netflush(); /* Send it on its way */ DIAG(TD_OPTIONS, @@ -1663,6 +1658,8 @@ static int envvarok(varp) strcmp(varp, "KRB_REALMS") && /* cns v4 */ strcmp(varp, "LIBPATH") && /* AIX */ strcmp(varp, "RESOLV_HOST_CONF") && /* linux */ + strcmp(varp, "NLSPATH") && /* locale stuff */ + strncmp(varp, "LC_", strlen("LC_")) && /* locale stuff */ strcmp(varp, "IFS")) { return 1; } else { |