From ec93516a8125d2d4fb6a7d8a7229d977246f63cf Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 30 Dec 2004 02:57:00 +0000
Subject: [PATCH] Created TG_NOTERMTYPE (only used for gating to Unix telnetd).

---
 exec/load/sbbsdefs.js | 5 +++--
 exec/sbbsdefs.inc     | 1 +
 exec/unixgate.src     | 2 +-
 src/sbbs3/sbbsdefs.h  | 1 +
 src/sbbs3/telgate.cpp | 5 +++--
 5 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/exec/load/sbbsdefs.js b/exec/load/sbbsdefs.js
index 4c51a5d824..7bfa652fb2 100644
--- a/exec/load/sbbsdefs.js
+++ b/exec/load/sbbsdefs.js
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2001 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -527,7 +527,8 @@ var   TG_NODESYNC	=(1<<3)		/* Call Nodesync, get msgs, etc.			*/
 var   TG_CTRLKEYS	=(1<<4)		/* Interpret ^P ^U ^T, etc locally			*/
 var   TG_PASSTHRU	=(1<<5)		/* Pass-through telnet commands/responses	*/
 var   TG_RLOGIN		=(1<<6)		/* Use BSD RLogin protocol					*/
-var   TG_NOCHKTIME	=(1<<7)		/* Don't check time left online					*/
+var   TG_NOCHKTIME	=(1<<7)		/* Don't check time left online				*/
+var   TG_NOTERMTYPE =(1<<8)		/* Request client "DONT TERM_TYPE"			*/
 					    		/********************************************/
 
 					    		/********************************************/
diff --git a/exec/sbbsdefs.inc b/exec/sbbsdefs.inc
index b06f46e19c..7cfc979e92 100644
--- a/exec/sbbsdefs.inc
+++ b/exec/sbbsdefs.inc
@@ -192,6 +192,7 @@
 !define TG_PASSTHRU	.5	# Pass-through telnet commands/responses
 !define TG_RLOGIN	.6	# Use BSD RLogin protocol
 !define TG_NOCHKTIME	.7	# Don't check time left online
+!define TG_NOTERMTYPE	.8	# Request client "DONT TERM_TYPE"
 
 				# Bits for _FTP_MODE
 !define FTP_ECHO_CMD	.0	# Echo commands to user (debug)
diff --git a/exec/unixgate.src b/exec/unixgate.src
index cc7df5d8cc..fe0673af82 100644
--- a/exec/unixgate.src
+++ b/exec/unixgate.src
@@ -11,5 +11,5 @@
 printf "\r\n\1h\1hPress \1yCtrl-]\1w for a control menu anytime.\r\n\r\n"
 pause
 printf "\1h\1yConnecting to: \1w%s\1n\r\n" str
-telnet_gate str TG_PASSTHRU
+telnet_gate str TG_PASSTHRU|TG_NOTERMTYPE
 cls
diff --git a/src/sbbs3/sbbsdefs.h b/src/sbbs3/sbbsdefs.h
index 6373dd1e8e..f194ec6fe9 100644
--- a/src/sbbs3/sbbsdefs.h
+++ b/src/sbbs3/sbbsdefs.h
@@ -750,6 +750,7 @@ enum {							/* readmail and delmailidx which types		*/
 #define TG_PASSTHRU		(1<<5)	/* Pass-through telnet commands/responses	*/
 #define TG_RLOGIN		(1<<6)	/* Use BSD RLogin protocol					*/
 #define TG_NOCHKTIME	(1<<7)	/* Don't check time left while gated		*/
+#define TG_NOTERMTYPE	(1<<8)	/* Request client "DONT TERM_TYPE"			*/
 								
 enum {							/* Values for 'mode' in listfileinfo        */
 	 FI_INFO            		/* Just list file information               */
diff --git a/src/sbbs3/telgate.cpp b/src/sbbs3/telgate.cpp
index b02596d8cd..b98a26a25b 100644
--- a/src/sbbs3/telgate.cpp
+++ b/src/sbbs3/telgate.cpp
@@ -133,9 +133,10 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
 		l=p-(char*)buf;
 		sendsocket(remote_socket,(char*)buf,l);
 	}
-	
+
 	/* This is required for gating to Unix telnetd */
-	request_telnet_opt(TELNET_DONT,TELNET_TERM_TYPE);	// Re-negotiation of terminal type
+	if(mode&TG_NOTERMTYPE)
+		request_telnet_opt(TELNET_DONT,TELNET_TERM_TYPE);	// Re-negotiation of terminal type
 
 	/* Text/NVT mode by default */
 	request_telnet_opt(TELNET_DONT,TELNET_BINARY_TX);
-- 
GitLab