From 1957b394d32029a0ec2e29152fab197ba2b87151 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 4 Aug 2004 04:54:40 +0000
Subject: [PATCH] Created NO_SPY_SOCKETS option for BBS server.

---
 src/sbbs3/ini_opts.h | 1 +
 src/sbbs3/main.cpp   | 2 +-
 src/sbbs3/startup.h  | 3 ++-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sbbs3/ini_opts.h b/src/sbbs3/ini_opts.h
index 9022eb3fd3..9b49ba98a2 100644
--- a/src/sbbs3/ini_opts.h
+++ b/src/sbbs3/ini_opts.h
@@ -50,6 +50,7 @@ static ini_bitdesc_t bbs_options[] = {
 	{ BBS_OPT_NO_TELNET_GA			,"NO_TELNET_GA"			},
 	{ BBS_OPT_NO_EVENTS				,"NO_EVENTS"			},
 	{ BBS_OPT_NO_HOST_LOOKUP		,"NO_HOST_LOOKUP"		},
+	{ BBS_OPT_NO_SPY_SOCKETS		,"NO_SPY_SOCKETS"		},
 	{ BBS_OPT_NO_RECYCLE			,"NO_RECYCLE"			},
 	{ BBS_OPT_GET_IDENT				,"GET_IDENT"			},
 	{ BBS_OPT_NO_JAVASCRIPT			,"NO_JAVASCRIPT"		},
diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index 22eeb576e9..cc7903c86a 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -4014,7 +4014,7 @@ void DLLCALL bbs_thread(void* arg)
 	}
 
 #ifdef __unix__	//	unix-domain spy sockets
-	for(i=first_node;i<=last_node;i++)  {
+	for(i=first_node;i<=last_node && !(startup->options&BBS_OPT_NO_SPY_SOCKETS);i++)  {
 	    if((uspy_listen_socket[i-1]=socket(PF_UNIX,SOCK_STREAM,0))==INVALID_SOCKET)
 	        lprintf(LOG_ERR,"Node %d !ERROR %d creating local spy socket"
 	            , i, errno);
diff --git a/src/sbbs3/startup.h b/src/sbbs3/startup.h
index fdd6c223a9..6ce9d29b33 100644
--- a/src/sbbs3/startup.h
+++ b/src/sbbs3/startup.h
@@ -131,7 +131,8 @@ typedef struct {
 #define BBS_OPT_USE_2ND_RLOGIN		(1<<6)	/* Use 2nd username in BSD RLogin	*/
 #define BBS_OPT_NO_QWK_EVENTS		(1<<7)	/* Don't run QWK-related events		*/
 #define BBS_OPT_NO_TELNET_GA		(1<<8)	/* Don't send periodic Telnet GAs	*/
-#define BBS_OPT_NO_EVENTS			(1<<9)	/* Don't run event thread */
+#define BBS_OPT_NO_EVENTS			(1<<9)	/* Don't run event thread			*/
+#define BBS_OPT_NO_SPY_SOCKETS		(1<<10	/* Don't create spy sockets			*/
 #define BBS_OPT_NO_HOST_LOOKUP		(1<<11)
 #define BBS_OPT_NO_RECYCLE			(1<<27)	/* Disable recycling of server		*/
 #define BBS_OPT_GET_IDENT			(1<<28)	/* Get Identity (RFC 1413)			*/
-- 
GitLab