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

Don't save "extra" files included in QWK/REP packets if they are blocked via

the file.can. Log a message when receiving or filtering files received via
QWK/REP.
parent ee58e0c6
No related branches found
No related tags found
No related merge requests found
......@@ -371,6 +371,11 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
if(isdir(str)) /* sub-dir */
continue;
if(::trashcan(&cfg, dirent->d_name, "file")) {
eprintf(LOG_NOTICE,"Ignored blocked filename from %s: %s", cfg.qhub[hubnum]->id, dirent->d_name);
continue;
}
// Create directory if necessary
sprintf(inbox,"%sqnet/%s.in",cfg.data_dir,cfg.qhub[hubnum]->id);
MKDIR(inbox);
......@@ -380,7 +385,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
mv(str,fname,1 /* overwrite */);
sprintf(str,text[ReceivedFileViaQWK],dirent->d_name,cfg.qhub[hubnum]->id);
putsmsg(&cfg,1,str);
eprintf(LOG_INFO,"Received %s from %s", dirent->d_name, cfg.qhub[hubnum]->id);
eprintf(LOG_INFO,"Received file from %s: %s", cfg.qhub[hubnum]->id, dirent->d_name);
}
if(dir!=NULL)
closedir(dir);
......
......@@ -627,15 +627,21 @@ bool sbbs_t::unpack_rep(char* repfile)
if(isdir(str))
continue;
if(::trashcan(&cfg, dirent->d_name, "file")) {
lprintf(LOG_NOTICE, "Ignored blocked filename: %s", dirent->d_name);
continue;
}
// Create directory if necessary
SAFEPRINTF2(inbox,"%sqnet/%s.in",cfg.data_dir,useron.alias);
MKDIR(inbox);
MKDIR(inbox);
SAFEPRINTF2(fname,"%s/%s",inbox,dirent->d_name);
mv(str,fname,1);
SAFEPRINTF2(str,text[ReceivedFileViaQWK],dirent->d_name,useron.alias);
putsmsg(&cfg,1,str);
}
lprintf(LOG_NOTICE, "Received file: %s", dirent->d_name);
}
if(dir!=NULL)
closedir(dir);
SAFEPRINTF(fname,"%sqnet-rep.now",cfg.data_dir);
......
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