Merge branch 'debian/latest' into debian/bookworm

This commit is contained in:
Hibby 2024-09-25 01:38:21 +01:00
commit 313013b516
Signed by: hibby
SSH Key Fingerprint: SHA256:Y6XbnzN0FEB1R/exPF5hUbHUgE/Nn7M1uT566fxo6pE
41 changed files with 3763 additions and 4760 deletions

2129
6pack.c Normal file

File diff suppressed because it is too large Load Diff

12
ARDOP.c
View File

@ -880,6 +880,17 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
}
}
// Check ATTACH time limit
if (STREAM->Attached)
{
if (STREAM->AttachTime && TNC->AttachTimeLimit && time(NULL) > (TNC->AttachTimeLimit + STREAM->AttachTime))
{
STREAM->ReportDISC = 1;
STREAM->AttachTime = 0;
}
}
if (TNC->ARDOPCommsMode != 'T') // S I or E
{
ARDOPSCSCheckRX(TNC);
@ -1190,6 +1201,7 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
Debugprintf("ARDOP New Attach Stream %d DEDStream %d", Stream, STREAM->DEDStream);
STREAM->Attached = TRUE;
STREAM->AttachTime = time(NULL);
calllen = ConvFromAX25(TNC->PortRecord->ATTACHEDSESSIONS[Stream]->L4USER, TNC->Streams[Stream].MyCall);
TNC->Streams[Stream].MyCall[calllen] = 0;

View File

@ -11762,300 +11762,258 @@ BOOL CheckforMIME(SocketConn * sockptr, char * Msg, char ** Body, int * MsgLen);
#include <sys/wait.h>
#include <signal.h>
typedef struct _POPENRET
{
FILE * fp;
pid_t pid;
} POPENRET;
// G8BPQ Version of Steve G7TAJ's code
/*
* Check if the PG is still running after 5 sec
* if so, kill it
int pgret = 9999;
int pindex = 0;
void sigchild_handler(int sig , siginfo_t * siginfo, void * ucontext)
{
/* • SIGCHLD fills in si_pid, si_uid, si_status, si_utime, and
si_stime, providing information about the child. The si_pid
field is the process ID of the child; si_uid is the child's
real user ID. The si_status field contains the exit status of
the child (if si_code is CLD_EXITED), or the signal number
that caused the process to change state.
*/
void run_pgTimeoutThread( pid_t process )
{
// printf("watchdog thread: PID of subprocess: %d\n", process);
// fflush(stdout);
Sleep(5000);
// if still running PID (?) then kill.
if ( getpgid(process) >= 0 )
{
Debugprintf("watchdog thread: Still running, so killing %d ... ", process);
if ( kill( -process, SIGKILL ) == 0 )
Debugprintf("Killed PG watchdog Process %d", process);
else
Debugprintf("Failed to kill PG watchdog Process %d", process);
}
// Debugprintf("watchdog thread: PID=%d Exit", process);
// fflush(stdout);
// printf("SIGCHLD PID %d Code %d status %d\n", siginfo->si_pid, siginfo->si_code, siginfo->si_status);
pgret = siginfo->si_status;
}
//https://sources.debian.org/src/cron/3.0pl1-45/popen.c/
POPENRET my_popen(char *program, char *type, CIRCUIT *conn)
void run_pg(CIRCUIT * conn, struct UserInfo * user)
{
register char *cp;
FILE *iop;
int argc, pdes[2];
pid_t pid;
POPENRET PRET;
if (*type != 'r' && *type != 'w' || type[1])
return(PRET);
if (pipe(pdes) < 0)
return(PRET);
pgret = 9999;
int index = user->Temp->PG_INDEX;
iop = NULL;
switch(pid = fork()) {
conn->InputBuffer[conn->InputLen] = 0;
strlop(conn->InputBuffer, 13);
conn->InputLen = 0;
if (!user->Temp->RUNPGPARAMS)
user->Temp->RUNPGPARAMS = (RUNPGARGS_PTR) zalloc(sizeof(RUNPGARGS));
user->Temp->RUNPGPARAMS->user = user;
user->Temp->RUNPGPARAMS->conn = conn;
strncpy(user->Temp->RUNPGPARAMS->InputBuffer, conn->InputBuffer, 80); // needs to be length of actual input!
user->Temp->RUNPGPARAMS->Len = conn->InputLen;
if (conn == 0 || user == 0)
{
Debugprintf("run_pg conn or user null");
return;
}
// Build command line. Parmas are:
// - Callsign (format as F6FBB-8).
// - Level number (0 is the first time, up to 99).
// - Flags of the user (binary number as user`s mask of INIT.SRV).
// - Record number of the user in INF.SYS.
// - Received data (each word is a new argument).
// BPQ doesn't support params 3 and 4 (but may supply copy of user record later)
char cmd[20];
char *ptr = cmd;
char pg_dir[MAX_PATH];
char log_file[50] = "pg.log";
char call[10];
char data[80];
char line[80];
size_t bufsize = 80;
strcpy(pg_dir, BaseDir);
strcat(pg_dir, "/PG/");
sprintf(cmd, "./%s", SERVERLIST[user->Temp->PG_SERVER][1] );
sprintf(line, "%s%s", pg_dir, SERVERLIST[user->Temp->PG_SERVER][1]);
// printf("PG Prog %s%s\n", pg_dir, SERVERLIST[user->Temp->PG_SERVER][1]);
// check file exists and is executable
if (access(line, F_OK) == -1 || access(line, X_OK) == -1)
{
Debugprintf("%s FileNotFound || not executable", line);
BBSputs(conn, "Error running PG Server\r");
conn->InputMode=0;
SendPrompt(conn, user);
return;
}
strcpy(call, conn->UserPointer->Call);
index = user->Temp->PG_INDEX;
// remove ';' from input for security reasons
ptr = strchr(user->Temp->RUNPGPARAMS->InputBuffer, ';');
if (ptr)
*ptr = '\0';
sprintf(data, "%s %d 0 0 %s", call, index, user->Temp->RUNPGPARAMS->InputBuffer);
// printf("PG Params %s\n", data);
conn->InputBufferLen = 0;
char buf[256];
sprintf (buf, "%s %s", line, data); // buf is command to exec
// printf ("PG exec cmd %s\n", buf);
// Create pipe for reading PG program STDOUT
if (pipe(pdes) < 0)
{
Debugprintf("run_pg pipe failed");
BBSputs(conn, "Error running PG Server (pipe() failed)\r");
conn->InputMode=0;
SendPrompt(conn, user);
return;
}
// We will just fork and execute program. For now don't create a new thread
// Trap sigchild so we can tell when it exits and get return code
struct sigaction act;
memset(&act, 0, sizeof(struct sigaction));
act.sa_flags = SA_RESETHAND | SA_SIGINFO; // Restore default handler when called
act.sa_sigaction = sigchild_handler;
sigaction(SIGCHLD, &act, NULL);
switch(pid = fork())
{
case -1: /* error */
(void)close(pdes[0]);
(void)close(pdes[1]);
return PRET;
Debugprintf("run_pg fork failed");
BBSputs(conn, "Error running PG Server (fork() failed)\r");
conn->InputMode=0;
SendPrompt(conn, user);
return;
case 0: /* child */
if (*type == 'r') {
if (pdes[1] != 1) {
if (pdes[1] != 1)
{
dup2(pdes[1], 1);
dup2(pdes[1], 2);
(void)close(pdes[1]);
}
(void)close(pdes[0]);
} else {
if (pdes[0] != 0) {
dup2(pdes[0], 0);
(void)close(pdes[0]);
}
(void)close(pdes[1]);
}
setpgid(-pid,pid);
char *args[] = {"sh", "-c", program, NULL};
setpgid(0, pid);
char *args[] = {"sh", "-c", buf, NULL};
execve("/bin/sh", args, NULL);
_exit(1);
}
/* parent */
_beginthread((void (*)(void *))run_pgTimeoutThread, 0, (VOID *) pid );
// printf("child PID %d\n", pid);
if (*type == 'r') {
iop = fdopen(pdes[0], type);
(void)close(pdes[1]);
} else {
iop = fdopen(pdes[1], type);
(void)close(pdes[0]);
struct timespec duration;
duration.tv_sec = 5;
duration.tv_nsec = 0;
nanosleep(&duration, &duration); // Will be interrupted by SIGCHLD
// printf("PG retcode %d\n", pgret);
if (pgret == 9999) // Process still running
{
BBSputs(conn, "PG Program Looping\r");
kill(pid, SIGKILL);
user->Temp->PG_INDEX = 0;
conn->InputMode=0;
SendPrompt(conn, user);
return;
}
if (pgret > 127)
{
// Probably killed by signal
int err = pgret - 128;
char errmsg[256];
sprintf(errmsg, "PG Signal %s received\n", strsignal(err));
BBSputs(conn, errmsg);
user->Temp->PG_INDEX = 0;
conn->InputMode=0;
SendPrompt(conn, user);
return;
}
// Send STDOUT from PG program to BBS user
iop = fdopen(pdes[0], "r");
(void)close(pdes[1]);
char buffer[128];
while (fgets(buffer, sizeof(buffer), iop) != NULL)
{
BBSputs(conn, buffer);
buffer[0] = '\0';
}
PRET.fp = iop;
PRET.pid= pid;
return(PRET);
}
int
my_pclose( POPENRET pret )
{
register int fdes;
sigset_t omask, mask;
int stat_loc;
pid_t pid;
FILE * iop = pret.fp;
fdes = fileno(iop);
(void)fclose(iop);
sigemptyset(&mask);
sigaddset(&mask, SIGQUIT);
sigaddset(&mask, SIGINT);
sigaddset(&mask, SIGHUP);
sigprocmask(SIG_BLOCK, &mask, &omask);
pid = waitpid(pret.pid, &stat_loc, 0);
sigprocmask(SIG_SETMASK, &omask, NULL);
if (pid == -1 || !WIFEXITED(stat_loc))
return -1;
return stat_loc;
}
int run_server (char **cmd, int nb_cmd, int mode, char *log, char *pgdir, char *data, CIRCUIT * conn)
{
int i;
int ret = 0;
FILE *fp;
POPENRET PRET;
pid_t pid;
char *ptr;
char file[256];
char buf[256];
char dir[256];
char arg[256];
if (mode)
// sprintf (file, " >>%s", log);
// sprintf (file, " | tee -a %s", log);
sprintf(file, "" );
else
sprintf (file, " </dev/null");
if (pgdir)
{
/* remove ';' security reasons */
ptr = strchr(pgdir, ';');
if (ptr)
*ptr = '\0';
sprintf (dir, "cd %s ; ", pgdir);
}
else
*dir = '\0';
*arg = '\0';
if (data)
{
/* remove ';' security reasons */
ptr = strchr(data, ';');
if (ptr)
*ptr = '\0';
sprintf (arg, " %s ", data);
}
for (i = 0; i < nb_cmd; i++)
{
/* remove ';' security reasons */
ptr = strchr(cmd[i], ';');
if (ptr)
*ptr = '\0';
sprintf (buf, "%s%s%s%s", dir, cmd[i], arg, file);
PRET = my_popen (buf, "r", conn);
if (PRET.fp == NULL)
Debugprintf ("Failed to run PG command %s\n", cmd[i] );
ret = my_pclose( PRET );
ret = ret >> 8;
if (verbose) {
Debugprintf ("Debug: command = {%s}\n", buf);
Debugprintf ("Debug: exit code = %d\n", ret);
}
/* fail-safe bypass if executable isn't found (exit code 127) (was ret ==127)*/
if (ret > 5) // should never be more than 5
ret = 0;
}
return ( ret );
}
void run_pg( CIRCUIT * conn, struct UserInfo * user )
{
if (!user->Temp->RUNPGPARAMS) {
user->Temp->RUNPGPARAMS = (RUNPGARGS_PTR) zalloc(sizeof(RUNPGARGS));
}
user->Temp->RUNPGPARAMS->user = user;
user->Temp->RUNPGPARAMS->conn = conn;
strncpy(user->Temp->RUNPGPARAMS->InputBuffer, conn->InputBuffer, 80); // needs to be length of actual input!
user->Temp->RUNPGPARAMS->Len = conn->InputLen;
if ( conn == 0 || user == 0 ) {
Debugprintf("run_pg null err");
return;
}
_beginthread((void (*)(void *))startrun_pgThread, 0, user->Temp->RUNPGPARAMS );
return;
}
void startrun_pgThread( RUNPGARGS_PTR Args ) {
CIRCUIT * conn = Args->conn;
struct UserInfo * user = Args->user;
char cmd[20];
sprintf( cmd, "./%s", SERVERLIST[user->Temp->PG_SERVER][1] );
char *ptr = cmd;
char pg_dir[MAX_PATH];
char log_file[50] = "pg.log";
char call[6];
char data[80];
char line[80];
char *line_ptr = line;
int index;
char *data_ptr = data;
size_t bufsize = 80;
strcpy(pg_dir, BaseDir);
strcat(pg_dir, "/PG/");
sprintf(line, "%s%s", pg_dir, SERVERLIST[user->Temp->PG_SERVER][1]);
// check file exists and is executable
if (access(line, F_OK) == -1 || access(line, X_OK) == -1) {
Debugprintf("%s FileNotFound || Not EXE", line);
BBSputs(conn, "Error running PG Server\r");
conn->InputMode=0;
SendPrompt(conn, user);
return;
}
strcpy( call, conn->UserPointer->Call);
// sprintf( log_file, "%s-%d.log", call, conn);
index = user->Temp->PG_INDEX;
line[0] = '\0';
int Len = Args->Len;
UCHAR * Msg = Args->InputBuffer;
strncpy( line, Msg, Len);
line[ Len - 1 ] = 0; //remove LF
sprintf( data, "%s %d 0 0 %s", call, index, line);
// clear the input queue
conn->InputLen = 0;
conn->InputBufferLen = 0;
int ret = run_server (&ptr, 1, 1, log_file, pg_dir, data_ptr, conn);
switch (ret)
switch (pgret)
{
case -1: // ERROR or forced closed
case 0: index=0; // Goodbye/Exit
case 0:
index=0; // Goodbye/Exit
conn->InputMode=0;
SendPrompt(conn, user);
break;
case 1: index++; // inc & keep in PG
case 1:
index++; // inc & keep in PG
break;
case 2: index=0; // disconnect
case 2:
index=0; // disconnect
conn->InputMode=0;
Disconnect(conn->BPQStream);
break;
case 3: Debugprintf("data->BBS & end");
break;
case 4: Debugprintf("data->BBS and inc %d", index++);
break;
case 5: Debugprintf("call no inc %d", ret);
case 3:
Debugprintf("data->BBS & end");
break;
case 4:
Debugprintf("data->BBS and inc %d", pindex++);
break;
case 5:
Debugprintf("call no inc %d", pgret);
break;
default:
BBSputs(conn, "PG unexexpected response\r");
user->Temp->PG_INDEX = 0;
conn->InputMode=0;
SendPrompt(conn, user);
return;
}
user->Temp->PG_INDEX=index;
user->Temp->PG_INDEX = index;
// printf("runpg return index = %d\n", index);
}
/*---- G7TAJ END ----- */
#else
@ -12076,7 +12034,7 @@ void ReadFromPipe(void);
void run_pg( CIRCUIT * conn, struct UserInfo * user )
{
// Run PG program, rend anything from program's stdout to the user
// Run PG program, read anything from program's stdout to the user
int retcode = -1;
SECURITY_ATTRIBUTES saAttr;
@ -12251,7 +12209,7 @@ void run_pg( CIRCUIT * conn, struct UserInfo * user )
case 4:
// Send Output to BBS - was down above
// Send Output to BBS - was done above
break;
case 5:

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -1137,6 +1137,7 @@
// Improve "New User" frequency determination (39)
// Allow selection of 2 or 4 character country codes for forward processing (39)
// Fix Send P to multiple BBS's when routing on HR (40)
// Rewrite PG server code on Lunux (41)
#include "bpqmail.h"
#include "winstdint.h"

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -1219,6 +1219,9 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Fix ICF8101 Mode setting (37)
// Kill link if we are getting repeated RR(F) after timeout
// (Indicating other station is seeing our RR(P) but not the resent I frame) (40)
// Change default of SECURETELNET to 1 (41)
// Add optional ATTACH time limit for ARDOP (42)
// Fix buffer overflow risk in HTTP Terminal(42)
@ -1313,6 +1316,7 @@ void * KISSHFExtInit(EXTPORTDATA * PortEntry);
void * WinRPRExtInit(EXTPORTDATA * PortEntry);
void * HSMODEMExtInit(EXTPORTDATA * PortEntry);
void * FreeDataExtInit(EXTPORTDATA * PortEntry);
void * SIXPACKExtInit(EXTPORTDATA * PortEntry);
extern char * ConfigBuffer; // Config Area
VOID REMOVENODE(dest_list * DEST);
@ -3950,6 +3954,9 @@ VOID * InitializeExtDriver(PEXTPORTDATA PORTVEC)
if (strstr(Value, "FREEDATA"))
return FreeDataExtInit;
if (strstr(Value, "6PACK"))
return SIXPACKExtInit;
ExtDriver = LoadLibrary(Value);
if (ExtDriver == NULL)

View File

@ -57,7 +57,7 @@
UsePrecompiledHeader="0"
AssemblerOutput="2"
AssemblerListingLocation="c:\devprogs\bpq32\listings\debug\"
BrowseInformation="0"
BrowseInformation="1"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
@ -234,6 +234,10 @@
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\6pack.c"
>
</File>
<File
RelativePath="..\CommonSource\adif.c"
>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="C:\Devprogs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="C:\Devprogs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="C:\Devprogs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="C:\DevProgs\BPQ32\bpq32.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -4859,7 +4859,6 @@ DllExport uint64_t APIENTRY GetPortFrequency(int PortNo, char * FreqString)
struct TNCINFO * TNC;
struct RIGINFO * RIG = 0;
int RigPort;
if (PORT->RIGPort)
TNC = TNCInfo[PORT->RIGPort];
@ -5089,6 +5088,8 @@ void BuildPortMH(char * MHJSON, struct PORTCONTROL * PORT)
int len;
char * ptr;
char mhstr[400];
int i;
char c;
if (MH == NULL)
return;
@ -5110,7 +5111,16 @@ void BuildPortMH(char * MHJSON, struct PORTCONTROL * PORT)
continue;
}
Normcall[len++] = 0;
// validate call to prevent corruption of json
for (i=0; i < len; i++)
{
c = Normcall[i];
if (!isalnum(c) && !(c == '#') && !(c == ' ') && !(c == '-'))
goto skipit;
}
//format TIME
@ -5123,7 +5133,7 @@ void BuildPortMH(char * MHJSON, struct PORTCONTROL * PORT)
Normcall, PORT->PORTNUMBER, MH->MHCOUNT, MHTIME);
strcat( MHJSON, mhstr );
skipit:
MH++;
}
}

View File

@ -1876,6 +1876,8 @@ int standardParams(struct TNCINFO * TNC, char * buf)
TNC->WL2K = DecodeWL2KReportLine(buf);
else if (_memicmp(buf, "SESSIONTIMELIMIT", 16) == 0)
TNC->SessionTimeLimit = TNC->DefaultSessionTimeLimit = atoi(&buf[17]) * 60;
else if (_memicmp(buf, "ATTACHTIMELIMIT", 15) == 0)
TNC->AttachTimeLimit = atoi(&buf[16]) * 60;
else if (_memicmp(buf, "BUSYHOLD", 8) == 0) // Hold Time for Busy Detect
TNC->BusyHold = atoi(&buf[8]);
else if (_memicmp(buf, "BUSYWAIT", 8) == 0) // Wait time before failing connect if busy

View File

@ -600,6 +600,7 @@ VOID HTTPTimer()
for (n = Last;;)
{
if ((strlen(Session->ScreenLines[n]) + strlen(_REPLYBUFFER)) < 99999)
strcat(_REPLYBUFFER, Session->ScreenLines[n]);
if (n == 99)
@ -680,13 +681,15 @@ struct HTTPConnectionInfo * FindSession(char * Key)
void ProcessTermInput(SOCKET sock, char * MsgPtr, int MsgLen, char * Key)
{
char _REPLYBUFFER[1024];
char _REPLYBUFFER[2048];
int ReplyLen;
char Header[256];
int HeaderLen;
int State;
struct HTTPConnectionInfo * Session = FindSession(Key);
int Stream;
int maxlen = 1000;
if (Session == NULL)
{
@ -701,12 +704,24 @@ void ProcessTermInput(SOCKET sock, char * MsgPtr, int MsgLen, char * Key)
char c;
UCHAR hex;
int msglen = end - input;
struct TNCINFO * TNC = Session->TNC;
struct TCPINFO * TCP = 0;
if (TNC)
TCP = TNC->TCPInfo;
if (TCP && TCP->WebTermCSS)
maxlen -= strlen(TCP->WebTermCSS);
if (MsgLen > maxlen)
{
Session->KillTimer = 99999; // close session
return;
}
if (TCP && TCP->WebTermCSS)
ReplyLen = sprintf(_REPLYBUFFER, InputLine, Key, TCP->WebTermCSS);
else

View File

@ -1121,7 +1121,7 @@ int main(int argc, char * argv[])
// Make backup copies of Databases
// CopyConfigFile(ConfigName);
// CopyConfigFile(ConfigName);
CopyBIDDatabase();
CopyMessageDatabase();
@ -1221,7 +1221,7 @@ int main(int argc, char * argv[])
NumberofStreams++;
// BPQSetHandle(conn->BPQStream, hWnd);
// BPQSetHandle(conn->BPQStream, hWnd);
SetAppl(conn->BPQStream, (i == 0 && EnableUI) ? 0x82 : 2, BBSApplMask);
Disconnect(conn->BPQStream);
@ -1229,10 +1229,7 @@ int main(int argc, char * argv[])
strcpy(pgm, "LINBPQ");
Debugprintf("POP3 Debug Before Init TCP Timer = %d", POP3Timer);
InitialiseTCP();
Debugprintf("POP3 Debug Before Init NNTP Timer = %d", POP3Timer);
InitialiseNNTP();
SetupListenSet(); // Master set of listening sockets
@ -1286,8 +1283,6 @@ int main(int argc, char * argv[])
}
}
Debugprintf("POP3 Debug After Mail Init Timer = %d", POP3Timer);
if (NUMBEROFTNCPORTS)
InitializeTNCEmulator();

0
MHSave.txt Normal file
View File

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory="c:\linbpq"
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor="0"
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="SKIGACER"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -196,6 +196,9 @@ KC6OAR*>ID:
Port = msg->PORT;
if (Port == 40)
Port = Port;
if (Port & 0x80)
{
if ((MTX & 1) == 0)
@ -250,11 +253,9 @@ KC6OAR*>ID:
ptr += 7;
n--;
if (n == 0)
{
if (n < 0)
return 0; // Corrupt - no end of address bit
}
}
// Reached End of digis

File diff suppressed because it is too large Load Diff

View File

@ -452,8 +452,7 @@ ok:
if (buffptr == 0) return (0); // No buffers, so ignore
buffptr->Len = 36;
memcpy(&buffptr->Data[0], "No Connection to TNC\r", 36);
buffptr->Len = sprintf(&buffptr->Data[0], "No Connection to TNC\r");
C_Q_ADD(&TNC->Streams[Stream].PACTORtoBPQ_Q, buffptr);

View File

@ -427,6 +427,7 @@ int ProcessLine(char * buf, int Port)
TCP->MaxSessions = 10; // Default Values
TNC->Hardware = H_TELNET;
TCP->IPV4 = TRUE;
TCP->SecureTelnet = 1;
strcpy(TCP->CMSServer, "cms.winlink.org");
}

2
VARA.c
View File

@ -2586,7 +2586,7 @@ VOID VARAProcessDataPacket(struct TNCINFO * TNC, UCHAR * Data, int Length)
STREAM->BytesRXed += Length;
Data[Length] = 0;
Debugprintf("VARA: RXD %d bytes", Length);
// Debugprintf("VARA: RXD %d bytes", Length);
sprintf(TNC->WEB_TRAFFIC, "Sent %d RXed %d Queued %d",
STREAM->BytesTXed, STREAM->BytesRXed,STREAM->BytesOutstanding);

View File

@ -10,14 +10,14 @@
#endif
#define KVers 6,0,24,40
#define KVerstring "6.0.24.40\0"
#define KVers 6,0,24,42
#define KVerstring "6.0.24.42\0"
#ifdef CKernel
#define Vers KVers
#define Verstring KVerstring
#define Datestring "January 2024"
#define Datestring "August 2024"
#define VerComments "G8BPQ Packet Switch (C Version)" KVerstring
#define VerCopyright "Copyright © 2001-2024 John Wiseman G8BPQ\0"
#define VerDesc "BPQ32 Switch\0"

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="LAPTOP-Q6S4RP5Q"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="NOTTSDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -70,8 +70,9 @@
// Allow /History to be shortened to /Hi (45)
// Fix extra r charater in Chat Config Web Page
//.25
// Increase sise of status display buffers (7)
// Increase size of status display buffers (7)
#include "BPQChat.h"
#include "Dbghelp.h"

View File

@ -1194,8 +1194,7 @@ int CountMessagestoForward(struct UserInfo * user);
VOID * GetMultiLineDialogParam(HWND hDialog, int DLGItem);
#define LIBCONFIG_STATIC
#include "libconfig.h"
VOID * GetMultiStringValue(config_setting_t * hKey, char * ValueName);
VOID * RegGetMultiStringValue(HKEY hKey, char * ValueName);

6
debian/changelog vendored
View File

@ -1,8 +1,10 @@
linbpq (6.0.24.40-2) bookworm; urgency=medium
linbpq (6.0.24.42-1) unstable; urgency=medium
* Install config to /etc
* New upstream update
* Add in new repo for continued updates
-- Dave Hibberd <hibby@debian.org> Sat, 17 Aug 2024 17:41:25 +0100
-- Dave Hibberd <hibby@debian.org> Wed, 25 Sep 2024 01:36:59 +0100
linbpq (6.0.24.38-1~bpo12+1) bookworm; urgency=medium

2
debian/control vendored
View File

@ -11,7 +11,7 @@ Rules-Requires-Root: no
Package: linbpq
Architecture: linux-any
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, hibbian-archive-keyring
Description: Packet node and ax25 stack
LINBPQ is a Linux version of the BPQ32 Node, BBS and Chat Server components.
It is actively developed by John G8BPQ and contains a complete, independent

66
debian/patches/ftbfs-gcc14.patch vendored Normal file
View File

@ -0,0 +1,66 @@
--- a/Multicast.c
+++ b/Multicast.c
@@ -620,7 +620,7 @@
int r;
UINT rlen;
- UINT outlen;
+ long outlen;
memcpy(&rlen, &Decoded[5], 4);
--- a/MBLRoutines.c
+++ b/MBLRoutines.c
@@ -23,7 +23,7 @@
#include "bpqmail.h"
-void SendMessageReadEvent(struct UserInfo * user, struct MsgInfo * Msg);
+void SendMessageReadEvent(char * Call, struct MsgInfo * Msg);
VOID ProcessMBLLine(CIRCUIT * conn, struct UserInfo * user, UCHAR* Buffer, int len)
--- a/bpqmail.h
+++ b/bpqmail.h
@@ -695,8 +695,8 @@
unsigned char Type;
unsigned char changed;
unsigned short seen;
- long long last_modif;
- long long last_seen;
+ time_t last_modif;
+ time_t last_seen;
char first_homebbs[41];
char secnd_homebbs[41];
char first_zip[9];
--- a/AGWAPI.c
+++ b/AGWAPI.c
@@ -128,7 +128,7 @@
int AGWGetSessionKey(char * key, struct AGWSocketConnectionInfo * sockptr);
int ProcessAGWCommand(struct AGWSocketConnectionInfo * sockptr);
int SendDataToAppl(int Stream, byte * Buffer, int Length);
-int InternalAGWDecodeFrame(char * msg, char * buffer, int Stamp, int * FrameType, int useLocalTime, int doNodes);
+int InternalAGWDecodeFrame(char * msg, char * buffer, time_t Stamp, int * FrameType, int useLocalTime, int doNodes);
int AGWDataSocket_Disconnect( struct AGWSocketConnectionInfo * sockptr);
int SendRawPacket(struct AGWSocketConnectionInfo * sockptr, char *txmsg, int Length);
int ShowApps();
--- a/AGWMoncode.c
+++ b/AGWMoncode.c
@@ -68,7 +68,7 @@
static UCHAR * DISPLAYARPDATAGRAM(UCHAR * Datagram, UCHAR * Output);
-int InternalAGWDecodeFrame(MESSAGE * msg, char * buffer, int Stamp, int * FrameType, int useLocalTime, int DoNodes)
+int InternalAGWDecodeFrame(MESSAGE * msg, char * buffer, time_t Stamp, int * FrameType, int useLocalTime, int DoNodes)
{
UCHAR * ptr;
int n;
@@ -364,7 +364,7 @@
}
if (Output == NULL)
- return NULL;
+ return 0;
if (Output[-1] != 13)
Output += sprintf((char *)Output, "\r");

258
debian/patches/headers.patch vendored Normal file
View File

@ -0,0 +1,258 @@
--- /dev/null
+++ b/bpqheaders.h
@@ -0,0 +1,8 @@
+//Header for an easier build under debian GCC-14
+#include <stdio.h>
+#include <time.h>
+#include <fcntl.h>
+
+int CanPortDigi(int Port);
+
+int KissEncode(unsigned char * inbuff, unsigned char * outbuff, int len);
--- a/cMain.c
+++ b/cMain.c
@@ -29,9 +29,10 @@
//#include "windows.h"
//#include "winerror.h"
-#include "time.h"
-#include "stdio.h"
+#include <time.h>
+#include <stdio.h>
#include <fcntl.h>
+#include "bpqheaders.h"
#include "kernelresource.h"
#include "CHeaders.h"
--- a/CHeaders.h
+++ b/CHeaders.h
@@ -93,7 +93,7 @@
char * MOVEANDCHECK(TRANSPORTENTRY * Session, char * Bufferptr, char * Source, int Len);
VOID DISPLAYCIRCUIT(TRANSPORTENTRY * L4, char * Buffer);
char * FormatUptime(int Uptime);
-char * strlop(char * buf, char delim);
+char * strlop(const char * buf, char delim);
BOOL CompareCalls(UCHAR * c1, UCHAR * c2);
VOID PostDataAvailable(TRANSPORTENTRY * Session);
@@ -427,4 +427,4 @@
extern int MinCounter[MaxBPQPortNo + 1]; // Interval Countdown
extern BOOL SendFromFile[MaxBPQPortNo + 1];
-DllExport uint64_t APIENTRY GetPortFrequency(int PortNo, char * FreqStringMhz);
\ No newline at end of file
+DllExport uint64_t APIENTRY GetPortFrequency(int PortNo, char * FreqStringMhz);
--- a/WinRPR.c
+++ b/WinRPR.c
@@ -63,7 +63,6 @@
static RECT Rect;
VOID __cdecl Debugprintf(const char * format, ...);
-char * strlop(char * buf, char delim);
char NodeCall[11]; // Nodecall, Null Terminated
--- a/bpqmail.h
+++ b/bpqmail.h
@@ -877,7 +877,6 @@
};
VOID __cdecl nprintf(CIRCUIT * conn, const char * format, ...);
-char * strlop(char * buf, char delim);
int rt_cmd(CIRCUIT *circuit, char * Buffer);
CIRCUIT *circuit_new(CIRCUIT *circuit, int flags);
VOID BBSputs(CIRCUIT * conn, char * buf);
--- a/APRSCode.c
+++ b/APRSCode.c
@@ -63,7 +63,6 @@
VOID __cdecl Consoleprintf(const char * format, ...);
BOOL APIENTRY Send_AX(PMESSAGE Block, DWORD Len, UCHAR Port);
VOID Send_AX_Datagram(PDIGIMESSAGE Block, DWORD Len, UCHAR Port);
-char * strlop(char * buf, char delim);
int APRSDecodeFrame(char * msg, char * buffer, time_t Stamp, uint64_t Mask); // Unsemaphored DecodeFrame
APRSHEARDRECORD * UpdateHeard(UCHAR * Call, int Port);
BOOL CheckforDups(char * Call, char * Msg, int Len);
--- a/FLDigi.c
+++ b/FLDigi.c
@@ -101,8 +101,6 @@
VOID ReleaseOtherPorts(struct TNCINFO * ThisTNC);
VOID WritetoTrace(struct TNCINFO * TNC, char * Msg, int Len);
-char * strlop(char * buf, char delim);
-
extern UCHAR BPQDirectory[];
#define MAXMPSKPORTS 16
--- a/MULTIPSK.c
+++ b/MULTIPSK.c
@@ -71,8 +71,6 @@
static VOID DoMonitorHddr(struct TNCINFO * TNC, struct AGWHEADER * RXHeader, UCHAR * Msg);
VOID SendRPBeacon(struct TNCINFO * TNC);
-char * strlop(char * buf, char delim);
-
extern UCHAR BPQDirectory[];
#define MAXMPSKPORTS 16
--- a/AGWMoncode.c
+++ b/AGWMoncode.c
@@ -61,7 +61,6 @@
#define NODES_SIG 0xFF
-char * strlop(char * buf, char delim);
UCHAR * DisplayINP3RIF(UCHAR * ptr1, UCHAR * ptr2, int msglen);
static UCHAR * DISPLAY_NETROM(MESSAGE * ADJBUFFER, UCHAR * Output, int MsgLen, int DoNodes);
--- a/Bpq32.c
+++ b/Bpq32.c
@@ -1406,7 +1406,6 @@
VOID FindLostBuffers();
BOOL InitializeTNCEmulator();
VOID TNCTimer();
-char * strlop(char * buf, char delim);
DllExport int APIENTRY Get_APPLMASK(int Stream);
DllExport int APIENTRY GetStreamPID(int Stream);
--- a/CMSAuth.c
+++ b/CMSAuth.c
@@ -31,7 +31,7 @@
#include <windows.h>
#endif
-char * strlop(char * buf, char delim);
+char * strlop(const char * buf, char delim);
VOID APIENTRY md5 (char *arg, unsigned char * checksum);
--- a/FLDigi64.c
+++ b/FLDigi64.c
@@ -102,8 +102,6 @@
VOID SuspendOtherPorts(struct TNCINFO * ThisTNC);
VOID ReleaseOtherPorts(struct TNCINFO * ThisTNC);
-char * strlop(char * buf, char delim);
-
extern UCHAR BPQDirectory[];
#define MAXBPQPORTS 32
--- a/HTTPcode.c
+++ b/HTTPcode.c
@@ -102,7 +102,6 @@
extern UCHAR ConfigDirectory[260];
-char * strlop(char * buf, char delim);
VOID sendandcheck(SOCKET sock, const char * Buffer, int Len);
int CompareNode(const void *a, const void *b);
int CompareAlias(const void *a, const void *b);
--- a/MULTIPSK64.c
+++ b/MULTIPSK64.c
@@ -74,8 +74,6 @@
static VOID DoMonitorHddr(struct TNCINFO * TNC, struct AGWHEADER * RXHeader, UCHAR * Msg);
VOID SendRPBeacon(struct TNCINFO * TNC);
-char * strlop(char * buf, char delim);
-
extern UCHAR BPQDirectory[];
#define MAXBPQPORTS 32
--- a/Moncode.c
+++ b/Moncode.c
@@ -59,7 +59,6 @@
#define NODES_SIG 0xFF
-char * strlop(char * buf, char delim);
UCHAR * DisplayINP3RIF(UCHAR * ptr1, UCHAR * ptr2, unsigned int msglen);
char * DISPLAY_NETROM(MESSAGE * ADJBUFFER, UCHAR * Output, int MsgLen);
--- a/NodeMapTest.c
+++ b/NodeMapTest.c
@@ -201,7 +201,6 @@
int ConvFromAX25(unsigned char * incall, char * outcall);
void GenerateOutputFiles(time_t Now);
void UpdateHeardData(struct NodeData * Node, struct NodeData * Call, char * Freq, char * LOC, char * Flags);
-char * strlop(char * buf, char delim);
void ProcessChatUpdate(char * From, char * Msg);
void ProcessNodeUpdate(char * From, char * Msg);
--- a/SCSTracker.c
+++ b/SCSTracker.c
@@ -52,7 +52,6 @@
static RECT Rect;
VOID __cdecl Debugprintf(const char * format, ...);
-char * strlop(char * buf, char delim);
char NodeCall[11]; // Nodecall, Null Terminated
--- a/TelnetV6.c
+++ b/TelnetV6.c
@@ -127,8 +127,6 @@
static int ProcessLine(char * buf, int Port);
VOID __cdecl Debugprintf(const char * format, ...);
-char * strlop(char * buf, char delim);
-
int DisplaySessions(struct TNCINFO * TNC);
int DoStateChange(int Stream);
--- a/UIARQ.c
+++ b/UIARQ.c
@@ -78,7 +78,6 @@
VOID Send_AX_Datagram(PDIGIMESSAGE Block, DWORD Len, UCHAR Port);
int DoScanLine(struct TNCINFO * TNC, char * Buff, int Len);
VOID ProcessARQPacket(struct PORTCONTROL * PORT, MESSAGE * Buffer);
-char * strlop(char * buf, char delim);
extern UCHAR BPQDirectory[];
extern char MYALIASLOPPED[10];
--- a/bpqchat.h
+++ b/bpqchat.h
@@ -603,7 +603,6 @@
VOID nputs(ChatCIRCUIT * conn, char * buf);
#endif
BOOL matchi(char * p1, char * p2);
-char * strlop(char * buf, char delim);
int rt_cmd(ChatCIRCUIT *circuit, char * Buffer);
ChatCIRCUIT *circuit_new(ChatCIRCUIT *circuit, int flags);
void makelinks(void);
@@ -775,4 +774,4 @@
struct ConsoleInfo * ConsHeader[2];
-extern BOOL LogCHAT;
\ No newline at end of file
+extern BOOL LogCHAT;
--- a/SCSTrackeMulti.c
+++ b/SCSTrackeMulti.c
@@ -48,7 +48,6 @@
static RECT Rect;
VOID __cdecl Debugprintf(const char * format, ...);
-char * strlop(char * buf, char delim);
BOOL KAMStartPort(struct PORTCONTROL * PORT);
BOOL KAMStopPort(struct PORTCONTROL * PORT);
--- a/SCSTrackeMulti64.c
+++ b/SCSTrackeMulti64.c
@@ -52,7 +52,6 @@
struct TNCINFO * TNCInfo[34]; // Records are Malloc'd
VOID __cdecl Debugprintf(const char * format, ...);
-char * strlop(char * buf, char delim);
BOOL KAMStartPort(struct PORTCONTROL * PORT);
BOOL KAMStopPort(struct PORTCONTROL * PORT);
--- a/CommonCode.c
+++ b/CommonCode.c
@@ -568,7 +568,7 @@
return ptr;
}
-char * strlop(char * buf, char delim)
+char * strlop(const char * buf, char delim)
{
// Terminate buf at delim, and return rest of string

View File

@ -1,8 +1,8 @@
--- a/TelnetV6.c
+++ b/TelnetV6.c
@@ -428,6 +428,7 @@
TNC->Hardware = H_TELNET;
@@ -429,6 +429,7 @@
TCP->IPV4 = TRUE;
TCP->SecureTelnet = 1;
strcpy(TCP->CMSServer, "cms.winlink.org");
+ TCP->SecureTelnet = 1;
}

