Skip to content
Snippets Groups Projects
Commit 28e435bd authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Combine the "new packet" and "password-protected" debug-log lines

... to de-clutter the log

Also, don't log the packet passwords. Folks copy and post sbbsecho.log lines
and that could seriously compromise the security of the Interwebs if those
super-secret passwords were ever leaked!
parent 5e79f055
No related branches found
No related tags found
No related merge requests found
Pipeline #4943 passed
...@@ -922,15 +922,18 @@ bool new_pkthdr(fpkthdr_t* hdr, fidoaddr_t orig, fidoaddr_t dest, const nodecfg_ ...@@ -922,15 +922,18 @@ bool new_pkthdr(fpkthdr_t* hdr, fidoaddr_t orig, fidoaddr_t dest, const nodecfg_
struct tm* tm; struct tm* tm;
time_t now = time(NULL); time_t now = time(NULL);
memset(hdr, 0, sizeof(*hdr));
if(nodecfg != NULL) { if(nodecfg != NULL) {
pkt_type = nodecfg->pkt_type; pkt_type = nodecfg->pkt_type;
lprintf(LOG_DEBUG, "New packet (type %s) created for linked-node: %s", pktTypeStringList[pkt_type], smb_faddrtoa(&nodecfg->addr, NULL)); if(nodecfg->pktpwd[0] != 0)
strncpy((char*)hdr->type2.password, nodecfg->pktpwd, sizeof(hdr->type2.password));
lprintf(LOG_DEBUG, "New %spacket (type %s) created for linked-node: %s"
,nodecfg->pktpwd[0] == '\0' ? "" : "password-protected ", pktTypeStringList[pkt_type], smb_faddrtoa(&nodecfg->addr, NULL));
} }
else else
lprintf(LOG_DEBUG, "New packet (type %s) created for unlinked-node: %s", pktTypeStringList[pkt_type], smb_faddrtoa(&dest, NULL)); lprintf(LOG_DEBUG, "New packet (type %s) created for unlinked-node: %s", pktTypeStringList[pkt_type], smb_faddrtoa(&dest, NULL));
memset(hdr, 0, sizeof(fpkthdr_t));
if((tm = localtime(&now)) != NULL) { if((tm = localtime(&now)) != NULL) {
hdr->type2.year = tm->tm_year+1900; hdr->type2.year = tm->tm_year+1900;
hdr->type2.month= tm->tm_mon; hdr->type2.month= tm->tm_mon;
...@@ -951,11 +954,6 @@ bool new_pkthdr(fpkthdr_t* hdr, fidoaddr_t orig, fidoaddr_t dest, const nodecfg_ ...@@ -951,11 +954,6 @@ bool new_pkthdr(fpkthdr_t* hdr, fidoaddr_t orig, fidoaddr_t dest, const nodecfg_
hdr->type2.prodcode = SBBSECHO_PRODUCT_CODE&0xff; hdr->type2.prodcode = SBBSECHO_PRODUCT_CODE&0xff;
hdr->type2.sernum = SBBSECHO_VERSION_MAJOR; hdr->type2.sernum = SBBSECHO_VERSION_MAJOR;
if(nodecfg != NULL && nodecfg->pktpwd[0] != 0) {
lprintf(LOG_DEBUG, "Using packet password for %s: '%s'", smb_faddrtoa(&nodecfg->addr, NULL), nodecfg->pktpwd);
strncpy((char*)hdr->type2.password, nodecfg->pktpwd, sizeof(hdr->type2.password));
}
if(pkt_type == PKT_TYPE_2) if(pkt_type == PKT_TYPE_2)
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment