Commit 5216a8f9 authored by rswindell's avatar rswindell

Added new ARS keyword: SHELL, for testing user's selected command shell.

parent 369ee798
......@@ -392,8 +392,12 @@ uchar* arstr(ushort* count, char* str, scfg_t* cfg)
else if(!strnicmp(str+i,"FILE_CMDS",9)) {
artype=AR_FILE_CMDS;
i+=8; }
else if(!strnicmp(str+i,"SHELL",5)) {
artype=AR_SHELL;
i+=4; }
if(n!=i) /* one of the above */
continue; }
continue;
}
if(not)
ar[j++]=AR_NOT;
......@@ -472,7 +476,7 @@ uchar* arstr(ushort* count, char* str, scfg_t* cfg)
break; }
while(isdigit(str[i+1])) i++;
continue; }
if(artype==AR_SUBCODE || artype==AR_DIRCODE) {
if(artype==AR_SUBCODE || artype==AR_DIRCODE || artype==AR_SHELL) {
for(n=0;n<8
&& str[i]
&& str[i]!=SP
......
......@@ -107,6 +107,7 @@ enum { /* Access requirement binaries */
,AR_WIN32
,AR_UNIX
,AR_LINUX
,AR_SHELL
};
#endif /* Don't add anything after this line */
......@@ -267,7 +267,7 @@ bool sbbs_t::ar_exp(uchar **ptrptr, user_t* user)
break;
case AR_SUBCODE:
if(cursubnum>=cfg.total_subs
|| strcmp(cfg.sub[cursubnum]->code,(char*)*ptrptr))
|| stricmp(cfg.sub[cursubnum]->code,(char*)*ptrptr))
result=_not;
else
result=!_not;
......@@ -302,7 +302,7 @@ bool sbbs_t::ar_exp(uchar **ptrptr, user_t* user)
break;
case AR_DIRCODE:
if(curdirnum>=cfg.total_dirs
|| strcmp(cfg.dir[curdirnum]->code,(char *)*ptrptr))
|| stricmp(cfg.dir[curdirnum]->code,(char *)*ptrptr))
result=_not;
else
result=!_not;
......@@ -491,7 +491,18 @@ bool sbbs_t::ar_exp(uchar **ptrptr, user_t* user)
if(!result) {
noaccess_str=text[NoAccessSex];
noaccess_val=n; }
break; } }
break;
case AR_SHELL:
if(user->shell>=cfg.total_shells
|| stricmp(cfg.shell[user->shell]->code,(char*)*ptrptr))
result=_not;
else
result=!_not;
while(*(*ptrptr))
(*ptrptr)++;
break;
}
}
return(result);
}
......
......@@ -1089,7 +1089,18 @@ static BOOL ar_exp(scfg_t* cfg, uchar **ptrptr, user_t* user)
result=not;
else
result=!not;
break; } }
break;
case AR_SHELL:
if(user->shell>=cfg->total_shells
|| stricmp(cfg->shell[user->shell]->code,(char*)*ptrptr))
result=not;
else
result=!not;
while(*(*ptrptr))
(*ptrptr)++;
break;
}
}
return(result);
}
......
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