Skip to content
Snippets Groups Projects
Commit fe96397b authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Add NO_TELNET option to terminal server.

parent 0360643a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -5173,6 +5173,7 @@ void DLLCALL bbs_thread(void* arg) ...@@ -5173,6 +5173,7 @@ void DLLCALL bbs_thread(void* arg)
cleanup(1); cleanup(1);
return; return;
} }
if (!(startup->options & BBS_OPT_NO_TELNET)) {
telnet_cb.protocol="telnet"; telnet_cb.protocol="telnet";
telnet_cb.startup=startup; telnet_cb.startup=startup;
...@@ -5180,6 +5181,7 @@ void DLLCALL bbs_thread(void* arg) ...@@ -5180,6 +5181,7 @@ void DLLCALL bbs_thread(void* arg)
* Add interfaces * Add interfaces
*/ */
xpms_add_list(ts_set, PF_UNSPEC, SOCK_STREAM, 0, startup->telnet_interfaces, startup->telnet_port, "Telnet Server", sock_cb, startup->seteuid, &telnet_cb); xpms_add_list(ts_set, PF_UNSPEC, SOCK_STREAM, 0, startup->telnet_interfaces, startup->telnet_port, "Telnet Server", sock_cb, startup->seteuid, &telnet_cb);
}
if(startup->options&BBS_OPT_ALLOW_RLOGIN) { if(startup->options&BBS_OPT_ALLOW_RLOGIN) {
/* open a socket and wait for a client */ /* open a socket and wait for a client */
......
...@@ -2050,7 +2050,8 @@ int main(int argc, char** argv) ...@@ -2050,7 +2050,8 @@ int main(int argc, char** argv)
/* If DONT_BLAME_SYNCHRONET is set, keeps root credentials laying around */ /* If DONT_BLAME_SYNCHRONET is set, keeps root credentials laying around */
#if !defined(DONT_BLAME_SYNCHRONET) #if !defined(DONT_BLAME_SYNCHRONET)
if(!thread_suid_broken) { if(!thread_suid_broken) {
if(bbs_startup.telnet_port < IPPORT_RESERVED if(((bbs_startup.options & BBS_OPT_NO_TELNET) == 0
&& bbs_startup.telnet_port < IPPORT_RESERVED)
|| ((bbs_startup.options & BBS_OPT_ALLOW_RLOGIN) || ((bbs_startup.options & BBS_OPT_ALLOW_RLOGIN)
&& bbs_startup.rlogin_port < IPPORT_RESERVED) && bbs_startup.rlogin_port < IPPORT_RESERVED)
#ifdef USE_CRYPTLIB #ifdef USE_CRYPTLIB
......
...@@ -177,6 +177,7 @@ static struct init_field { ...@@ -177,6 +177,7 @@ static struct init_field {
#define BBS_OPT_ALLOW_SSH (1<<12) /* Allow logins via BSD SSH */ #define BBS_OPT_ALLOW_SSH (1<<12) /* Allow logins via BSD SSH */
#define BBS_OPT_NO_DOS (1<<13) /* Don't attempt to run 16-bit DOS programs */ #define BBS_OPT_NO_DOS (1<<13) /* Don't attempt to run 16-bit DOS programs */
#define BBS_OPT_NO_NEWDAY_EVENTS (1<<14) /* Don't check for a new day in event thread */ #define BBS_OPT_NO_NEWDAY_EVENTS (1<<14) /* Don't check for a new day in event thread */
#define BBS_OPT_NO_TELNET (1<<15) /* Don't accept incoming telnet connections */
#define BBS_OPT_HAPROXY_PROTO (1<<26) /* Incoming requests are via HAproxy */ #define BBS_OPT_HAPROXY_PROTO (1<<26) /* Incoming requests are via HAproxy */
#define BBS_OPT_NO_RECYCLE (1<<27) /* Disable recycling of server */ #define BBS_OPT_NO_RECYCLE (1<<27) /* Disable recycling of server */
#define BBS_OPT_GET_IDENT (1<<28) /* Get Identity (RFC 1413) */ #define BBS_OPT_GET_IDENT (1<<28) /* Get Identity (RFC 1413) */
...@@ -203,6 +204,7 @@ static ini_bitdesc_t bbs_options[] = { ...@@ -203,6 +204,7 @@ static ini_bitdesc_t bbs_options[] = {
{ BBS_OPT_ALLOW_SSH ,"ALLOW_SSH" }, { BBS_OPT_ALLOW_SSH ,"ALLOW_SSH" },
{ BBS_OPT_NO_DOS ,"NO_DOS" }, { BBS_OPT_NO_DOS ,"NO_DOS" },
{ BBS_OPT_NO_NEWDAY_EVENTS ,"NO_NEWDAY_EVENTS" }, { BBS_OPT_NO_NEWDAY_EVENTS ,"NO_NEWDAY_EVENTS" },
{ BBS_OPT_NO_TELNET ,"NO_TELNET" },
{ BBS_OPT_NO_RECYCLE ,"NO_RECYCLE" }, { BBS_OPT_NO_RECYCLE ,"NO_RECYCLE" },
{ BBS_OPT_GET_IDENT ,"GET_IDENT" }, { BBS_OPT_GET_IDENT ,"GET_IDENT" },
{ BBS_OPT_NO_JAVASCRIPT ,"NO_JAVASCRIPT" }, { BBS_OPT_NO_JAVASCRIPT ,"NO_JAVASCRIPT" },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment