Commits (2)
  • Rob Swindell's avatar
    Log an error and exit immediately when a local linked-node is configured · 5012efb1
    Rob Swindell authored
    When a linked-node (in echocfg->Linked Nodes) contains one of the local system's FTN addresses, display/log an error and exit immediately, e.g.:
    Configuration ERROR: Linked node #20 is your own address: 1:103/705
    I'd perform this check in EchoCfg, but:
    1. echocfg doesn't read the BBS's configuration files (where the local FTN addresses are configured), and
    2. some sysops just directly edit their sbbsecho.ini file
  • Rob Swindell's avatar
    Don't write uploaded filename and description to env variables · 7fd781cd
    Rob Swindell authored
    Environment variables are shared among all threads of a process (e.g. all nodes of a instance of sbbs), so this scheme of passing the uploaded filename and description to an external file tester (upload processor) via environment variables has always been fraught with the possibility of failure or flakiness in Synchronet v3. Since I very much doubt that any upload processor is actually using this scheme, just remove it. Upload processors can and should)use the sbbsfile.nam and sbbsfile.des text files created in the node directory instead.
...@@ -1015,7 +1015,6 @@ public: ...@@ -1015,7 +1015,6 @@ public:
/* upload.cpp */ /* upload.cpp */
bool uploadfile(file_t* f); bool uploadfile(file_t* f);
char sbbsfilename[128],sbbsfiledesc[128]; /* env vars */
bool upload(uint dirnum); bool upload(uint dirnum);
char upload_lastdesc[LEN_FDESC+1]; char upload_lastdesc[LEN_FDESC+1];
bool bulkupload(uint dirnum); bool bulkupload(uint dirnum);
...@@ -6242,6 +6242,14 @@ int main(int argc, char **argv) ...@@ -6242,6 +6242,14 @@ int main(int argc, char **argv)
return -1; return -1;
} }
for(uint u = 0; u < cfg.nodecfgs; u++) {
if(sysfaddr_is_valid(find_sysfaddr(cfg.nodecfg[u].addr, true))) {
lprintf(LOG_ERR, "Configuration ERROR: Linked node #%u is your own address: %s"
,u + 1, faddrtoa(&cfg.nodecfg[u].addr));
char* tmpdir = FULLPATH(NULL, cfg.temp_dir, sizeof(cfg.temp_dir)-1); char* tmpdir = FULLPATH(NULL, cfg.temp_dir, sizeof(cfg.temp_dir)-1);
if(tmpdir != NULL) { if(tmpdir != NULL) {
SAFECOPY(cfg.temp_dir, tmpdir); SAFECOPY(cfg.temp_dir, tmpdir);
...@@ -61,10 +61,6 @@ bool sbbs_t::uploadfile(file_t* f) ...@@ -61,10 +61,6 @@ bool sbbs_t::uploadfile(file_t* f)
bputs(cfg.ftest[i]->workstr); bputs(cfg.ftest[i]->workstr);
SAFEPRINTF(str,"%ssbbsfile.nam",cfg.node_dir); SAFEPRINTF(str,"%ssbbsfile.nam",cfg.node_dir);
if((stream=fopen(str,"w"))!=NULL) { if((stream=fopen(str,"w"))!=NULL) {
fprintf(stream, "%s", f->desc); fprintf(stream, "%s", f->desc);