diff --git a/Bpq32.c b/Bpq32.c index 8311011..1a5644f 100644 --- a/Bpq32.c +++ b/Bpq32.c @@ -1238,7 +1238,10 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses // Fix handling long unix device names (now max 250 bytes) (52) // Fix error reporting in api update (53) // Coding changes to remove some compiler warnings (53, 54) -// Add MQTT reporting o +// Add MQTT reporting of Mail Events (54) +// Fix beaconong on KISSHF ports (55) +// Fix MailAPI msgs endpoint + #define CKernel diff --git a/CHeaders.h b/CHeaders.h index c0af6d2..beb6380 100644 --- a/CHeaders.h +++ b/CHeaders.h @@ -92,7 +92,6 @@ VOID InnerCommandHandler(TRANSPORTENTRY * Session, struct DATAMESSAGE * Buffer); VOID DoTheCommand(TRANSPORTENTRY * Session); char * MOVEANDCHECK(TRANSPORTENTRY * Session, char * Bufferptr, char * Source, int Len); VOID DISPLAYCIRCUIT(TRANSPORTENTRY * L4, char * Buffer); -char * FormatUptime(int Uptime); char * strlop(const char * buf, char delim); BOOL CompareCalls(UCHAR * c1, UCHAR * c2); diff --git a/Cmd.c b/Cmd.c index 738e2f9..cda5b7d 100644 --- a/Cmd.c +++ b/Cmd.c @@ -1005,8 +1005,16 @@ VOID CMDSTATS(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct if (Port == 0) { - uptime = FormatUptime(STATSTIME); - Bufferptr = Cmdprintf(Session, Bufferptr, "%s", uptime); + struct tm * TM; + char UPTime[50]; + time_t szClock = STATSTIME * 60; + + TM = gmtime(&szClock); + + sprintf(UPTime, "Uptime (Days Hours Mins) %.2d:%.2d:%.2d\r", + TM->tm_yday, TM->tm_hour, TM->tm_min); + + Bufferptr = Cmdprintf(Session, Bufferptr, "%s", UPTime); Bufferptr = Cmdprintf(Session, Bufferptr, "Semaphore Get-Rel/Clashes %9d%9d\r", Semaphore.Gets - Semaphore.Rels, Semaphore.Clashes); diff --git a/CommonCode.c b/CommonCode.c index 3821bb1..b02b0fa 100644 --- a/CommonCode.c +++ b/CommonCode.c @@ -722,8 +722,6 @@ VOID CheckForDetach(struct TNCINFO * TNC, int Stream, struct STREAMINFO * STREAM if (STREAM->Connected || STREAM->Connecting) { - char logmsg[120]; - time_t Duration; // Need to do a tidy close @@ -1603,9 +1601,9 @@ DllExport int APIENTRY SendRaw(int port, char * msg, int len) MSG->LENGTH = len + MSGHDDRLEN; - if (PORT->PROTOCOL == 10) // PACTOR/WINMOR Style + if (PORT->PROTOCOL == 10 && PORT->TNC && PORT->TNC->Hardware != H_KISSHF) // PACTOR/WINMOR Style { - // Pactor Style. Probably will only be used for Tracker uneless we do APRS over V4 or WINMOR + // Pactor Style. Probably will only be used for Tracker unless we do APRS over V4 or WINMOR EXTPORTDATA * EXTPORT = (EXTPORTDATA *) PORT; @@ -3009,19 +3007,7 @@ DllExport int APIENTRY ClearNodes () return (0); } -char * FormatUptime(int Uptime) - { - struct tm * TM; - static char UPTime[50]; - time_t szClock = Uptime * 60; - TM = gmtime(&szClock); - - sprintf(UPTime, "Uptime (Days Hours Mins) %.2d:%.2d:%.2d\r", - TM->tm_yday, TM->tm_hour, TM->tm_min); - - return UPTime; - } static char *month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; @@ -4992,7 +4978,7 @@ DllExport VOID WINAPI SendWebRequest(char * Host, char * Request, char * Params, while (InputLen != -1) { - InputLen = recv(sock, &Buffer[inptr], 4096 - inptr, 0); + InputLen = recv(sock, &Buffer[inptr], 4095 - inptr, 0); if (InputLen == -1 || InputLen == 0) { @@ -5053,7 +5039,7 @@ DllExport VOID WINAPI SendWebRequest(char * Host, char * Request, char * Params, if (ptr1) { // Just accept anything until I've sorted things with Lee - Debugprintf("%s", ptr1); + closesocket(sock); Debugprintf("Web Database update ok"); return; @@ -5148,7 +5134,6 @@ skipit: void SendDataToPktMap(char *Msg) { - SOCKET sock; char Return[256]; char Request[64]; char Params[50000]; diff --git a/KISSHF.c b/KISSHF.c index 7dd76ff..368e04f 100644 --- a/KISSHF.c +++ b/KISSHF.c @@ -350,6 +350,7 @@ ok: // See if any frames for this port + STREAM = &TNC->Streams[0]; if (STREAM->BPQtoPACTOR_Q) diff --git a/UIARQ.c b/UIARQ.c index 8c6b00e..3dd588f 100644 --- a/UIARQ.c +++ b/UIARQ.c @@ -476,7 +476,7 @@ UINT UIARQExtInit(EXTPORTDATA * PortEntry) while (TNC->ARQPorts[i]) { PORT = GetPortTableEntryFromPortNum(TNC->ARQPorts[i]); - PORT->UIHook = (FARPROCY)UIHook; + PORT->UIHook = UIHook; PORT->HookPort = (struct PORTCONTROL *)PortEntry; i++; } diff --git a/Versions.h b/Versions.h index 96ac12d..031177a 100644 --- a/Versions.h +++ b/Versions.h @@ -10,8 +10,8 @@ #endif -#define KVers 6,0,24,54 -#define KVerstring "6.0.24.54\0" +#define KVers 6,0,24,55 +#define KVerstring "6.0.24.55\0" #ifdef CKernel diff --git a/debian/changelog b/debian/changelog index ada0246..9f9b6c6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +linbpq (6.0.24.55+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium + + * New Upstream + * d/rules + - Increased hardening + + -- Dave Hibberd Sun, 05 Jan 2025 23:35:06 +0000 + linbpq (6.0.24.54+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium * New Upstream diff --git a/debian/control b/debian/control index 476f114..28006de 100644 --- a/debian/control +++ b/debian/control @@ -3,10 +3,11 @@ Section: hamradio Priority: optional Maintainer: Dave Hibberd Standards-Version: 4.7.0.0 -Vcs-Browser: https://github.com/Online-Amateur-Radio-Club-M0OUK/oarc-bpqnode -Vcs-Git: https://github.com/Online-Amateur-Radio-Club-M0OUK/oarc-bpqnode.git +Vcs-Browser: https://git.hibbian.org/Hibbian/linbpq +Vcs-Git: https://git.hibbian.org/Hibbian/linbpq.git Homepage: https://www.cantab.net/users/john.wiseman/Documents/ -Build-Depends: debhelper-compat (= 13), libssl-dev, libminiupnpc-dev, libpcap-dev, libconfig-dev, zlib1g-dev, libpaho-mqtt-dev, libjansson-dev, libpng-dev +Build-Depends: debhelper-compat (= 13) +Build-Depends-Arch: libssl-dev, libminiupnpc-dev, libpcap-dev, libconfig-dev, zlib1g-dev, libpaho-mqtt-dev, libjansson-dev, libpng-dev Rules-Requires-Root: no Package: linbpq diff --git a/debian/rules b/debian/rules index 9df5872..b8b1ea0 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,6 @@ #!/usr/bin/make -f -export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-format qa=-bug-implicit-func +export DEB_BUILD_MAINT_OPTIONS=hardening=+all %: dh $@ diff --git a/mailapi.c b/mailapi.c index 750f73e..690d2b4 100644 --- a/mailapi.c +++ b/mailapi.c @@ -406,8 +406,8 @@ int WebMailAPIProcessHTTPMessage(char * response, char * Method, char * URL, cha return 0; } -// Unauthorised users can only get bulls. -// Autothorised may read only users message or all messages depending on sysop status +// Unauthenticated users can only get bulls. +// Authenticated users may read only that users messages or all messages depending on sysop status int sendMsgList(struct HTTPConnectionInfo * Session, char * response, char * Rest, int Auth) { @@ -442,15 +442,10 @@ int sendMsgList(struct HTTPConnectionInfo * Session, char * response, char * Res char UTF8Title[4096]; char * EncodedTitle; - // List if it is the right type and in the page range we want - - - if (Count++ < Session->WebMailSkip) - continue; + // List if it is the right type ptr += sprintf(ptr, "{\r\n"); - strcpy(Via, Msg->via); strlop(Via, '.'); @@ -473,18 +468,8 @@ int sendMsgList(struct HTTPConnectionInfo * Session, char * response, char * Res free(EncodedTitle); - // ptr += sprintf(ptr, "%6d %s %c%c %5d %-8s%-8s%-8s%s\r\n", - // Session->Key, Msg->number, Msg->number, - // FormatDateAndTime((time_t)Msg->datecreated, TRUE), Msg->type, - // Msg->status, Msg->length, Msg->to, Via, - // Msg->from, UTF8Title); - ptr += sprintf(ptr, "},\r\n"); - n--; - - if (n == 0) - break; } } diff --git a/tncinfo.h b/tncinfo.h index d038554..5840f7c 100644 --- a/tncinfo.h +++ b/tncinfo.h @@ -893,7 +893,9 @@ static VOID ForcedClose(struct TNCINFO * TNC, int Stream); static VOID CloseComplete(struct TNCINFO * TNC, int Stream); VOID CheckForDetach(struct TNCINFO * TNC, int Stream, struct STREAMINFO * STREAM, - VOID TidyClose(), VOID ForcedClose(), VOID CloseComplete()); + VOID TidyCloseProc(struct TNCINFO * TNC, int Stream), VOID ForcedCloseProc(struct TNCINFO * TNC, int Stream), + VOID CloseComplete(struct TNCINFO * TNC, int Stream)); + BOOL InterlockedCheckBusy(struct TNCINFO * ThisTNC);