Commit 1cdf2c10 authored by rswindell's avatar rswindell

ARS improvements:

Added HOST and IP keywords to allow restricted access/privileges to/for
specific remote hostnames or IP addresses (wildcards allowed).
All string-argument type ARS keywords (e.g. SHELL, PROT, etc.) now support .can
style wildcards.
The current remote client is now used for protocol, host, and IP ARS checking,
when available, so this requires passing the client pointer around (which
explains why so many files are touched by this change) and takes care of a
long standing to-do item (the user's 'modem' value was used for the PROT
value checking, which was not always correct).
parent c1de866a
......@@ -266,7 +266,7 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
if(mode&FILE_ID) {
for(i=0;i<scfg.total_fextrs;i++)
if(!stricmp(scfg.fextr[i]->ext,f.name+9) && chk_ar(&scfg,scfg.fextr[i]->ar,NULL))
if(!stricmp(scfg.fextr[i]->ext,f.name+9) && chk_ar(&scfg,scfg.fextr[i]->ar,/* user: */NULL, /* client: */NULL))
break;
if(i<scfg.total_fextrs) {
sprintf(tmp,"%sFILE_ID.DIZ",scfg.temp_dir);
......@@ -469,7 +469,7 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
if(mode&FILE_ID) {
for(i=0;i<scfg.total_fextrs;i++)
if(!stricmp(scfg.fextr[i]->ext,f.name+9) && chk_ar(&scfg,scfg.fextr[i]->ar,NULL))
if(!stricmp(scfg.fextr[i]->ext,f.name+9) && chk_ar(&scfg,scfg.fextr[i]->ar,/* user: */NULL, /* client: */NULL))
break;
if(i<scfg.total_fextrs) {
sprintf(tmp,"%sFILE_ID.DIZ",scfg.temp_dir);
......@@ -891,7 +891,7 @@ int main(int argc, char **argv)
printf("%s %7lu %s\n",f.name,f.cdt,f.desc);
if(mode&FILE_ID) {
for(i=0;i<scfg.total_fextrs;i++)
if(!stricmp(scfg.fextr[i]->ext,f.name+9) && chk_ar(&scfg,scfg.fextr[i]->ar,NULL))
if(!stricmp(scfg.fextr[i]->ext,f.name+9) && chk_ar(&scfg,scfg.fextr[i]->ar,/* user: */NULL, /* client: */NULL))
break;
if(i<scfg.total_fextrs) {
sprintf(tmp,"%sFILE_ID.DIZ",scfg.temp_dir);
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -310,6 +310,22 @@ uchar* arstr(ushort* count, char* str, scfg_t* cfg)
not=0;
ar[j++]=artype;
i+=3; }
else if(!strnicmp(str+i,"HOST",4)) {
artype=AR_HOST;
if(not)
ar[j++]=AR_NOT;
not=0;
ar[j++]=artype;
i+=3;
}
else if(!strnicmp(str+i,"IP",2)) {
artype=AR_IP;
if(not)
ar[j++]=AR_NOT;
not=0;
ar[j++]=artype;
i++;
}
else if(!strnicmp(str+i,"SUBCODE",7)) {
artype=AR_SUBCODE;
i+=6; }
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -120,6 +120,8 @@ enum { /* Access requirement binaries */
,AR_DLS
,AR_DLK
,AR_DLM
,AR_HOST /* Remote/client hostname (wildcards allowed) */
,AR_IP /* Remote/client IP address (wildcards allowed) */
};
#endif /* Don't add anything after this line */
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -101,7 +101,7 @@ void sbbs_t::batchmenu()
break;
}
for(i=0,totalcdt=0;i<batdn_total;i++)
if(!is_download_free(&cfg,batdn_dir[i],&useron))
if(!is_download_free(&cfg,batdn_dir[i],&useron,&client))
totalcdt+=batdn_cdt[i];
if(totalcdt>useron.cdt+useron.freecdt) {
bprintf(text[YouOnlyHaveNCredits]
......@@ -122,7 +122,7 @@ void sbbs_t::batchmenu()
mnemonics(text[ProtocolOrQuit]);
strcpy(tmp2,"Q");
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->bicmd[0] && chk_ar(cfg.prot[i]->ar,&useron)) {
if(cfg.prot[i]->bicmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) {
sprintf(tmp,"%c",cfg.prot[i]->mnemonic);
strcat(tmp2,tmp); }
ungetkey(useron.prot);
......@@ -131,7 +131,7 @@ void sbbs_t::batchmenu()
break;
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->bicmd[0] && cfg.prot[i]->mnemonic==ch
&& chk_ar(cfg.prot[i]->ar,&useron))
&& chk_ar(cfg.prot[i]->ar,&useron,&client))
break;
if(i<cfg.total_prots) {
if(!create_batchdn_lst((cfg.prot[i]->misc&PROT_NATIVE) ? true:false))
......@@ -288,7 +288,7 @@ void sbbs_t::batchmenu()
mnemonics(text[ProtocolOrQuit]);
strcpy(str,"Q");
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->batulcmd[0] && chk_ar(cfg.prot[i]->ar,&useron)) {
if(cfg.prot[i]->batulcmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) {
sprintf(tmp,"%c",cfg.prot[i]->mnemonic);
strcat(str,tmp);
}
......@@ -297,7 +297,7 @@ void sbbs_t::batchmenu()
break;
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->batulcmd[0] && cfg.prot[i]->mnemonic==ch
&& chk_ar(cfg.prot[i]->ar,&useron))
&& chk_ar(cfg.prot[i]->ar,&useron,&client))
break;
if(i<cfg.total_prots) {
sprintf(str,"%sBATCHUP.LST",cfg.node_dir);
......@@ -354,7 +354,7 @@ BOOL sbbs_t::start_batch_download()
return(FALSE);
}
for(i=0,totalcdt=0;i<batdn_total;i++)
if(is_download_free(&cfg,batdn_dir[i],&useron))
if(is_download_free(&cfg,batdn_dir[i],&useron,&client))
totalcdt+=batdn_cdt[i];
if(totalcdt>useron.cdt+useron.freecdt) {
bprintf(text[YouOnlyHaveNCredits]
......@@ -376,7 +376,7 @@ BOOL sbbs_t::start_batch_download()
mnemonics(text[ProtocolOrQuit]);
strcpy(str,"Q");
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->batdlcmd[0] && chk_ar(cfg.prot[i]->ar,&useron)) {
if(cfg.prot[i]->batdlcmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) {
sprintf(tmp,"%c",cfg.prot[i]->mnemonic);
strcat(str,tmp);
}
......@@ -386,7 +386,7 @@ BOOL sbbs_t::start_batch_download()
return(FALSE);
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->batdlcmd[0] && cfg.prot[i]->mnemonic==ch
&& chk_ar(cfg.prot[i]->ar,&useron))
&& chk_ar(cfg.prot[i]->ar,&useron,&client))
break;
if(i>=cfg.total_prots)
return(FALSE); /* no protocol selected */
......@@ -443,7 +443,7 @@ BOOL sbbs_t::start_batch_download()
for(j=0;j<cfg.total_dlevents;j++) {
if(stricmp(cfg.dlevent[j]->ext,batdn_name[i]+9))
continue;
if(!chk_ar(cfg.dlevent[j]->ar,&useron))
if(!chk_ar(cfg.dlevent[j]->ar,&useron,&client))
continue;
bputs(cfg.dlevent[j]->workstr);
external(cmdstr(cfg.dlevent[j]->cmd,path,nulstr,NULL),EX_OUTL);
......@@ -792,17 +792,17 @@ bool sbbs_t::addtobatdl(file_t* f)
return(false);
}
for(i=0,totalcdt=0;i<batdn_total;i++)
if(!is_download_free(&cfg,batdn_dir[i],&useron))
if(!is_download_free(&cfg,batdn_dir[i],&useron,&client))
totalcdt+=batdn_cdt[i];
if(cfg.dir[f->dir]->misc&DIR_FREE) f->cdt=0L;
if(!is_download_free(&cfg,f->dir,&useron))
if(!is_download_free(&cfg,f->dir,&useron,&client))
totalcdt+=f->cdt;
if(totalcdt>useron.cdt+useron.freecdt) {
bprintf(text[CantAddToQueue],f->name);
bprintf(text[YouOnlyHaveNCredits],ultoac(useron.cdt+useron.freecdt,tmp));
return(false);
}
if(!chk_ar(cfg.dir[f->dir]->dl_ar,&useron)) {
if(!chk_ar(cfg.dir[f->dir]->dl_ar,&useron,&client)) {
bprintf(text[CantAddToQueue],f->name);
bputs(text[CantDownloadFromDir]);
return(false);
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -123,7 +123,7 @@ bool sbbs_t::bulkmail(uchar *ar)
continue;
if(user.misc&(DELETED|INACTIVE))
continue;
if(chk_ar(ar,&user)) {
if(chk_ar(ar,&user,/* client: */NULL)) {
if((x=bulkmailhdr(&smb, &msg, i))!=SMB_SUCCESS) {
errormsg(WHERE,ERR_WRITE,smb.file,x);
break;
......
......@@ -80,7 +80,7 @@ void sbbs_t::multinodechat(int channel)
free(gurubuf);
gurubuf=NULL; }
if(cfg.chan[channel-1]->misc&CHAN_GURU && cfg.chan[channel-1]->guru<cfg.total_gurus
&& chk_ar(cfg.guru[cfg.chan[channel-1]->guru]->ar,&useron)) {
&& chk_ar(cfg.guru[cfg.chan[channel-1]->guru]->ar,&useron,&client)) {
sprintf(str,"%s%s.dat",cfg.ctrl_dir,cfg.guru[cfg.chan[channel-1]->guru]->code);
if((file=nopen(str,O_RDONLY))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_RDONLY);
......@@ -215,7 +215,7 @@ void sbbs_t::multinodechat(int channel)
gurubuf=NULL; }
if(cfg.chan[savch-1]->misc&CHAN_GURU
&& cfg.chan[savch-1]->guru<cfg.total_gurus
&& chk_ar(cfg.guru[cfg.chan[savch-1]->guru]->ar,&useron
&& chk_ar(cfg.guru[cfg.chan[savch-1]->guru]->ar,&useron,&client
)) {
sprintf(str,"%s%s.dat",cfg.ctrl_dir
,cfg.guru[cfg.chan[savch-1]->guru]->code);
......@@ -523,7 +523,7 @@ bool sbbs_t::guru_page(void)
bprintf(text[SysopIsNotAvailable],"The Guru");
return(false);
}
if(cfg.total_gurus==1 && chk_ar(cfg.guru[0]->ar,&useron))
if(cfg.total_gurus==1 && chk_ar(cfg.guru[0]->ar,&useron,&client))
i=0;
else {
for(i=0;i<cfg.total_gurus;i++)
......@@ -614,7 +614,7 @@ void sbbs_t::chatsection()
no_rip_menu=1;
if(sysop_page())
break;
if(cfg.total_gurus && chk_ar(cfg.guru[0]->ar,&useron)) {
if(cfg.total_gurus && chk_ar(cfg.guru[0]->ar,&useron,&client)) {
sprintf(str,text[ChatWithGuruInsteadQ],cfg.guru[0]->name);
if(!yesno(str))
break; }
......@@ -658,14 +658,14 @@ bool sbbs_t::sysop_page(void)
}
if(startup->options&BBS_OPT_SYSOP_AVAILABLE
|| (cfg.sys_chat_ar[0] && chk_ar(cfg.sys_chat_ar,&useron))
|| (cfg.sys_chat_ar[0] && chk_ar(cfg.sys_chat_ar,&useron,&client))
|| useron.exempt&FLAG('C')) {
sprintf(str,"%s paged sysop for chat",useron.alias);
logline("C",str);
for(i=0;i<cfg.total_pages;i++)
if(chk_ar(cfg.page[i]->ar,&useron))
if(chk_ar(cfg.page[i]->ar,&useron,&client))
break;
if(i<cfg.total_pages) {
bprintf(text[PagingGuru],cfg.sys_op);
......@@ -700,7 +700,7 @@ bool sbbs_t::sysop_page(void)
bool sbbs_t::chan_access(uint cnum)
{
if(!cfg.total_chans || cnum>=cfg.total_chans || !chk_ar(cfg.chan[cnum]->ar,&useron)) {
if(!cfg.total_chans || cnum>=cfg.total_chans || !chk_ar(cfg.chan[cnum]->ar,&useron,&client)) {
bputs(text[CantAccessThatChannel]);
return(false); }
if(!(useron.exempt&FLAG('J')) && cfg.chan[cnum]->cost>useron.cdt+useron.freecdt) {
......@@ -1712,7 +1712,7 @@ bool sbbs_t::guruexp(char **ptrptr, char *line)
cp=strchr(str,']');
if(cp) *cp=0;
ar=arstr(NULL,str,&cfg);
c=chk_ar(ar,&useron);
c=chk_ar(ar,&useron,&client);
if(ar[0]!=AR_NULL)
free(ar);
if(!c && _and) {
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -37,12 +37,13 @@
#include "sbbs.h"
bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user)
bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user, client_t* client)
{
bool result,_not,_or,equal;
uint i,n,artype,age;
ulong l;
struct tm tm;
const char* p;
result = true;
......@@ -70,7 +71,7 @@ bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user)
if((**ptrptr)==AR_BEGNEST) {
(*ptrptr)++;
if(ar_exp(ptrptr,user))
if(ar_exp(ptrptr,user,client))
result=!_not;
else
result=_not;
......@@ -293,7 +294,7 @@ bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user)
break;
case AR_SUBCODE:
if(cursubnum>=cfg.total_subs
|| stricmp(cfg.sub[cursubnum]->code,(char*)*ptrptr))
|| !findstr_in_string(cfg.sub[cursubnum]->code,(char*)*ptrptr))
result=_not;
else
result=!_not;
......@@ -328,7 +329,7 @@ bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user)
break;
case AR_DIRCODE:
if(curdirnum>=cfg.total_dirs
|| stricmp(cfg.dir[curdirnum]->code,(char *)*ptrptr))
|| !findstr_in_string(cfg.dir[curdirnum]->code,(char *)*ptrptr))
result=_not;
else
result=!_not;
......@@ -562,7 +563,7 @@ bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user)
break;
case AR_SHELL:
if(user->shell>=cfg.total_shells
|| stricmp(cfg.shell[user->shell]->code,(char*)*ptrptr))
|| !findstr_in_string(cfg.shell[user->shell]->code,(char*)*ptrptr))
result=_not;
else
result=!_not;
......@@ -570,7 +571,35 @@ bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user)
(*ptrptr)++;
break;
case AR_PROT:
if(stricmp(user->modem,(char*)*ptrptr)) /* should this be changed to client.prot? */
if(client!=NULL)
p=client->protocol;
else
p=user->modem;
if(!findstr_in_string(p,(char*)*ptrptr))
result=_not;
else
result=!_not;
while(*(*ptrptr))
(*ptrptr)++;
break;
case AR_HOST:
if(client!=NULL)
p=client->host;
else
p=user->comp;
if(!findstr_in_string(p,(char*)*ptrptr))
result=_not;
else
result=!_not;
while(*(*ptrptr))
(*ptrptr)++;
break;
case AR_IP:
if(client!=NULL)
p=client->addr;
else
p=user->note;
if(!findstr_in_string(p,(char*)*ptrptr))
result=_not;
else
result=!_not;
......@@ -582,14 +611,14 @@ bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user)
return(result);
}
bool sbbs_t::chk_ar(const uchar *ar, user_t* user)
bool sbbs_t::chk_ar(const uchar *ar, user_t* user, client_t* client)
{
const uchar *p;
if(ar==NULL)
return(true);
p=ar;
return(ar_exp(&p,user));
return(ar_exp(&p,user,client));
}
......@@ -602,11 +631,11 @@ void sbbs_t::getusrsubs()
uint i,j,k,l;
for(j=0,i=0;i<cfg.total_grps;i++) {
if(!chk_ar(cfg.grp[i]->ar,&useron))
if(!chk_ar(cfg.grp[i]->ar,&useron,&client))
continue;
for(k=0,l=0;l<cfg.total_subs;l++) {
if(cfg.sub[l]->grp!=i) continue;
if(!chk_ar(cfg.sub[l]->ar,&useron))
if(!chk_ar(cfg.sub[l]->ar,&useron,&client))
continue;
usrsub[j][k++]=l;
}
......@@ -635,11 +664,11 @@ void sbbs_t::getusrdirs()
return;
}
for(j=0,i=0;i<cfg.total_libs;i++) {
if(!chk_ar(cfg.lib[i]->ar,&useron))
if(!chk_ar(cfg.lib[i]->ar,&useron,&client))
continue;
for(k=0,l=0;l<cfg.total_dirs;l++) {
if(cfg.dir[l]->lib!=i) continue;
if(!chk_ar(cfg.dir[l]->ar,&useron))
if(!chk_ar(cfg.dir[l]->ar,&useron,&client))
continue;
usrdir[j][k++]=l; }
usrdirs[j]=k;
......@@ -689,7 +718,7 @@ uint sbbs_t::getusrsub(uint subnum)
int sbbs_t::dir_op(uint dirnum)
{
return(SYSOP || (cfg.dir[dirnum]->op_ar[0] && chk_ar(cfg.dir[dirnum]->op_ar,&useron)));
return(SYSOP || (cfg.dir[dirnum]->op_ar[0] && chk_ar(cfg.dir[dirnum]->op_ar,&useron,&client)));
}
......@@ -63,7 +63,7 @@ int sbbs_t::uselect(int add, uint n, const char *title, const char *item, const
uselect_total=0;
if(add) {
if(ar && !chk_ar(ar,&useron))
if(ar && !chk_ar(ar,&useron,&client))
return(0);
if(!uselect_total)
bprintf(text[SelectItemHdr],title);
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -68,7 +68,7 @@ void sbbs_t::downloadfile(file_t* f)
/* Update Downloader's Info */
/****************************/
user_downloaded(&cfg, &useron, 1, length);
if(!is_download_free(&cfg,f->dir,&useron))
if(!is_download_free(&cfg,f->dir,&useron,&client))
subtract_cdt(&cfg,&useron,f->cdt);
/**************************/
/* Update Uploader's Info */
......@@ -462,7 +462,7 @@ bool sbbs_t::sendfile(char* fname, char prot)
mnemonics(text[ProtocolOrQuit]);
strcpy(keys,"Q");
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->dlcmd[0] && chk_ar(cfg.prot[i]->ar,&useron))
if(cfg.prot[i]->dlcmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client))
sprintf(keys+strlen(keys),"%c",cfg.prot[i]->mnemonic);
ch=(char)getkeys(keys,0);
......@@ -471,7 +471,7 @@ bool sbbs_t::sendfile(char* fname, char prot)
return(false);
}
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->mnemonic==ch && chk_ar(cfg.prot[i]->ar,&useron))
if(cfg.prot[i]->mnemonic==ch && chk_ar(cfg.prot[i]->ar,&useron,&client))
break;
if(i<cfg.total_prots) {
if(protocol(cfg.prot[i],XFER_DOWNLOAD,fname,fname,false)==0)
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -139,7 +139,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode)
mnemonics(text[ProtocolOrQuit]);
strcpy(str,"Q");
for(x=0;x<cfg.total_prots;x++)
if(cfg.prot[x]->ulcmd[0] && chk_ar(cfg.prot[x]->ar,&useron)) {
if(cfg.prot[x]->ulcmd[0] && chk_ar(cfg.prot[x]->ar,&useron,&client)) {
sprintf(tmp,"%c",cfg.prot[x]->mnemonic);
strcat(str,tmp); }
ch=(char)getkeys(str,0);
......@@ -149,7 +149,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode)
return(false); }
for(x=0;x<cfg.total_prots;x++)
if(cfg.prot[x]->ulcmd[0] && cfg.prot[x]->mnemonic==ch
&& chk_ar(cfg.prot[x]->ar,&useron))
&& chk_ar(cfg.prot[x]->ar,&useron,&client))
break;
if(x<cfg.total_prots) /* This should be always */
protocol(cfg.prot[x],XFER_UPLOAD,str2,nulstr,true);
......
......@@ -1748,7 +1748,7 @@ int sbbs_t::exec(csi_t *csi)
csi->logic=LOGIC_TRUE;
for(i=0;i<cfg.total_shells;i++)
if(!stricmp(csi->str,cfg.shell[i]->code)
&& chk_ar(cfg.shell[i]->ar,&useron))
&& chk_ar(cfg.shell[i]->ar,&useron,&client))
break;
if(i<cfg.total_shells) {
useron.shell=i;
......@@ -1764,7 +1764,7 @@ int sbbs_t::exec(csi_t *csi)
csi->logic=LOGIC_TRUE;
for(i=0;i<cfg.total_xedits;i++)
if(!stricmp(csi->str,cfg.xedit[i]->code)
&& chk_ar(cfg.xedit[i]->ar,&useron))
&& chk_ar(cfg.xedit[i]->ar,&useron,&client))
break;
if(i<cfg.total_xedits) {
useron.xedit=i+1;
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -265,7 +265,7 @@ int sbbs_t::exec_file(csi_t *csi)
if(usrlibs) {
i=usrdir[curlib][curdir[curlib]];
if(cfg.upload_dir!=INVALID_DIR
&& !chk_ar(cfg.dir[i]->ul_ar,&useron))
&& !chk_ar(cfg.dir[i]->ul_ar,&useron,&client))
i=cfg.upload_dir;
} else
i=cfg.upload_dir;
......
......@@ -964,7 +964,7 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
cmdstr((char *)csi->ip,csi->str,csi->str,str);
while(*(csi->ip++)); /* Find NULL */
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->mnemonic==ch && chk_ar(cfg.prot[i]->ar,&useron))
if(cfg.prot[i]->mnemonic==ch && chk_ar(cfg.prot[i]->ar,&useron,&client))
break;
csi->logic=LOGIC_FALSE;
if(i<cfg.total_prots)
......@@ -979,7 +979,7 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
pp=getstrvar(csi,*(int32_t *)csi->ip);
csi->ip+=4;
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->mnemonic==ch && chk_ar(cfg.prot[i]->ar,&useron))
if(cfg.prot[i]->mnemonic==ch && chk_ar(cfg.prot[i]->ar,&useron,&client))
break;
csi->logic=LOGIC_FALSE;
if(!pp || !(*pp))
......@@ -1465,7 +1465,7 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
return(0);
case CS_COMPARE_ARS:
i=*(csi->ip++); /* Length of ARS stored as byte before ARS */
csi->logic=!chk_ar(csi->ip,&useron);
csi->logic=!chk_ar(csi->ip,&useron,&client);
csi->ip+=i;
return(0);
case CS_TOGGLE_USER_MISC:
......
......@@ -246,16 +246,17 @@ bool sbbs_t::netmail(const char *into, const char *title, long mode)
mnemonics(text[ProtocolOrQuit]);
strcpy(str,"Q");
for(x=0;x<cfg.total_prots;x++)
if(cfg.prot[x]->ulcmd[0] && chk_ar(cfg.prot[x]->ar,&useron)) {
if(cfg.prot[x]->ulcmd[0] && chk_ar(cfg.prot[x]->ar,&useron,&client)) {
sprintf(tmp,"%c",cfg.prot[x]->mnemonic);
strcat(str,tmp); }
strcat(str,tmp);
}
ch=(char)getkeys(str,0);
if(ch=='Q' || sys_status&SS_ABORT) {
bputs(text[Aborted]);
return(false); }
for(x=0;x<cfg.total_prots;x++)
if(cfg.prot[x]->ulcmd[0] && cfg.prot[x]->mnemonic==ch
&& chk_ar(cfg.prot[x]->ar,&useron))
&& chk_ar(cfg.prot[x]->ar,&useron,&client))
break;
if(x<cfg.total_prots) /* This should be always */
protocol(cfg.prot[x],XFER_UPLOAD,subj,nulstr,true);
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -511,7 +511,7 @@ void sbbs_t::printnodedat(uint number, node_t* node)
else {
bputs("running ");
i=node->aux-1;
if(SYSOP || chk_ar(cfg.xtrn[i]->ar,&useron))
if(SYSOP || chk_ar(cfg.xtrn[i]->ar,&useron,&client))
bputs(cfg.xtrn[node->aux-1]->name);
else
bputs("external program");
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -98,7 +98,7 @@ static char* dir_prop_desc[] = {
JSObject* DLLCALL js_CreateFileAreaObject(JSContext* cx, JSObject* parent, scfg_t* cfg