Commit e1d4a4af authored by rswindell's avatar rswindell
Browse files

semaphore file paths can now include command-line specifiers (e.g. %j)

parent ce1b65e8
......@@ -379,7 +379,8 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
cc_sent++; }
if(cfg.netmail_sem[0]) /* update semaphore file */
if((file=nopen(cfg.netmail_sem,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
if((file=nopen(cmdstr(cfg.netmail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
FREE(buf);
......@@ -690,7 +691,8 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
else { /* Successful */
if(inet) {
if(cfg.inetmail_sem[0]) /* update semaphore file */
if((fido=nopen(cfg.inetmail_sem,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
if((fido=nopen(cmdstr(cfg.inetmail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(fido);
if(!(useron.exempt&FLAG('S')))
subtract_cdt(&cfg,&useron,cfg.inetmail_cost); }
......@@ -846,7 +848,8 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
close(fido);
FREE((char *)qwkbuf);
if(cfg.netmail_sem[0]) /* update semaphore file */
if((fido=nopen(cfg.netmail_sem,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
if((fido=nopen(cmdstr(cfg.netmail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(fido);
if(!(useron.exempt&FLAG('S')))
subtract_cdt(&cfg,&useron,cfg.netmail_cost);
......
......@@ -270,7 +270,8 @@ bool sbbs_t::inetmail(char *into, char *subj, long mode)
autohangup();
if(cfg.inetmail_sem[0]) /* update semaphore file */
if((file=nopen(cfg.inetmail_sem,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
if((file=nopen(cmdstr(cfg.inetmail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
if(!(useron.exempt&FLAG('S')))
subtract_cdt(&cfg,&useron,cfg.inetmail_cost);
......
......@@ -335,7 +335,8 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
sprintf(str,"Posted on %s %s",cfg.grp[cfg.sub[subnum]->grp]->sname,cfg.sub[subnum]->lname);
logline("P+",str);
if(cfg.sub[subnum]->misc&SUB_FIDO && cfg.sub[subnum]->echomail_sem[0]) /* semaphore */
if((file=nopen(cfg.sub[subnum]->echomail_sem,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
if((file=nopen(cmdstr(cfg.sub[subnum]->echomail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
return(true);
}
......@@ -232,7 +232,8 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
}
if(cfg.sub[j]->misc&SUB_FIDO && cfg.sub[j]->echomail_sem[0]) /* update semaphore */
if((file=nopen(cfg.sub[j]->echomail_sem,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
if((file=nopen(cmdstr(cfg.sub[j]->echomail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
lprintf("Message from %s Posted on %s %s"
,cfg.qhub[hubnum]->id,cfg.grp[cfg.sub[j]->grp]->sname,cfg.sub[j]->lname);
......
......@@ -396,7 +396,8 @@ bool sbbs_t::unpack_rep(char* repfile)
sprintf(str,"Posted on %s/%s",cfg.grp[cfg.sub[n]->grp]->sname
,cfg.sub[n]->lname);
if(cfg.sub[n]->misc&SUB_FIDO && cfg.sub[n]->echomail_sem[0]) /* semaphore */
if((file=nopen(cfg.sub[n]->echomail_sem,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
if((file=nopen(cmdstr(cfg.sub[n]->echomail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
logline("P+",str); } } /* end of public message */
......
......@@ -177,7 +177,8 @@ bool sbbs_t::uploadfile(file_t *f)
sprintf(str,"Uploaded %s to %s %s",f->name,cfg.lib[cfg.dir[f->dir]->lib]->sname
,cfg.dir[f->dir]->sname);
if(cfg.dir[f->dir]->upload_sem[0])
if((file=nopen(cfg.dir[f->dir]->upload_sem,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
if((file=nopen(cmdstr(cfg.dir[f->dir]->upload_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
logline("U+",str);
/**************************/
......
......@@ -1187,7 +1187,7 @@ bool sbbs_t::movemsg(smbmsg_t* msg, uint subnum)
,cfg.grp[cfg.sub[subnum]->grp]->sname,cfg.sub[subnum]->sname);
logline("M+",str);
if(cfg.sub[newsub]->misc&SUB_FIDO && cfg.sub[newsub]->echomail_sem[0])
if((file=nopen(cfg.sub[newsub]->echomail_sem
if((file=nopen(cmdstr(cfg.sub[newsub]->echomail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
return(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment