Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
5216a8f9
Commit
5216a8f9
authored
Dec 27, 2001
by
rswindell
Browse files
Added new ARS keyword: SHELL, for testing user's selected command shell.
parent
369ee798
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
6 deletions
+33
-6
src/sbbs3/ars.c
src/sbbs3/ars.c
+6
-2
src/sbbs3/ars_defs.h
src/sbbs3/ars_defs.h
+1
-0
src/sbbs3/chk_ar.cpp
src/sbbs3/chk_ar.cpp
+14
-3
src/sbbs3/userdat.c
src/sbbs3/userdat.c
+12
-1
No files found.
src/sbbs3/ars.c
View file @
5216a8f9
...
...
@@ -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
...
...
src/sbbs3/ars_defs.h
View file @
5216a8f9
...
...
@@ -107,6 +107,7 @@ enum { /* Access requirement binaries */
,
AR_WIN32
,
AR_UNIX
,
AR_LINUX
,
AR_SHELL
};
#endif
/* Don't add anything after this line */
src/sbbs3/chk_ar.cpp
View file @
5216a8f9
...
...
@@ -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
))
||
str
i
cmp
(
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
))
||
str
i
cmp
(
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
);
}
...
...
src/sbbs3/userdat.c
View file @
5216a8f9
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment