From 23de03a0c8bf8a564cc0442f49d050ed11e372b8 Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Mon, 29 Jun 2026 11:36:57 +0100 Subject: New upstream version 6.0.25.33.1+repack --- BBSUtilities.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) (limited to 'BBSUtilities.c') diff --git a/BBSUtilities.c b/BBSUtilities.c index e087e3b..f56e24f 100644 --- a/BBSUtilities.c +++ b/BBSUtilities.c @@ -7368,6 +7368,14 @@ VOID SetupForwardingStruct(struct UserInfo * user) ForwardingInfo->AllowB2 = GetIntValue(group, "UseB2Protocol"); ForwardingInfo->SendCTRLZ = GetIntValue(group, "SendCTRLZ"); + // Don't allow blocked uncompressed + + if (ForwardingInfo->AllowBlocked) + ForwardingInfo->AllowCompressed = 1; + + if (ForwardingInfo->AllowCompressed) + ForwardingInfo->AllowBlocked = 1; + if (ForwardingInfo->AllowB1 || ForwardingInfo->AllowB2) ForwardingInfo->AllowCompressed = TRUE; @@ -9346,14 +9354,18 @@ VOID Parse_SID(CIRCUIT * conn, char * SID, int len) } } - // Only allow blocked non-binary to other BPQ Nodes + // No longer Only blocked non-binary to other BPQ Nodes if ((conn->BBSFlags & FBBForwarding) && ((conn->BBSFlags & FBBCompressed) == 0) && (conn->BPQBBS == 0)) { - // Switch back to MBL + // Disconnect user + + Logprintf(LOG_BBS, conn, '?', "Uncompressed Blocked Forwarding is no longer supported - reconfgure BBS for MBL forwarding"); + + conn->BBSFlags &= ~RunningConnectScript; // so it doesn't get reentered + Disconnect(conn->BPQStream); + return ; - conn->BBSFlags |= MBLFORWARDING; - conn->BBSFlags &= ~FBBForwarding; // Turn off FBB Blocked } return; @@ -12048,6 +12060,7 @@ void run_pg(CIRCUIT * conn, struct UserInfo * user) FILE *iop; int argc, pdes[2]; pid_t pid; + int i; pgret = 9999; @@ -12057,6 +12070,20 @@ void run_pg(CIRCUIT * conn, struct UserInfo * user) conn->InputBuffer[conn->InputLen] = 0; strlop(conn->InputBuffer, 13); + + // validate command is alphanumberic + + for (i = 0; i < conn->InputLen; i++) + { + if (isalnum(conn->InputBuffer[i]) == 0 && conn->InputBuffer[i] != ' ') + { + BBSputs(conn, "PG commnand string invalid\r"); + conn->InputMode=0; + SendPrompt(conn, user); + return; + } + } + conn->InputLen = 0; if (!user->Temp->RUNPGPARAMS) @@ -12088,7 +12115,7 @@ void run_pg(CIRCUIT * conn, struct UserInfo * user) char pg_dir[MAX_PATH]; char log_file[50] = "pg.log"; char call[10]; - char data[80]; + char data[256]; char line[80]; size_t bufsize = 80; @@ -12307,6 +12334,7 @@ void run_pg( CIRCUIT * conn, struct UserInfo * user ) CHAR chBuf[BUFSIZE]; int index = 0; int ret = 0; + int i; // if first entry allocate RUNPGPARAMS if (!user->Temp->RUNPGPARAMS) @@ -12322,6 +12350,20 @@ void run_pg( CIRCUIT * conn, struct UserInfo * user ) conn->InputBuffer[conn->InputLen] = 0; strlop(conn->InputBuffer, 13); + + // validate command is alphanumberic + + for (i = 0; i < strlen(conn->InputBuffer); i++) + { + if (isalnum(conn->InputBuffer[i]) == 0 && conn->InputBuffer[i] != ' ') + { + BBSputs(conn, "PG commnand string invalid\r"); + conn->InputMode=0; + SendPrompt(conn, user); + return; + } + } + conn->InputLen = 0; // Build command line. Parmas are: -- cgit v1.2.3