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

Don't write uploaded filename and description to env variables

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.
parent 5012efb1
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2458 passed
...@@ -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);
......
...@@ -61,10 +61,6 @@ bool sbbs_t::uploadfile(file_t* f) ...@@ -61,10 +61,6 @@ bool sbbs_t::uploadfile(file_t* f)
attr(LIGHTGRAY); attr(LIGHTGRAY);
bputs(cfg.ftest[i]->workstr); bputs(cfg.ftest[i]->workstr);
safe_snprintf(sbbsfilename,sizeof(sbbsfilename),"SBBSFILENAME=%s",f->name);
putenv(sbbsfilename);
safe_snprintf(sbbsfiledesc,sizeof(sbbsfiledesc),"SBBSFILEDESC=%s",f->desc);
putenv(sbbsfiledesc);
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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment