Skip to content
Snippets Groups Projects
Commit 5216a8f9 authored by rswindell's avatar rswindell
Browse files

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

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