Skip to content
Snippets Groups Projects
Commit 6fc93992 authored by rswindell's avatar rswindell
Browse files

If QWK-imported message's SenderHostName field is an IP address, resolve that

to a host name before comparing against host.can.
parent d4e1f0ee
No related branches found
No related tags found
No related merge requests found
......@@ -130,6 +130,7 @@ extern int thread_suid_broken; /* NPTL is no longer broken */
#endif
#include "genwrap.h"
#include "semfile.h"
#include "netwrap.h"
#include "dirwrap.h"
#include "filewrap.h"
#include "datewrap.h"
......
......@@ -67,6 +67,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
str_list_t host_can=NULL;
str_list_t subject_can=NULL;
str_list_t twit_list=NULL;
const char* hostname;
memset(&msg,0,sizeof(msg));
......@@ -163,10 +164,11 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
continue;
}
if(findstr_in_list(msg.from_host,host_can)) {
hostname=getHostNameByAddr(msg.from_host);
if(findstr_in_list(hostname,host_can)) {
eprintf(LOG_NOTICE,"!Filtering QWK message from %s due to blocked hostname: %s"
,msg.from
,msg.from_host);
,hostname);
continue;
}
......
......@@ -67,6 +67,7 @@ bool sbbs_t::unpack_rep(char* repfile)
str_list_t host_can=NULL;
str_list_t subject_can=NULL;
str_list_t twit_list=NULL;
const char* hostname;
const char* AttemptedToUploadREPpacket="Attempted to upload REP packet";
memset(&msg,0,sizeof(msg));
......@@ -192,10 +193,11 @@ bool sbbs_t::unpack_rep(char* repfile)
continue;
}
if(findstr_in_list(msg.from_host,host_can)) {
hostname = getHostNameByAddr(msg.from_host);
if(findstr_in_list(hostname,host_can)) {
SAFEPRINTF2(str,"!Filtering QWK message from %s due to blocked hostname: %s"
,msg.from
,msg.from_host);
,hostname);
logline("P!",str);
continue;
}
......
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