View File

@ -1,3 +1,5 @@
headers.patch
ftbfs-gcc14.patch
spelling-errors.patch
makefile
secure-by-default.patch

2
debian/rules vendored
View File

@ -1,6 +1,6 @@
#!/usr/bin/make -f
#export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
CFLAGS += -fcommon

View File

@ -225,6 +225,8 @@ struct STREAMINFO
char AGWKey[21]; // Session Key for AGW Session Based Drivers
time_t ConnectTime; // Time connection made
time_t AttachTime;
int BytesTXed;
int BytesAcked;
int BytesRXed;
@ -258,6 +260,7 @@ struct STREAMINFO
HWND xIDC_DIRN;
int RelaySyncStream;
int VaraACMode;
};
typedef struct AGWINFO
@ -409,7 +412,7 @@ struct FreeDataINFO
char * SSIDS[16];
};
struct sixPackInfo;
typedef struct TNCINFO
{
@ -427,6 +430,9 @@ typedef struct TNCINFO
time_t SessionTimeLimit; // Optional limit to total session time
time_t DefaultSessionTimeLimit; // Configured value
time_t AttachTimeLimit; // to trap port left attached for a long time without other activity
time_t AttachTime;
int Hardware; // Hardware Type
#define H_WINMOR 1
@ -449,6 +455,7 @@ typedef struct TNCINFO
#define H_WINRPR 17
#define H_HSMODEM 18
#define H_FREEDATA 19
#define H_SIXPACK 20
int Port; // BPQ Port Number
@ -839,6 +846,8 @@ typedef struct TNCINFO
char * NRNeighbour;
int NRCloseTimer;
struct _LINKTABLE * DummyLink; // Simulated link to simplify interface to ax,25 netrom code
struct sixPackPortInfo * sixPack;
int VaraACMode;
} *PTNCINFO;

9
upnp.c
View File

@ -85,6 +85,7 @@ char * leaseDuration = NULL;
struct UPNPDev * devlist = 0;
char lanaddr[64] = "unset"; /* my ip address on the LAN */
char wanaddr[64] = "unset"; /* my ip address on the LAN */
struct UPNPUrls urls;
struct IGDdatas data;
@ -126,7 +127,11 @@ int upnpInit()
return 0;
}
#if MINIUPNPC_API_VERSION == 18
i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), wanaddr, sizeof(wanaddr));
#else
i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
#endif
}
AddMap(devlist->descURL, Config->LANport, Config->WANPort, Config->Protocol);
@ -153,7 +158,11 @@ int upnpClose()
return 0;
}
#if MINIUPNPC_API_VERSION == 18
i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), wanaddr, sizeof(wanaddr));
#else
i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
#endif
}
DeleteMap(devlist->descURL, Config->LANport, Config->WANPort, Config->Protocol);