Skip to content
Snippets Groups Projects
Commit dd97c28f 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 6004fd06
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -922,15 +922,18 @@ bool new_pkthdr(fpkthdr_t* hdr, fidoaddr_t orig, fidoaddr_t dest, const nodecfg_
struct tm* tm;
time_t now = time(NULL);
memset(hdr, 0, sizeof(*hdr));
if(nodecfg != NULL) {
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
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) {
hdr->type2.year = tm->tm_year+1900;
hdr->type2.month= tm->tm_mon;
......@@ -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.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)
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment