Skip to content
Snippets Groups Projects
Commit bb651465 authored by rswindell's avatar rswindell
Browse files

Implement a new telnet gateway (telgate) mode flag: TG_RLOGINSWAP

Using this flag swaps the alias and real-names as passed in the first 2
fields of the RLogin authentication/negotiation (client-user-name and
server-user-name).
parent 84edd03b
No related branches found
No related tags found
No related merge requests found
......@@ -800,6 +800,7 @@ enum { /* readmail and delmailidx which types */
#define TG_NOTERMTYPE (1<<8) /* Request client "DONT TERM_TYPE" */
#define TG_SENDPASS (1<<9) /* Send password instead of real name (RLogin) - DEPRECATED (it sent the password as the server user name) */
#define TG_NOLF (1<<10) /* Do not send line-feeds (opposite of TG_CRLF) */
#define TG_RLOGINSWAP (1<<11) /* Swap the RLogin alias/real-names */
enum { /* Values for 'mode' in listfileinfo */
FI_INFO /* Just list file information */
......
......@@ -117,11 +117,15 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode, char* client_user_name, cha
console|=CON_RAW_IN;
if(mode&TG_RLOGIN) {
if (client_user_name == NULL)
client_user_name = (mode&TG_RLOGINSWAP) ? useron.name : useron.alias;
if (server_user_name == NULL)
server_user_name = (mode&TG_RLOGINSWAP) ? useron.alias : useron.name;
p=(char*)buf;
*(p++)=0;
p+=sprintf(p,"%s",client_user_name==NULL ? useron.alias : client_user_name);
p+=sprintf(p,"%s",client_user_name);
p++; // Add NULL
p+=sprintf(p,"%s",server_user_name==NULL ? useron.name : server_user_name);
p+=sprintf(p,"%s",server_user_name);
p++; // Add NULL
if(term_type!=NULL)
p+=sprintf(p,"%s",term_type);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment